From 0c631c7a365e1c8bdb18e814d7c19084a0ebcf87 Mon Sep 17 00:00:00 2001 From: Alessio Davoli Date: Tue, 12 Dec 2023 18:59:19 +0100 Subject: [PATCH] Remove yarn related code --- frontend/.yarnrc.yml | 0 frontend/src/lib/components/tabs/MapTab.svelte | 12 ++++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 frontend/.yarnrc.yml diff --git a/frontend/.yarnrc.yml b/frontend/.yarnrc.yml deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/tabs/MapTab.svelte b/frontend/src/lib/components/tabs/MapTab.svelte index 5654db2..562c142 100644 --- a/frontend/src/lib/components/tabs/MapTab.svelte +++ b/frontend/src/lib/components/tabs/MapTab.svelte @@ -48,9 +48,7 @@ navigator.geolocation.watchPosition(success, error, options); }; - onMount(async () => { - await watchPosition(); - leaflet = await import('leaflet'); + const renderMap = () => { layerGroup = leaflet.layerGroup(); // Startup Map @@ -61,7 +59,7 @@ }); map.setView(pianelloCoordinates, 13); - + map.setMaxBounds(map.getBounds()); leaflet @@ -70,6 +68,12 @@ '© OpenStreetMap contributors' }) .addTo(map); + } + + onMount(async () => { + await watchPosition(); + leaflet = await import('leaflet'); + renderMap() }); onDestroy(async () => {