Geolocation Accuracy Issues Using utils.getCurrentPosition() in Retool

I’m trying to achieve high-precision location accuracy in the Retool app. We’ve been experiencing issues with utils.getCurrentPosition(), where the location returned is either inaccurate or significantly off.

We attempted to use the window.navigator geolocation API with enableHighAccuracy set to true, but we consistently receive the following error:

Geolocation has been disabled in this document by permissions policy.

We also tried using preloaded JavaScript, but that did not resolve the issue.

At this point, we’re looking for guidance on how to enable high-accuracy geolocation within Retool or whether there are platform limitations we need to account for.

Retool runs its JavaScript in a sandboxed environment so you won't have access to the parent window's history methods as you've noticed. :confused:

you can though use await utils.getCurrentPosition()

let me know if that works!

1 Like

Hi @NicoleNG72,

Just wanted to echo @DavidD's comment above. Retool executes code in a sandboxed environment so it is limited in accessing the browser and parent window.

Retool uses a third party library for our .getCurrentPosition() method and if the accuracy from that method is not up to your needs then you may need to look for a more bespoke solution for location tracking.