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

Tap delegate id

Open JenishKananiLime opened this issue 3 years ago • 3 comments

New Feature

func annotationManager(_ manager: AnnotationManager, didDetectTappedAnnotations annotations: [Annotation]) {

can we add a param to this a id. Since multiple views can overlap each other and we have multiple managers we only want to consume the first touch event so if we can pass a id for this any random uuid it can be used to avoid other events.

<- Description of the feature being requested and any outcomes desired, an example use case, and any suggestions for solution ->

Why

<- 1-2 sentence description of why you're requesting this feature. What problem does it solve? Why is it valuable? -> For example we have polygon and on top of that polygon we have point annotation. When I tap on point annotation I get calls for point annotation and polygon sub sequentially so if we had id for tap event we can ignore the call to this if tap already consumed.

Looking at the Mapbox code it iterates through for loop of managers and each for loop invokes func annotationManager(_ manager: AnnotationManager, didDetectTappedAnnotations annotations: [Annotation]) {, it would be really helpful to pass any random uuid when iterating.

JenishKananiLime avatar May 06 '22 17:05 JenishKananiLime

@JenishKananiLime thank you for reaching out. The team is evaluating the best way to address tap gestures when multiple annotation managers are involved. In the meantime, you can use queryRenderedFeatures and add a target-action pair to the existing single tap gesture recognizer.

ZiZasaurus avatar May 09 '22 19:05 ZiZasaurus

@ZiZasaurus are we able to use a forked version of the sdk that I can change to pass point as param for the annotation call back. Reason we need this is since this is being passed as array of annotations we wan't to highlight the closest one to the touch capoint which isn't being provided?

JenishKananiLime avatar May 11 '22 17:05 JenishKananiLime

@JenishKananiLime we're looking into this issue for you, however we do not support forking the repo.

ZiZasaurus avatar May 24 '22 14:05 ZiZasaurus

@JenishKananiLime The issue is resolved in v11.0.0-beta.4, https://github.com/mapbox/mapbox-maps-ios/issues/761#issuecomment-1729209012

persidskiy avatar Sep 21 '23 09:09 persidskiy