mapbox / mapbox/mapbox-maps-flutter

PointAnnotationManager update/delete silently fails (markers duplicated)

Open
#1,075 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,
I’m running into a persistent issue with the Flutter Mapbox SDK when updating or deleting markers via PointAnnotationManager.

Problem description:
When I call update() or delete() on a PointAnnotationManager to replace an existing marker, the operation very often fails silently.
• No error/exception is thrown to the Flutter layer.
• The SDK internally reports the operation as “successful”.
• But on the UI, the old marker remains and a new marker gets created, causing duplicated markers.

This happens occasionally on older versions, but becomes noticeably more frequent after upgrading to the latest Mapbox Flutter SDK.

What I expect:
Calling update() should update the existing marker, and calling delete() should remove it — with reliable behavior or at least an error callback when it fails.

My questions:
1. Is this a known issue with the latest Flutter SDK version?
2. Is there any recommended workaround (e.g., waiting for certain lifecycle events, batching updates, manually forcing a refresh)?
3. Should I manage annotation IDs manually or recreate the entire AnnotationManager to avoid the issue?

Environment:
• Flutter version: 3.35.6
• mapbox_maps_flutter: 2.11.0
• Platform: both iOS and Android

Thanks in advance! Any insight or recommended fix would be greatly appreciated.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with PointAnnotationManager.update() and delete() on Flutter 3.35.6 with mapbox_maps_flutter 2.11.0 on both iOS and Android. Compare the UI result with the SDK's reported success and investigate annotation ID or lifecycle behavior. Done means updates and deletions reliably affect the existing marker, or failures reach the Flutter layer as errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.