diff --git a/package-lock.json b/package-lock.json index 7ddf901..b9244ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "appwrite-svelte-rocket-start", "version": "0.0.0", "dependencies": { - "@beyonk/svelte-mapbox": "^8.1.4", + "@beyonk/svelte-mapbox": "^8.2.0", "@bytemd/plugin-gfm": "^1.17.4", "@lottiefiles/svelte-lottie-player": "^0.3.0", "@popperjs/core": "^2.11.6", diff --git a/package.json b/package.json index 6a2cb96..ab3d7f9 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "vite": "^3.2.3" }, "dependencies": { - "@beyonk/svelte-mapbox": "^8.1.4", + "@beyonk/svelte-mapbox": "^8.2.0", "@bytemd/plugin-gfm": "^1.17.4", "@lottiefiles/svelte-lottie-player": "^0.3.0", "@popperjs/core": "^2.11.6", diff --git a/src/lib/components/Map/LocationRequest.svelte b/src/lib/components/Map/LocationRequest.svelte index f2a9158..ff3e427 100644 --- a/src/lib/components/Map/LocationRequest.svelte +++ b/src/lib/components/Map/LocationRequest.svelte @@ -1,27 +1,57 @@ -{#if state === 'not-granded'} - - This is a info alert -
-
Please provide Erant your location
-
- -
-
-
+{#if state === 'not-granted'} + + This is an info alert +
+
Please provide Erant your location
+
+ +
+
+
{/if} + +{#if state === 'granted'} + +{/if} \ No newline at end of file diff --git a/src/routes/game/game.svelte b/src/routes/game/game.svelte index b4143ed..8da2d0b 100644 --- a/src/routes/game/game.svelte +++ b/src/routes/game/game.svelte @@ -49,7 +49,7 @@ {#if view === 'game-loading'}

- Hra se načítá... + Experience is loading...

{:else if view === 'game-preview'} diff --git a/src/routes/map.svelte b/src/routes/map.svelte index 7ab2792..c801730 100644 --- a/src/routes/map.svelte +++ b/src/routes/map.svelte @@ -1,16 +1,32 @@ - - - (locationGranded = false)} class="w-full h-full" center={{ lng: user.lng, lat: user.lat }} bind:user /> - + let granted = false + + onMount(() => { + navigator.permissions.query({ name: 'geolocation' }) + .then(permissionStatus => { + if (permissionStatus.state === 'granted') { + granted = true + } else { + granted = false + } + }) + .catch(error => { + console.error(error) + granted = false + }) + }) + + + + {#if granted} + + {:else} + (granted = true)} /> + {/if} +