Skip to content

Instantly share code, notes, and snippets.

@romuloctba
Created February 17, 2015 06:40
Show Gist options
  • Save romuloctba/8832c5708cdf02023768 to your computer and use it in GitHub Desktop.
Save romuloctba/8832c5708cdf02023768 to your computer and use it in GitHub Desktop.
Geolocation get coords
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
alert("Lat: " + position.coords.latitude + " Long: " + position.coords.longitude);
}, function () {
//handleNoGeolocation(browserSupportFlag);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment