b = map_name.setMarkerLocation(markerId, latitude, longitude);
The
Map.setMarkerLocation function moves the marker identified by
markerId to a location on the map with coordinates
latitude and
longitude.
latitude and
longitude should be given in degrees.
The function returns a logical value of 1 (true) if the marker was found and the location was set successfully and 0 (false) if there is an error.
PROC GLOBAL
// Declare a map
Map mymap;
// Declare id for map marker
numeric markerId;
// This function is called when the user taps on the map.
// It moves the marker to the location that the user tapped.
function mapClicked()
mymap.setMarkerLocation(markerId, mymap.getLastClickLatitude(), mymap.getLastClickLongitude());
end;
PROC SHOW_MAP
preproc
// Add a marker to the map at latitude 38.84839, longitude -76.931098
markerId = mymap.addMarker(38.84839, -76.931098);
// Set function that is called when the user taps on the map to move the marker
// to the new position
mymap.setOnClick(mapClicked());
// Display the map
mymap.show();