-
Notifications
You must be signed in to change notification settings - Fork 164
Annotation tap and long press events #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
onAnnotationClick: (annotation) => circleAnnotation = annotation, | ||
), | ||
); | ||
circleAnnotationManager?.tapEvents(onTap: (annotation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can now remove the AnnotationClickListener class from this example (and the other examples). It would be good to do this so devs are not confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks really good! A few small edits and then I think it'll be ready to merge 🚀
@@ -1,6 +1,22 @@ | |||
### main | |||
|
|||
* Introduce new experimental properties: `FillLayer.fillConstructBridgeGuardRail`, `FillLayer.fillBridgeGuardRailColor`, `FillLayer.fillTunnelStructureColor`, `CircleLayer.circleElevationReference`. | |||
* Introduce `tapEvents` and `longPressEvents` API to the Annotation Managers to handle tap and long press event callbacks for annotations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we mention the deprecation here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
What does this pull request do?
This PR adds
tapEvents
andlongPressEvents
to Annotations API, allowing users to provide a callback to be invoked and an annotation is tapped or long pressed.Both API will return a Cancelable token, which can be used to stop listening to interaction events.
With
tapEvents
, we are now aligning with platform implementation that use IME underlying, instead of using old API in iOS and observe interaction events via delegation, and since the tap interaction is now not propagated to the annotation below the topmost one, you will get exactly one callback when you tap on overlapping annotations as described in #791What is the motivation and context behind this change?
Pull request checklist:
PRs must be submitted under the terms of our Contributor License Agreement CLA.