FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
127 stars 26 forks source link

Google Map Widget Num Markers Single Mode: Map Center Not Updating with GeoPoint Field in Real-Time #3670

Closed gorillakunta closed 2 months ago

gorillakunta commented 2 months ago

Can we access your project?

Current Behavior

The map center remains in its initial position while the marker updates correctly.

Expected Behavior

The map center should follow the marker’s new position when the GeoPoint field in Firestore is updated.

Steps to Reproduce

  1. Add a Google Map widget to a page in FlutterFlow.
  2. Bind the marker and map center to the same GeoPoint field in a Firestore document.
  3. Enable real-time updates for the Firestore document.
  4. Set the Num Markers property to Single.
  5. Run the app on the web.
  6. Update the GeoPoint field in the Firestore document.
  7. Observe that the marker moves to the new position, but the map center does not update.

Reproducible from Blank

Bug Report Code (Required)

IT4slPHl8Y9Im9tJ0ar+bsBB/WYvNnJ5aoIwscpCRQ4bfb7tBIt3Z87QPxBBOde9dEFUPGacp14C+eD0uODlMfQCNQuZc6ph+bt6bwLLVXymWq2TF7uafEdCI5tYCEy5yLSRgxRQIsRsWUZm3GDzAvCtEnPcJZ+yC0Q8Sq/LZO4=

Visual documentation

I’m encountering an issue with the Google Map widget in FlutterFlow. When the GeoPoint field in a Firestore document updates, the marker correctly moves to the new location, but the map center does not update as expected.

Key Details:

Map Property: Num Markers is set to Single. Data Binding: Both the marker and map center are bound to the same GeoPoint field. Real-Time Updates: Real-time updates are enabled for both the marker and map center. Environment: This issue occurs when running the app on the web. Expected Behavior: The map center should automatically move to the new GeoPoint along with the marker. Actual Behavior: The marker moves, but the map center remains static.

Environment

- FlutterFlow version: 
- Platform: Web
- Browser name and version: Chrome
- Operating system and version affected: Windows 10

Additional Information

No response

Alezanello commented 2 months ago

Hello!

Yes, everything you mentioned is actually the expected behavior of the maps. When the map first loads, it centers on the marker because the initial position has been set. However, there isn't an attribute that automatically keeps the map centered on that marker unless the map reloads itself, updating the position based on the new document value.

To achieve continuous tracking of that specific point, you'll need to trigger an "On Data Change" action within the Maps Widget. Additionally, you can rebuild the page using either the appState or pageState rebuilder options.

image.png
gorillakunta commented 2 months ago

Thank you. Your answer was very help. sorry i posted an issue for this,