Point Marker
Point markers are a type of map element used to indicate information about a location. This chapter describes how to use dot markers on a map surface, including:
1. Marker Marker
Point Marker
1. Create a dot icon for the default icon:
// Create a Marker instance: var marker = new nimap.Marker().setLngLat([116.405467, 39.907761]);
// Add the created point marker to the existing map instance: marker.addTo(map);
// Remove the created marker marker.remove();
2. Create a custom html dot tag:
// Create a custom Marker instance: var div = document.createElement('div'); div.innerHtml="custom icon"; var marker = new nimap.Marker({element:div}).setLngLat([116.405467, 39.907761]);
// Add the created point marker to the existing map instance: marker.addTo(map);
// Remove the created marker marker.remove();