b = map_name.removeMarker(markerId);
The
Map.removeMarker function removes a marker from the
Map object named
map_name. The
markerId should be the id returned by
Map.addMarker function when the marker was added to the map.
The function returns a logical value of 1 (true) if the marker was found and was successfully removed and 0 (false) if there is an error.
PROC GLOBAL
// Function that allows the user to modify the marker text or description,
// or to remove the marker from the map
function editMarker(Map m, numeric markerId)
numeric sel = accept("Edit marker", "Text", "Description", "Remove");
if sel = 1 then
string newText = prompt("Enter new icon text");
if newText <> "" then
m.setMarkerText(markerId, newText);
endif;
elseif sel = 2 then
string newDescription = prompt("Enter new icon description");
if newDescription <> "" then
m.setMarkerDescription(markerId, newDescription);
endif;
elseif sel = 3 then
if accept("Confirm marker removal from the map", "Yes", "No") = 1 then
m.removeMarker(markerId);
endif;
endif;
end;
PROC SHOW_MAP
preproc
// Declare a map
Map mymap;
// Add a marker to the map at latitude 38.84839, longitude -76.931098
numeric markerId = mymap.addMarker(38.84839, -76.931098);
mymap.setMarkerDescription(markerId, "U.S. Census Bureau");
// Call edit marker when user taps on popup info window
mymap.setMarkerOnClickInfoWindow(markerId, editMarker(mymap, markerId));
// Display the map
mymap.show();