Skip to content

Workaround for flyTo bug#4376

Merged
perliedman merged 3 commits intomasterfrom
flyTo-bug
Apr 2, 2016
Merged

Workaround for flyTo bug#4376
perliedman merged 3 commits intomasterfrom
flyTo-bug

Conversation

@hyperknot
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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