fnicollet / Leaflet

:leaves: JavaScript library for mobile-friendly interactive maps
http://leafletjs.com
BSD 2-Clause "Simplified" License
48 stars 20 forks source link

Rotated map with maxBounds does funny movement #2

Open fnicollet opened 8 years ago

fnicollet commented 8 years ago

Originally reported by @hyperknot: https://github.com/hyperknot/Leaflet/issues/5

maxBoundsViscosity: 1 + setMaxBounds + setBearing + pan anywhere on low zoom => funny dancing movement

sisou commented 7 years ago

I am currently looking into this, but have a functional question:

Given the maxBounds are outside the current view, should the rotated view always be fully contained within these bounds (except when zooming out past the maxBounds)? Because that would mean that when rotated, the corners of the maxBounds are not viewable. But maybe that's what you get when using maxBounds.

Another way to do it would be to limit the center of the view to be within the maxBounds. That would mean that corners are fully viewable, but half the view area could be outside of the maxBounds.

Or maybe some mix-solution of the two is possible, where the view is generally restricted by the maxBounds, but still somehow allows corners to be viewable...?

Opinions?