b = map_name.setMarkerDescription(markerId, description);
The
Map.setMarkerDescription function associates the string expression
description with the given
markerId. The description will appear in a popup box next to the
markerId's map location when the user taps the marker. The text box will disappear when the popup box is closed.
The
description may contain the following HTML tags:
- <b> - bold
- <i> - italic
- <ul> - underline
- <strike> or <s> - strikethrough
- <sup> - superscript
- <sub> - subscript
- <font> - font (including color)
- <br/> - line break
The function returns a logical value of 1 (true) if the marker was found and the description was set successfully, or 0 (false) if there was an error.
// 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);
// Set the popup text when marker is tapped to
// display name of head of household and number of household
// members
string popupText = maketext("Head: %s %s Males: %d Females %d",
strip(HEAD_FIRST_NAME),
strip(HEAD_LAST_NAME),
MALE_MEMBERS, FEMALE_MEMBERS);
mymap.setMarkerDescription(markerId, popupText);
// Display the map
mymap.show();