Created
December 2, 2014 01:12
-
-
Save devdays/c180abffa61d6d262590 to your computer and use it in GitHub Desktop.
Geolocation watchPosition
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
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