Reverse geocoding using lat lng from a collection

Database & APIs

Hey everyone,

I have a page with google maps on my app and I am using it to update user's location based on their pick. There is an icon in the middle of the screen which has on tap action and it updates the location field of the user with "Current GoogleMap Center". This updates the geocode in location field under users collection. Up to here it works fine.

On another page, I want to show the location which the user picked as a text - a city or street name. I have been trying to do reverse geocoding but the problem is I don't know how to call for the latitude and longitude values of the current user's location field. Basically, I don't know what to put in between the red lines below while writing the API URL. When I run this it gives error as invalid request. invalid 'latlng' parameters.

I tested the API by manually entering the lat an lng values and it works.

I have tried to see how the location data looks like by using a text widget on a page and it looks like below. I am using Firebase by the way.

I have asked questions about this to several AI's also it wasn't helpful. Some offered to write custom functions but the code they gave didn't work.

Anyone done something similar?

What have you tried so far?

Tried custom functions but I have no experience in that. Asked the AI chatbot to create to code for me but didn't work also.

Did you check FlutterFlow's Documentation for this topic?
Yes
2
4 replies