Move zoom from View2D to Interaction
This commit is contained in:
@@ -7,7 +7,6 @@ goog.require('goog.events.MouseWheelEvent');
|
||||
goog.require('goog.events.MouseWheelHandler.EventType');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
|
||||
|
||||
@@ -108,11 +107,10 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
|
||||
var delta = goog.math.clamp(this.delta_, -maxDelta, maxDelta);
|
||||
|
||||
// FIXME works for View2D only
|
||||
var view = map.getView();
|
||||
goog.asserts.assertInstanceof(view, ol.View2D);
|
||||
var view = map.getView().getView2D();
|
||||
|
||||
map.requestRenderFrame();
|
||||
view.zoomByDelta(map, -delta, this.lastAnchor_,
|
||||
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,
|
||||
ol.interaction.MOUSEWHEELZOOM_ANIMATION_DURATION);
|
||||
|
||||
this.delta_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user