Last active
October 23, 2020 14:53
-
-
Save rslahmed/5a4c6e5e6fd27dd5cb4c7989b9052d88 to your computer and use it in GitHub Desktop.
Get location with geolocation
This file contains hidden or 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
//get latitude and longitude | |
if (navigator.geolocation){ | |
navigator.geolocation.getCurrentPosition(function(position) { | |
console.log(position.coords.latitude, position.coords.longitude) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment