diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-02-10 14:59:27 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-02-10 14:59:27 +0100 |
commit | 6ad7f3c40055c2aa650d253e1294b686fb2d635d (patch) | |
tree | 612b559e4c601d7382ff2a18208bb2dfba41ba6f | |
parent | 1f7995cddb10130805161711862d8a6d1b4b4ebc (diff) |
Update location every 2 secondsdemo
-rw-r--r-- | app/(tabs)/index.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 734fa5e..f83b6c0 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -467,6 +467,11 @@ export default function HomeScreen() { updateLocation(location.coords, location.coords.speed); }); + setInterval(async () => { + const location = await Location.getCurrentPositionAsync({}); + updateLocation(location.coords, location.coords.speed); + }, 2000); + Location.watchPositionAsync( { accuracy: Location.Accuracy.Balanced, |