mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

`onPolygonAnnotationClick` is triggered 6 times on iOS

Open Daeon97 opened this issue 1 year ago • 2 comments

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

Daeon97 avatar Aug 08 '24 10:08 Daeon97

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 avatar Aug 08 '24 11:08 maios

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

maios avatar Aug 21 '24 11:08 maios