Simply, trying to access navigator.geolocation.getCurrentPosition
in a javascript query does not work. Create a javascript query with a simple construction:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition((position) => { console.log('hello')}, (error) => { console.error(error); });
}
We expect a browser prompt to access the current location. It never appears, instead calling the error function immediately. Running the query errors depending on the browser. Chrome states
Geolocation has been disabled in this document by permissions policy
Firefox states
User denied geolocation prompt
(Which isn't true, the prompt never appears).
However, while in the javascript browser console, calling navigator.geolocation.getCurrentPosition
works fine. The prompt for retool.com to access the current location appears, and the success callback works with the coordinates.