This commit is contained in:
parent
aa22f698b1
commit
a08da30a10
1 changed files with 3 additions and 6 deletions
|
@ -12,7 +12,6 @@
|
|||
|
||||
const loadWorker = async () => {
|
||||
if (!("geolocation" in navigator)) {
|
||||
/* geolocation is not available */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -44,8 +43,6 @@
|
|||
navigator.geolocation.watchPosition(success, error, options);
|
||||
};
|
||||
|
||||
|
||||
|
||||
onMount(async () => {
|
||||
await loadWorker();
|
||||
leaflet = await import('leaflet');
|
||||
|
@ -59,6 +56,8 @@
|
|||
});
|
||||
|
||||
var latlng = leaflet.latLng(latitude, longitude);
|
||||
console.log(latitude)
|
||||
console.log(longitude)
|
||||
map.setView(latlng, 13);
|
||||
map.setMaxBounds(map.getBounds());
|
||||
|
||||
|
@ -67,9 +66,7 @@
|
|||
attribution:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
})
|
||||
.addTo(map);
|
||||
|
||||
|
||||
.addTo(map);
|
||||
});
|
||||
|
||||
onDestroy(async () => {
|
||||
|
|
Loading…
Reference in a new issue