Set static coordinates
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-18 17:50:42 +02:00
parent 6a28949f41
commit e516f9fce5

View file

@ -2,11 +2,13 @@
import { onMount, onDestroy } from 'svelte';
import { fade, fly } from 'svelte/transition';
const parmaCoordinates = [44.8, 10.32];
let mapElement: string | HTMLElement;
let leaflet;
let map;
let layerGroup;
let latitude;
let longitude;
let accuracy;
const loadWorker = async () => {
if (!("geolocation" in navigator)) {
@ -45,6 +47,7 @@
onMount(async () => {
await loadWorker();
leaflet = await import('leaflet');
layerGroup = leaflet.layerGroup();
@ -55,7 +58,7 @@
minZoom: 12
});
map.setView(parmaCoordinates, 13);
map.setView([latitude, longitude], 13);
map.setMaxBounds(map.getBounds());
leaflet
@ -65,7 +68,7 @@
})
.addTo(map);
loadWorker();
});
onDestroy(async () => {