Add mouseWheelZoomDelta option to MapOptions

This commit is contained in:
Éric Lemoine
2012-09-27 15:16:14 +02:00
parent dd425ff922
commit d2f9ebae41
4 changed files with 64 additions and 8 deletions

View File

@@ -64,6 +64,7 @@ ol.DEFAULT_RENDERER_HINTS = [
* layers: (ol.Collection|undefined),
* maxResolution: (number|undefined),
* mouseWheelZoom: (boolean|undefined),
* mouseWheelZoomDelta: (number|undefined),
* numZoomLevels: (number|undefined),
* projection: (ol.Projection|string|undefined),
* renderer: (ol.RendererHint|undefined),
@@ -241,7 +242,10 @@ ol.MapOptions.createInteractions_ = function(mapOptionsLiteral) {
var mouseWheelZoom = goog.isDef(mapOptionsLiteral.mouseWheelZoom) ?
mapOptionsLiteral.mouseWheelZoom : true;
if (mouseWheelZoom) {
interactions.push(new ol.interaction.MouseWheelZoom());
var mouseWheelZoomDelta =
goog.isDef(mapOptionsLiteral.mouseWheelZoomDelta) ?
mapOptionsLiteral.mouseWheelZoomDelta : 1;
interactions.push(new ol.interaction.MouseWheelZoom(mouseWheelZoomDelta));
}
var shiftDragZoom = goog.isDef(mapOptionsLiteral.shiftDragZoom) ?