navigator.geolocation.getCurrentLocation is undefined
See original GitHub issueI have fixed this issue by the following steps,
In GooglePlacesAutocomplete.js file,
importing Geolocation from ‘@react-native-community/geolocation’ at the top,
and
replacing navigator.geolocation.getCurrentPosition
to Geolocation.getCurrentPosition
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:6
Top Results From Across the Web
Current coordinates returns undefined - Stack Overflow
I'm trying to use getLocation function to get the current location coordinates and use those for distance calculation in future. After I run...
Read more >Why does the geolocation API return undefined? - Reddit
The below code returns undefined. Why is that? In my mind the logic would be that the getLocation(), upon a successful retrieval of...
Read more >Geolocation.getCurrentPosition() - Web APIs | MDN
The Geolocation.getCurrentPosition() method is used to get the current position of the device.
Read more >navigator.geolocation.getCurrentLocation is undefined and ...
There's a solution for this. navigator.geolocation = require('@react-native-community/geolocation'); ...
Read more >Navigator geolocation Property - W3Schools
navigator.geolocation.getCurrentPosition(showPosition); } else { document.getElementById("demo").innerHTML = "Geolocation is not supported by this browser.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed it without edit files in node_modules folder.
Refer to @react-native-community/geolocation
@carmelocatalfamo a quick question. Where am I supposed to edit this? Change this navigator config?