Navigation to a allocation with an Existing Latitude and Longitude

Discussions about CSEntry
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: Navigation to a allocation with an Existing Latitude and Longitude

Post by Yass »

Thanks htuser for the reply and the distance is one bit of what i want do.
Below is what i did and got stuck.

I have this two coordinate taken at different times of the same structure, would like to show this two coordinates on a basemap or uses google map. Indicate the difference in distance.

Code: Select all

function ShowlocMap()
    map locatn_map;
	

	// set the basemap at the subdistict level
	string basemap_filename = maketext("../Maps/Mbtiles/%d.mbtiles",ACTION_SELECT_CLUSTER);

	if fileexist(basemap_filename) then
		locatn_map.setBaseMap(basemap_filename);

	// if the basemap does not exist, they can still look using Google Maps
	else
		numeric checkfile_google = errmsg("The basemap cannot be located: %s. Continue using Google Maps?", basemap_filename)
							select("Cancel", continue, "Use Google Map (Requires Internet)", continue);
		if checkfile_google = 1 then
			exit;
		endif;

	endif;

	// adding each structure from the listing data (with GPS coordinates) to the map
	// ??  How do i change the type of marker and color for the Listing Structure on the MAP
	if loadcase(LIST_STR_DICT,ACTION_SELECT_CLUSTER,SELECT_HH)=1 then
          locatn_map.addMarker(XLATITUDEAH,XLONGITUDEAH); 
        endif;
	
	// adding each structure from the previous household data (with GPS coordinates) to the map
	// ??  How do i change the type of marker and color for HH Structure on the MAP
    if loadcase(HH_STR,ACTION_SELECT_CLUSTER,SELECT_HH)=1 then
    locatn_map.addMarker(CLATITUDEAH,CLONGITUDEAH); 
    endif;
	
	 //WHERE I STOP
    
     //?? how to generate the distance between the Listing and  HH Structure
	 
    // ?? Use a textbutton to show the distance 
	
   //??  Show the current location
	
//?? Navigate from current location to file 1
	
	
end;
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Navigation to a allocation with an Existing Latitude and Longitude

Post by htuser »

Dear Yass,
On Windows OS, it's possible to modify Leaflet,who's the mapping engine, and adding offline routing with OpenMapstreet vector tiles as basemap. This can solve your request.
As you know, the CSPro-Javascript API can help us solving lot of request and issues. And implement complexe UI and operations within CSPro.
But this requires you to know about JS who's a powerful, but complicated programming language.

For distance calculation displayed on a button, it's easy with CSPro-JS API. Please take a look to my latest post regarding and help provided by Alex. This will help you.
For Displaying from CSPro to Google Map, i don't think about this way, so, i don't know more.

For your questions:
?? How do i change the type of marker and color for HH Structure on the MAP
Please use a different icon file for different HH Structure following this function:
https://www.csprousers.org/help/CSPro/m ... ction.html
?? how to generate the distance between the Listing and HH Structure
I already post a function that you can use for. It's based on the distance from GPS coordinates documented here: https://www.csprousers.org/help/CSPro/gps_function.html
// ?? Use a textbutton to show the distance
In the CAPI part of the Apps you can use HTML button and display result from a CSPro function on it.
//?? Show the current location
CSPro Map already show the current location and heading on the map, https://www.csprousers.org/help/CSPro/map.html
but not display Lat/Long and heading in degrees. Again, you can use the CAPI part to display the Lat/Long and heading in degrees for any coordinates. Alex give us a convenient way to interact with CSPro and Javascript that you can use for this purpose.

Hope this help you,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply