diff --git a/src/ol/control/rotate.js b/src/ol/control/rotate.js index 54d5f420c9..bc6cede392 100644 --- a/src/ol/control/rotate.js +++ b/src/ol/control/rotate.js @@ -3,7 +3,6 @@ goog.provide('ol.control.Rotate'); goog.require('ol.events'); goog.require('ol.events.EventType'); goog.require('ol'); -goog.require('ol.animation'); goog.require('ol.control.Control'); goog.require('ol.css'); goog.require('ol.easing'); @@ -131,13 +130,14 @@ ol.control.Rotate.prototype.resetNorth_ = function() { if (currentRotation > Math.PI) { currentRotation -= 2 * Math.PI; } - map.beforeRender(ol.animation.rotate({ - rotation: currentRotation, + view.animate({ + rotation: 0, duration: this.duration_, easing: ol.easing.easeOut - })); + }); + } else { + view.setRotation(0); } - view.setRotation(0); } };