Trouble creating multiple custom map points from Firestore collection

Actions & Logic

I'm trying to use the Google Maps widget to show multiple map points based on coordinates in a Firestore collection. I have fields in each document for latitude, longitude, and location (latitude and logitude concatenated). The map widget throws an error saying the datatype must be LatLng but I can't seem to update the data type manually or programatically.

The Firestore collection is populated from a Google Sheet with a custom app script and, using that method, the "location" data comes in as a string. I can change the data type to LatLng from the Firestore settings in Flutterflow but then it throws an error saying String is not a subtype of LatLng.

I'm, admittedly, not a developer but while I can understand what the code is doing most of the time, I am not advanced enough to write the code. I've tried asking ChatGPT to write the code but that ends up throwing all kinds of errors as well (the code in the screenshot for the custom function was generated from the CoPilot). I'd like to stick to the no-code as much a possible but I fully understand that this is not necessarily an out-of-the-box feature so custom code may be required at this point.

What have you tried so far?

I've tried changing the data type to LatLng from the Firestore settings in Flutterflow but then it throws an error saying String is not a subtype of LatLng.

I've tried manually uploading a CSV version of the collection to allow me to change the initial datatype, but it only allows String or UID.

I've creating and invoking a custom function, but I can't seem to figure out how to invoke the function onPageLoad.

Did you check FlutterFlow's Documentation for this topic?
No
1
1 reply