add gps functions
This commit is contained in:
parent
a737a651ec
commit
bfcb29fc9f
2 changed files with 79 additions and 0 deletions
17
frontend/src/routes/zesty/gps/+page.svelte
Normal file
17
frontend/src/routes/zesty/gps/+page.svelte
Normal file
|
@ -0,0 +1,17 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from "svelte"
|
||||
import { get_coords, is_within_range, type Coordinates } from "$lib/gps"
|
||||
|
||||
let lido_schenna_coords: Coordinates = { latitude: 46.6769043, longitude: 11.1851585 }
|
||||
|
||||
onMount(async () => {
|
||||
let { coords, error } = await get_coords()
|
||||
console.log(coords)
|
||||
if (error != null) {
|
||||
return console.log(error)
|
||||
}
|
||||
if (coords == null) return
|
||||
|
||||
console.log(is_within_range(coords, lido_schenna_coords, 103))
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue