Skip to content

Instantly share code, notes, and snippets.

@jonathanwork
Last active April 9, 2017 22:10
Show Gist options
  • Save jonathanwork/2e5772e7a3b46a50bf00221899f84501 to your computer and use it in GitHub Desktop.
Save jonathanwork/2e5772e7a3b46a50bf00221899f84501 to your computer and use it in GitHub Desktop.
geolocation in javascript ;)
navigator
.geolocation
.getCurrentPosition(position=> {
var lat = position.coords['latitude'];
var lng = position.coords['longitude'];
console.log(`your current location is ${lat}, ${lng}`);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment