mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
245 stars 93 forks source link

PointAnnotation ID cannot be set #497

Open noforeignland opened 1 month ago

noforeignland commented 1 month ago

Problem:

The ID that gets retreived from the feature that's tapped is an internally generated GUID and offers no clue to the listener about which point was selected by the user.

From the demo app:

class AnnotationClickListener extends OnPointAnnotationClickListener {
  @override
  void onPointAnnotationClick(PointAnnotation annotation) {
    print("onAnnotationClick, id: $**{annotation.id}"**);
  }
}

Expected behaviour There should be a way to set the ID when adding points to the annotation manager.

Nortontium commented 1 month ago

Duplicate of #445

maios commented 1 week ago

Hi @noforeignland, thank you for raising this. We currently don't allow setting custom ID for annotations due to our MapboxMaps Android SDK does not support this, however, after some internal discussion, we have decided to enable this in Android and therefore we can also enable this in MapboxMaps Flutter plugin. I will keep you updated when this feature comes alive.

noforeignland commented 1 week ago

Hi @noforeignland, thank you for raising this. We currently don't allow setting custom ID for annotations due to our MapboxMaps Android SDK does not support this, however, after some internal discussion, we have decided to enable this in Android and therefore we can also enable this in MapboxMaps Flutter plugin. I will keep you updated when this feature comes alive.

Thanks for the update - in the meantime, how can apps detect which marker was tapped on without an id ?