Ticket #2288 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

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.

Attachments

pzb-force-fixed-zoom-level.diff Download (5.5 KB) - added by marcjansen 4 years ago.
control-panzoombar-test-force-fixed-zoomlevel.patch Download (2.0 KB) - added by marcjansen 4 years ago.
4 tests to check if the new attribute work well in conjunction with map.fractionalZoom

Change History

Changed 4 years ago by marcjansen

Changed 4 years ago by marcjansen

4 tests to check if the new attribute work well in conjunction with map.fractionalZoom

Changed 4 years ago by marcjansen

  • state set to Review
  • version 2.8 deleted
  • milestone set to 2.9 Release

Changed 4 years ago by bartvde

  • owner changed from crschmidt to bartvde

Changed 4 years ago by bartvde

  • status changed from new to closed
  • state changed from Review to Complete
  • resolution set to fixed

(In [9751]) give PanZoomBar control an option to force fixed zoomlevels even if the map has fractionalZoom, patch by marcjansen, r=me, (closes #2288)

Note: See TracTickets for help on using tickets.