From dd079e915aaf5ae264171d90f555e8eaf34f626d Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 5 Nov 2016 18:11:04 -0600 Subject: [PATCH] Use view.animate() in the rotation control --- src/ol/control/rotate.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); } };