mapbox / mapbox-maps-flutter

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

`onPolygonAnnotationClick` is triggered 6 times on iOS #646

Open Daeon97 opened 1 month ago

Daeon97 commented 1 month ago

I have several polygons on my map with each polygon having its own click listener using my defined _AnnotationClickListener

import 'package:dartz/dartz.dart' show Function1;

final class _AnnotationClickListener extends OnPolygonAnnotationClickListener {
  _AnnotationClickListener(
    Function1<PolygonAnnotation, void> onAnnotationClick,
  ) : _onAnnotationClick = onAnnotationClick;

  final Function1<PolygonAnnotation, void> _onAnnotationClick;

  @override
  void onPolygonAnnotationClick(PolygonAnnotation annotation) =>
      _onAnnotationClick(
        annotation,
      );
}

However on iOS onPolygonAnnotationClick is triggered 6 times which in actuality I only clicked the Polygon once.

This problem does not happen on Android

maios commented 1 month ago

Hi @Daeon97, can you provide which SDK version you are using? It looks like that in iOS if you have overlapping polygons, tapping the overlapping area will result in multiple triggers, can you also provide a sample code where you setup the polygon annotations?

maios commented 1 month ago

Hi @Daeon97, do you have any other updates for this? If not, we will close this issue soon.