mapbox / mapbox/mapbox-maps-flutter
Only First annotation is being returned from Annotation tap detection
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Dart
- Sterne
- 380
- Forks
- 204
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
@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 ?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem im Issue gezeigten AnnotationController-Delegate annotationManager(_:didDetectTappedAnnotations:) und verfolge, wie das native Tap-Ergebnis Flutter erreicht. Ermittle, ob alle erkannten Annotationen und ihre Reihenfolge zusammen mit der Genauigkeit der Tap-Erkennung offengelegt werden, und ergänze oder aktualisiere anschließend Tests und Dokumentation, sodass das zurückgegebene Verhalten eindeutig ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- dart, flutter
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100