Update gps wrkero
This commit is contained in:
parent
8b38abcd9e
commit
cf982fccec
2 changed files with 11 additions and 2 deletions
|
@ -1,9 +1,13 @@
|
|||
let latitude;
|
||||
let longitude;
|
||||
|
||||
const watchID = navigator.geolocation.watchPosition((position) => {
|
||||
console.log(position.coords.latitude, position.coords.longitude);
|
||||
latitude = position.coords.latitude;
|
||||
longitude = position.coords.longitude;
|
||||
});
|
||||
|
||||
onmessage = () => {
|
||||
console.log("Props");
|
||||
console.log({latitude, longitude});
|
||||
};
|
||||
|
||||
export { };
|
|
@ -13,6 +13,11 @@
|
|||
}
|
||||
const SyncWorker = await import('$lib/gps.worker.ts');
|
||||
syncWorker = new SyncWorker.default();
|
||||
syncWorker.postMessage([]);
|
||||
syncWorker.onmessage = (data) => {
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
onMount(loadWorker);
|
||||
|
|
Loading…
Reference in a new issue