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

Workaround for flyTo bug #4376

Merged
merged 3 commits into from
Apr 2, 2016
Merged

Workaround for flyTo bug #4376

merged 3 commits into from
Apr 2, 2016

Conversation

hyperknot
Copy link
Collaborator

  1. Made a test for checking the flyTo bug
  2. Changed the old flyTo test to use a visible div, as it is required for flyTo animation.
  3. Split the long line of r() inside flyTo to multiple lines.
  4. Added workaround for floating point precision error in flyTo.
  5. Changed the zoompan example to trigger this bug when clicking on DC.

This workaround now effectively limits the animation of flyTo to maximum 9 zoom levels, after that it jumps at the end. Still this is much better then making the browser go into an infinite loop.

Proper fix would be to change the r() function not to use a tiny number and then take it's logarithm.
cc: @mourner

@hyperknot
Copy link
Collaborator Author

#4226

@IvanSanchez IvanSanchez added this to the 1.0-rc1 milestone Apr 2, 2016
@perliedman perliedman merged commit 928100f into master Apr 2, 2016
@hyperknot hyperknot deleted the flyTo-bug branch April 2, 2016 19:18
@mourner
Copy link
Member

mourner commented Apr 3, 2016

I think there is a better workaround for this — we addressed this in GL JS some time ago. See this code https://github.com/mapbox/mapbox-gl-js/blob/master/js/ui/camera.js#L636-L645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants