Created
September 1, 2018 12:49
-
-
Save alizhdanov/35e66aaa1c6c4b274f7bcf4ee1cb0ba3 to your computer and use it in GitHub Desktop.
Simple geolocation API example
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
const success = position => { | |
const { latitude, longitude } = position.coords; | |
console.log(`Your coordinates - ${latitude}lat and ${longitude}lng`); | |
}; | |
const error = err => { | |
console.log(err); | |
}; | |
getCurrentPosition(success, error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment