Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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