Last active
August 11, 2020 21:31
-
-
Save didiraja/cbf8de2c9e871e62d1f22d10cacf29dd to your computer and use it in GitHub Desktop.
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
`navigator.geolocation` é a classe | |
`navigator.geolocation.getCurrentPosition()` é a API que vc quer | |
`navigator.geolocation.getCurrentPosition(function(response) { return console.log(response) })` é pra pegar a resposta | |
a resposta: | |
```json | |
coords: { | |
latitude: -22.848907399999998, | |
longitude: -43.3197986, | |
altitude: null, | |
accuracy: 27637, | |
altitudeAccuracy: null | |
}, | |
timestamp: 1597181042262 | |
``` | |
`navigator.geolocation.getCurrentPosition((response) => console.log(response))` encurtado |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment