Created
May 28, 2021 10:15
-
-
Save ng-the-engineer/1366c34ace482d502a2a07d4bd6d0c6f to your computer and use it in GitHub Desktop.
Code snippet of tutorial: Build a running tracker
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
const startTracking = () => { | |
if(!navigator.geolocation) { | |
logConsole.textContent = 'Geolocation is not supported by your browser'; | |
} else { | |
logConsole.textContent = 'Locating ...'; | |
distanceBox.textContent = '0.000'; | |
return navigator.geolocation.watchPosition(success, error, trackOptions); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment