Skip to content
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

fix(gestures): double tap zoom events, fling events #1815

Merged

Conversation

josxha
Copy link
Contributor

@josxha josxha commented Feb 1, 2024

Issue

(4) Double tap zoom no longer emits correct event.

PR Master
!pr master

(3) One bug with fling event end/finished event not being emmitted (when fling is cancelled with tap (as shown in video), or when finished naturally)

2024-01-22.20-47-41.mp4

Information

  • Fixed the emitted map events for doubleTapZoomIn and the fling animation of the drag gesture.
  • I added callbacks for when an animation has ended or has been cancelled. It turned out that they are not used but having some callbacks for both events could make sense for the future. @JaffaKetchup you can decide if we keep or remove them.

@josxha josxha self-assigned this Feb 1, 2024
@josxha josxha changed the title fix(gestures): double tap zoom in events fix(gestures): double tap zoom events, fling events Feb 1, 2024
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, will test as part of main PR. Code LGTM. Thanks!

Comment on lines +427 to +428
AnimationEndedCallback? onAnimatedEnded,
AnimationCancelledCallback? onAnimationCancelled,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could there be any use in having these callbacks exposed through MapOptions? Again, need to consider if we're adding too many callbacks and whether there's a better way to do it (eg. more event types, remove callbacks except onMapEvent) - but that's a discussion for another time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alowing the user to listen for it makes indeed sense but isn't this already possible with the event system?
Side note: these callbacks are not persistent, they are only for one animation and get cleared afterwards.

@JaffaKetchup JaffaKetchup merged commit 72fa64e into fleaflet:gesture-handling Feb 3, 2024
7 checks passed
@josxha josxha deleted the fix-double-tap-zoom-event branch February 3, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants