How to Display Referenced LatLon Data from a Related Collection on Google Maps?

Database & APIs

Hi everyone,

I’m working on a FlutterFlow app and need some help displaying location data on a Google Map widget. Here’s my setup:

  • I have two Firestore collections: listings and addresses.

  • In the listings collection, each document includes an addressRef field, which is a reference to a document in the addresses collection.

  • The addresses documents contain address details like streetAddress, city, province, and a LatLon field (which stores latitude and longitude).

My goal is to:

  1. Query the listings collection.

  2. For each listing, use the addressRef to access the referenced document in the addresses collection.

  3. Display the LatLon data (latitude and longitude) on a Google Map widget for each listing.

I’ve successfully queried the listings collection, but I’m not sure how to properly reference the LatLon field from the addresses collection in FlutterFlow. Can someone guide me through the best way to query this referenced data and display it on a map?

Also note that I want to add multiple markers, each being pulled form Listing > AddressRef > LatLng

Thanks in advance

What have you tried so far?

I was trying to create a secondary query, but I can't figure out how to do that in the Backend Query

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