Is using GPS in Anvil possible?

I stumbled on this code snippet on Stack Overflow, which made me wonder if that library is available to Anvil? If not, is there another way to get my gps location inside an Anvil app?

import android
droid = android.Android()
loc = droid.readLocation()
lattitude = loc.result['network']['latitude']
longitude = loc.result['network']['longitude']
print(lattitude, longitude )

I saw this thread, but it looks like I’d have to download another app to use it :
https://anvil.works/forum/t/gps-tracking-and-google-maps/857/2?u=david.wylie

Here’s an example, using the Web Location API - complete with a Custom Component:

2 Likes

My forum searching skills are appalling. I even read that post a while back.

Thanks, @meredydd.

(worse than that - I commented on it! I’m 107 you know …)

1 Like