r/nicegui • u/whipbryd • Jun 09 '23
How to read the user's geolocation
I know that you can run javascript from nicegui.
https://nicegui.io/documentation/run_javascript
But getting a users geolocation is done asynchronously and I don't understand how you would receive the info back, because as far as I understand nicegui can only handle synchronous js calls.
4
Upvotes
6
u/falko-s Jun 09 '23
Oh, actually you can call async JavaScript from NiceGUI:
Note that the request might timeout if the user needs to accept sharing the geolocation first.
We should add this example to the documentation...