Hello guys,
I am new to leaflet . I am trying to use it. I tried the gejson thing. I get it well. But, the problem is i have to update the jsondata . That means i have to delete the current markers and add the new markers. If i just add the new json data, i will be over ridding the markers. So, i would like to know , how to clear (or) remove the markers on the map.
The code i used is :
var geojsonFeature = [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 36.75621]
}
}];
L.geoJson(geojsonFeature).addTo(map);
I hope to get a solution to clear all the markers in the map. Thank you.