mapbox / mapbox/mapbox-maps-flutter
Only First annotation is being returned from Annotation tap detection
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
@evil159
```
extension AnnotationController: AnnotationInteractionDelegate {
func annotationManager(_ manager: AnnotationManager, didDetectTappedAnnotations annotations: [Annotation]) {
let annotation = annotations.first
switch annotation {
case let annotation as PointAnnotation:
self.onPointAnnotationClickListener?.onPointAnnotationClick(annotation.toFLTPointAnnotation(), completion: {_ in })
case let annotation as CircleAnnotation:
self.onCircleAnnotationClickListener?.onCircleAnnotationClick(annotation.toFLTCircleAnnotation(), completion: {_ in })
case let annotation as PolygonAnnotation:
self.onPolygonAnnotationClickListener?.onPolygonAnnotationClick(annotation.toFLTPolygonAnnotation(), completion: {_ in })
case let annotation as PolylineAnnotation:
self.onPolylineAnnotationClickListener?.onPolylineAnnotationClick(annotation.toFLTPolylineAnnotation(), completion: {_ in })
default:
print("Can't detemine the type of annotation: \(annotation)")
}
}
}
```
On native side the code is returning only first annotation from list of annotations which were detected on Tap `didDetectTappedAnnotations`
Few clarifications and concerns:
1- Why not return all annotations ?
2- What is tap detect accuracy ? is based on point on Screen Box ?
3- when returning the first annotation from list of annotations, is the list already sorted by annotation sort key ? If Yes, is it ASC or DESC ?
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
Start with the AnnotationController annotationManager(_:didDetectTappedAnnotations:) delegate shown in the issue and trace how the native tap result reaches Flutter. Determine whether all detected annotations and their ordering are exposed, along with the tap-detection accuracy, then add or update coverage and documentation so the returned behavior is explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100