Add static initial pianello coordinates
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-18 18:11:04 +02:00
parent 80c53c6de6
commit ed0d21020e

View file

@ -2,6 +2,7 @@
import { onMount, onDestroy } from 'svelte';
import { fade, fly } from 'svelte/transition';
const pianelloCoordinates = [43.14, 12.53];
let mapElement: string | HTMLElement;
let leaflet;
let map;
@ -9,7 +10,7 @@
let latitude;
let longitude;
let accuracy;
const loadWorker = async () => {
if (!("geolocation" in navigator)) {
return;
@ -35,7 +36,6 @@
string += `Longitude: ${crd.longitude}`;
string += `More or less ${crd.accuracy} meters.`;
map.setView([latitude, longitude], 13);
}
function error(err) {
@ -46,6 +46,7 @@
};
onMount(async () => {
await loadWorker();
leaflet = await import('leaflet');
layerGroup = leaflet.layerGroup();
@ -56,7 +57,7 @@
minZoom: 12
});
await loadWorker();
map.setView(pianelloCoordinates, 13);
map.setMaxBounds(map.getBounds());