Friday 28 April 2017

Update marker position in Leaflet


I would like to use this function to update the marker every time the GPS is detected, it works but always adds a new marker and circle.


function onLocationFound(e) {
var radius = e.accuracy / 2;

L.marker((e.latlng), {icon: IsyUserIcon}).addTo(map).bindPopup("You are within " + radius + " meters from this point").openPopup();
L.circle(e.latlng, radius).addTo(map);

}


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...