Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 2, 2014 01:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save devdays/c180abffa61d6d262590 to your computer and use it in GitHub Desktop.
Geolocation watchPosition
navigator.geolocation.watchtPosition(function (position) {
var pos = "Latitude: " + position.coords.latitude +
" Longitude: " + position.coords.longitude;
});
function buttonClickHandler() {
// Cancel the updates when the user clicks a button.
navigator.geolocation.clearWatch(watchId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment