Last active
September 25, 2023 13:52
-
-
Save mcgill-a/db12926331f47f3a8672a996b9067a12 to your computer and use it in GitHub Desktop.
A minimal frontend snippet for using GPS data in Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/capacitor-community/background-geolocation | |
this.BackgroundGeolocation.addWatcher( | |
{ | |
requestPermissions: true, | |
stale: false, | |
distanceFilter: 10 | |
}, | |
(current, error) => { | |
if (!current || error) return; | |
const { latitude, longitude, time } = current; | |
console.log(latitude, longitude, time); | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment