diff --git a/src/ol/control/zoom.js b/src/ol/control/zoom.js index 8b61d8c92d..390578d332 100644 --- a/src/ol/control/zoom.js +++ b/src/ol/control/zoom.js @@ -3,7 +3,6 @@ goog.provide('ol.control.Zoom'); goog.require('ol'); goog.require('ol.events'); goog.require('ol.events.EventType'); -goog.require('ol.animation'); goog.require('ol.control.Control'); goog.require('ol.css'); goog.require('ol.easing'); @@ -105,14 +104,15 @@ ol.control.Zoom.prototype.zoomByDelta_ = function(delta) { } var currentResolution = view.getResolution(); if (currentResolution) { + var newResolution = view.constrainResolution(currentResolution, delta); if (this.duration_ > 0) { - map.beforeRender(ol.animation.zoom({ - resolution: currentResolution, + view.animate({ + resolution: newResolution, duration: this.duration_, easing: ol.easing.easeOut - })); + }); + } else { + view.setResolution(newResolution); } - var newResolution = view.constrainResolution(currentResolution, delta); - view.setResolution(newResolution); } };