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