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

Prevent bearing snap ease interfering with new ease #9884

Merged
merged 1 commit into from
Aug 4, 2020

Conversation

andycalder
Copy link
Contributor

@andycalder andycalder commented Jul 21, 2020

This is a fix for #9793

In short, easeTo or flyTo may interrupt handler driven motion when the map's bearing is within the bearingSnap range. This triggers a bearing snap easeTo at the same time as the desired easeTo/flyTo. The camera can't handle both of these and it freezes and errors.

Further explanation of the chain of events that cause this bug is here #9793 (comment)

This PR:

  • Adds a new argument allowEndAnimation to HandlerManager#stop to prevent a bearing snap interfering with a new easeTo or flyTo.
  • Removes unused property _bearingChanged of HandlerManager.

Launch Checklist

  • briefly describe the changes in this PR
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fixed a bug where bearing snap animations interfere with new easeTo and flyTo animations and freeze the map</changelog>

@ryanhamley ryanhamley requested a review from ansis July 21, 2020 15:21
@ryanhamley
Copy link
Contributor

This seems ok to me but the gesture handling code isn't my area of expertise. @ansis can you give this a look to make sure there won't be any side effects to this change?

Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

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

This looks good to me! thanks for your contribution

@ansis ansis added the bug 🐞 label Aug 4, 2020
@ansis ansis merged commit ebb80aa into mapbox:main Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants