Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puck pulsingEnabled option prevents any MapIdleEventData, and onMapIdleListener never called #604

Closed
tiyberius opened this issue Jul 1, 2024 · 1 comment

Comments

@tiyberius
Copy link

I've noticed a bug when setting pulsingEnabled: true when updating the location settings and trying to use the onMapIdleListener. Enabling the puck and the pulsingEnabled: true option prevents the function registered to onMapIdleListener from ever being called. Disabling pulsingEnabled: true seems to allow onMapIdleListener to be called once again.

Steps to reproduce:

  1. Clone the Mapbox Maps Flutter Example app (https://github.com/mapbox/mapbox-maps-flutter/tree/main/example)
  2. In full_map.dart, change these lines to
    _onMapCreated(MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.style; mapboxMap.location.updateSettings(LocationComponentSettings( enabled: true, pulsingEnabled: true, )); }
  3. This will cause (at least in my case) a continuous flow of the following events to be fired and printed to the console:
...
flutter: RenderFrameStartedEventData: timestamp: 1719875698054876
flutter: RenderFrameFinishedEventData: time: EventTimeInterval begin: 2024-07-02 11:14:58.054874, end: 2024-07-02 11:14:58.055839
flutter: RenderFrameStartedEventData: timestamp: 1719875698070221
flutter: RenderFrameFinishedEventData: time: EventTimeInterval begin: 2024-07-02 11:14:58.070220, end: 2024-07-02 11:14:58.071073
flutter: RenderFrameStartedEventData: timestamp: 1719875698088363
flutter: RenderFrameFinishedEventData: time: EventTimeInterval begin: 2024-07-02 11:14:58.088361, end: 2024-07-02 11:14:58.089881
flutter: RenderFrameStartedEventData: timestamp: 1719875698104621
flutter: RenderFrameFinishedEventData: time: EventTimeInterval begin: 2024-07-02 11:14:58.104616, end: 2024-07-02 11:14:58.106572
...
  1. I believe this is preventing the onMapIdleListener from ever being called, because the map is never "idle".

Here is my environment:

flutter --version
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (4 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

I confirmed that the same behavior occurs when using mapbox_maps_flutter: ^2.0.0, and running the example app having cloned it from the repository a few days ago (in which case, I believe that means I had the latest version).

If this is a known issue and there is a workaround, please let me know!

Also let me know if you need any more details.

Cheers,

Tobias

@evil159
Copy link
Contributor

evil159 commented Jul 11, 2024

Hi @tiyberius, I think this is expected behavior, after pulsing is enabled the map is actually never at idle as it has to redraw constantly in order to execute pulsing animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants