Update gps config
This commit is contained in:
parent
72eb8a370f
commit
8b38abcd9e
2 changed files with 14 additions and 7 deletions
|
@ -1,10 +1,3 @@
|
|||
|
||||
|
||||
if (!("geolocation" in navigator)) {
|
||||
/* geolocation is not available */
|
||||
return;
|
||||
}
|
||||
|
||||
const watchID = navigator.geolocation.watchPosition((position) => {
|
||||
console.log(position.coords.latitude, position.coords.longitude);
|
||||
});
|
||||
|
|
|
@ -2,6 +2,20 @@
|
|||
import Header from '$lib/components/Header.svelte';
|
||||
import Tabs from '$lib/components/Tabs.svelte';
|
||||
import MapTab from '$lib/components/tabs/MapTab.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let syncWorker: Worker | undefined = undefined;
|
||||
|
||||
const loadWorker = async () => {
|
||||
if (!("geolocation" in navigator)) {
|
||||
/* geolocation is not available */
|
||||
return;
|
||||
}
|
||||
const SyncWorker = await import('$lib/gps.worker.ts');
|
||||
syncWorker = new SyncWorker.default();
|
||||
};
|
||||
|
||||
onMount(loadWorker);
|
||||
|
||||
export let data;
|
||||
let divider;
|
||||
|
|
Loading…
Reference in a new issue