Skip to content

[ANDROID] OnPointAnnotationClickListener doesn't listen to taps when used with TapInteraction with stopPropagation #1009

@sDobrzanski

Description

@sDobrzanski

On Android platform, OnPointAnnotationClickListener doesn't listen to taps when map uses TapInteraction with PointAnnotationManager ID and stopPropagation set to true. On iOS it works fine.

    _pointAnnotationManager =
        await _mapboxMap?.annotations.createPointAnnotationManager();
    _pointAnnotationManager?.addOnPointAnnotationClickListener(
        AnnotationPointClickListener((annotation) async {
    //NOTHING HAPPENS HERE
    print(annotation.id)
    ...
     
      final tapInteraction = TapInteraction(
      FeaturesetDescriptor(layerId: _pointAnnotationManager?.id),
        (feature, context) {},
        stopPropagation: true,
      );
      _mapboxMap?.addInteraction(
         tapInteraction,
         interactionID: 'tap_interaction',
      );



   class AnnotationPointClickListener extends OnPointAnnotationClickListener {
      AnnotationPointClickListener(this.onClicked);
    
      final Function(PointAnnotation annotation) onClicked;
    
      @override
      void onPointAnnotationClick(PointAnnotation annotation) {
        onClicked(annotation);
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions