On each iteration add marker to map
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-12-13 18:47:39 +01:00
parent 9e197a2b13
commit 9b60c4437c

View file

@ -38,7 +38,11 @@
latitude = crd.latitude; latitude = crd.latitude;
longitude = crd.longitude; longitude = crd.longitude;
accuracy = crd.accuracy; accuracy = crd.accuracy;
const userMarker = leaflet.marker([latitude, longitude]).addTo(map);
// move the map to have the location in its center
map.panTo(userMarker.getLatLng());
string += "Your current position is:"; string += "Your current position is:";
string += `Latitude : ${crd.latitude}`; string += `Latitude : ${crd.latitude}`;
string += `Longitude: ${crd.longitude}`; string += `Longitude: ${crd.longitude}`;