MouseWheelZoom interaction animates zoom
This commit is contained in:
@@ -8,6 +8,12 @@ goog.require('ol.View2D');
|
|||||||
goog.require('ol.interaction.Interaction');
|
goog.require('ol.interaction.Interaction');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @define {number} Zoom duration.
|
||||||
|
*/
|
||||||
|
ol.interaction.ZOOM_DURATION = 200;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -43,7 +49,7 @@ ol.interaction.MouseWheelZoom.prototype.handleMapBrowserEvent =
|
|||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
goog.asserts.assert(view instanceof ol.View2D);
|
goog.asserts.assert(view instanceof ol.View2D);
|
||||||
map.requestRenderFrame();
|
map.requestRenderFrame();
|
||||||
view.zoom(map, delta, anchor);
|
view.zoom(map, delta, anchor, ol.interaction.ZOOM_DURATION);
|
||||||
mapBrowserEvent.preventDefault();
|
mapBrowserEvent.preventDefault();
|
||||||
mouseWheelEvent.preventDefault();
|
mouseWheelEvent.preventDefault();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user