This commit is contained in:
parent
40277e3380
commit
0c631c7a36
2 changed files with 8 additions and 4 deletions
|
@ -48,9 +48,7 @@
|
||||||
navigator.geolocation.watchPosition(success, error, options);
|
navigator.geolocation.watchPosition(success, error, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMount(async () => {
|
const renderMap = () => {
|
||||||
await watchPosition();
|
|
||||||
leaflet = await import('leaflet');
|
|
||||||
layerGroup = leaflet.layerGroup();
|
layerGroup = leaflet.layerGroup();
|
||||||
|
|
||||||
// Startup Map
|
// Startup Map
|
||||||
|
@ -61,7 +59,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
map.setView(pianelloCoordinates, 13);
|
map.setView(pianelloCoordinates, 13);
|
||||||
|
|
||||||
map.setMaxBounds(map.getBounds());
|
map.setMaxBounds(map.getBounds());
|
||||||
|
|
||||||
leaflet
|
leaflet
|
||||||
|
@ -70,6 +68,12 @@
|
||||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||||
})
|
})
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
await watchPosition();
|
||||||
|
leaflet = await import('leaflet');
|
||||||
|
renderMap()
|
||||||
});
|
});
|
||||||
|
|
||||||
onDestroy(async () => {
|
onDestroy(async () => {
|
||||||
|
|
Loading…
Reference in a new issue