add an option to make the pinchZoom constrain zoom levels to integers

Changes the default behavior of ol.interaction.PinchZoom to keep
the fractional zoom level after the gesture.
The old behavior of zooming to the next whole-number level can be
enforced with the new parameter `constrainResolution`.
This commit is contained in:
Axel Utech
2016-12-09 18:02:36 +01:00
parent f795019215
commit 321b1f72ad
2 changed files with 23 additions and 8 deletions

View File

@@ -3104,6 +3104,13 @@ olx.interaction.PinchZoomOptions;
*/
olx.interaction.PinchZoomOptions.prototype.duration;
/**
* Zoom to the closest integer zoom level after the pinch gesture ends. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.PinchZoomOptions.prototype.constrainResolution;
/**
* @typedef {{handleDownEvent: (function(ol.MapBrowserPointerEvent):boolean|undefined),
@@ -7613,7 +7620,7 @@ olx.view.FitOptions.prototype.maxZoom;
/**
* The duration of the animation in milliseconds. By default, there is no
* The duration of the animation in milliseconds. By default, there is no
* animations.
* @type {number|undefined}
* @api