Skip to content

Instantly share code, notes, and snippets.

@ng-the-engineer
Created May 28, 2021 10:15
Show Gist options
  • Save ng-the-engineer/1366c34ace482d502a2a07d4bd6d0c6f to your computer and use it in GitHub Desktop.
Save ng-the-engineer/1366c34ace482d502a2a07d4bd6d0c6f to your computer and use it in GitHub Desktop.
Code snippet of tutorial: Build a running tracker
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