Created
July 13, 2013 16:13
-
-
Save shyamsalimkumar/5991198 to your computer and use it in GitHub Desktop.
Geolocation
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
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