I want to build web app with the Leaflet API. First my user is geolocated with IP then if he accepts I try to update his position with HTML5 geolocation (accuracy is better). >
Try update() of marker method it works for me
var lat = (e.latlng.lat); var lng = (e.latlng.lng); marker.setLatLng([lat, lng]).update(); // Updates your defined marker position