Hi. I am using fitBounds() and setMaxBounds() to display a certain area and to limit user's ability to pan or zoom outside of that. For this I am first doing fitBounds(), followed by setMaxBounds(map.getBounds()).
What I have discovered is that in some situations (seemingly dependant on width/height of the map), setMaxBounds will set the minimum zoom one level too high. The consequence is that the user can't zoom out to view the whole area, and the map does not display the whole area at once when the app is started.
I have made two JSFiddles which demonstrates the problem.
This one works fine:
http://jsfiddle.net/4yYWt/7/In this one, the bounds seem to be as they should, but I can't zoom out to view the whole area:
http://jsfiddle.net/4yYWt/8/Is it something I am doing wrong? Or is this a bug in Leaflet?
Thanks for any input.