Update center ositioning of current location
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-18 18:07:52 +02:00
parent e287ba1043
commit 80c53c6de6

View file

@ -34,6 +34,8 @@
string += `Latitude : ${crd.latitude}`;
string += `Longitude: ${crd.longitude}`;
string += `More or less ${crd.accuracy} meters.`;
map.setView([latitude, longitude], 13);
}
function error(err) {
@ -44,7 +46,6 @@
};
onMount(async () => {
await loadWorker();
leaflet = await import('leaflet');
layerGroup = leaflet.layerGroup();
@ -55,10 +56,8 @@
minZoom: 12
});
const latlng = leaflet.latLng(latitude, longitude);
alert(latitude)
aler(longitude)
map.setView(latlng, 13);
await loadWorker();
map.setMaxBounds(map.getBounds());
leaflet