There are currently two issues with the zoom level restriction that applies to the map when its base layer is configured with wrapDateLine: true:
This pull request is intended to fix these issues.
For the PanZoomBar, we need a redraw every time the map resizes, to adjust to a changed zoom level restriction. I added a new "updatesize" map event and a getMinZoom method to make this possible. The new event and method are also useful for zoom sliders that are created outside OpenLayers, e.g. the GeoExt ZoomSlider.
To respect the fractionalZoom setting of the map, the adjustZoom method needs to handle two cases - if fractionalZoom is set to true, getZoomForResolution can be used to get the fracitonal zoom level at which the map width matches the world width.
The pull request also adds unit tests. Tests pass in Safari5. Thanks for any review.
Respect zoom level restriction.
Create a new reliable updatesize event.
The resize event is not fired in all browsers. What we actually need is an event that is called every time the updateSize method is called.
Adding a getMinZoom API method.
This can be used by zoom slider controls, e.g. the GeoExt.ZoomSlider. Note that adjustZoom now also respects the map's fractionalZoom setting.
Adding unit tests.
Excellent work @ahocevar, please merge.