b = map_name.setMarkerImage(markerId, pathToImage);
The
Map.setMarkerImage sets the icon for the marker with id
markerId on
Map map_name.
markerId is the id that was returned by
Map.addMarker when the marker was added to the map.
pathToImage is the path to a file containing the image to display as the marker icon. Standard image files (PNG, JPEG, BMP) are supported.
The function returns a logical value of 1 (true) if the marker was found and the image was set successfully and 0 (false) if there is 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 icon
mymap.setMarkerImage(markerId, "resources/marker_icon.png");
// Display the map
mymap.show();