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