I use the code below to add markers to a mapbox map.
var marker = L.marker([latitude, longitude],
{
icon: L.divIcon({
html: 'myhtml',
iconSize: [40, 40]
})
});
marker.addto(map);
I added tokens using the loop using the code above. Now I want to remove the marker to update the map. Can I remove all markers and polylines from the map. Or, if there is any way, I can reload the mapbox.
source
share