Skip to content

Instantly share code, notes, and snippets.

@shyamsalimkumar
Created July 13, 2013 16:13
Show Gist options
  • Save shyamsalimkumar/5991198 to your computer and use it in GitHub Desktop.
Save shyamsalimkumar/5991198 to your computer and use it in GitHub Desktop.
Geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var lat = position.coords.latitude,
lon = position.coords.longitude;
console.log('Geolocation - Latitude: '+ lat +', Longitude: '+ lon);
});
}
else {
console.log('Geolocation is not supported for this Browser/OS version yet.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment