mapbox / mapbox/mapbox-maps-flutter
[ANDROID] OnPointAnnotationClickListener doesn't listen to taps when used with TapInteraction with stopPropagation
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Android case using a PointAnnotationManager, TapInteraction, and stopPropagation set to true, then compare it with the iOS behavior. Trace the annotation click and tap interaction handling to determine why the listener is not called; done when the listener fires for Android without breaking the interaction behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100