diff --git a/web-frontend/src/lib/Map.svelte b/web-frontend/src/lib/Map.svelte index fd21838..6f62600 100644 --- a/web-frontend/src/lib/Map.svelte +++ b/web-frontend/src/lib/Map.svelte @@ -9,15 +9,25 @@ let locationChecked; let locationControl; + export let isVisible = true; export let onMapClick = () => {}; export let map; + $: if (isVisible) { + locationCheckedChanged(false); + } + const locationCheckedChanged = (setValue) => { + if (!map) { + return; + } if (setValue === true || setValue === false) { // Shortcut to set it in this function, if they passed a boolean locationChecked = !!setValue; } + console.log('Setting chceked to ', setValue); + if (locationChecked) { map.locate({ setView: true, watch: true, enableHighAccuracy: true }); } else { @@ -103,7 +113,7 @@ }); -
+
diff --git a/web-frontend/src/routes/app/+page.svelte b/web-frontend/src/routes/app/+page.svelte index a1bd1d7..80d2808 100644 --- a/web-frontend/src/routes/app/+page.svelte +++ b/web-frontend/src/routes/app/+page.svelte @@ -156,6 +156,12 @@ outputValue = `${e}`; } }; + + let mapIsVisible = false; + + $: { + mapIsVisible = initSuccess && tabInfo.selected == 0; + }

App

@@ -193,6 +199,4 @@ Could not start core module {/await} - - - +