Ticket #2288 (closed feature: fixed)
PanZoomBar-Control: add possibility to only zoom to fixed scales even though map.fractionalZoom is set to true
| Reported by: | marcjansen | Owned by: | bartvde |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.9 Release |
| Component: | Control.PanZoomBar | Version: | |
| Keywords: | Cc: | ||
| State: | Complete |
Description
When map.fractionalZoom is true, the PanZoomBar-Control allows zooming to arbitrary zoomlevels. This might or might not be the desired behaviour.
Imagine that map.fractionalZoom is only set to true, so that the application can programmatically zoom to any scale (e.g. when zooming to the bounds of a set of features).
It would be great to have an attribute forceFixedZoomLevel of the panzoombar, that can control the described behavior. If forceFixedZoomLevel = true, only defined zoomlevels are allowed and the map.fractionalZoom is overridden. If it is false (that would be a reasonable default) the control behaves just as expected: only map.fractionalZoom controls the next zoomlevel.
Appended is a patch against rev 9698, that provides the described functionality. See the included example that shows the use of the attribute.
Maybe the map.fractionalZoom property should be divided into two properties (e.g. fractionalZoomControl and fractionalZoomInternal?) to be able to control this better.

