diff --git a/src/ol/control/rotate.js b/src/ol/control/rotate.js index f083888b16..7f28097aa0 100644 --- a/src/ol/control/rotate.js +++ b/src/ol/control/rotate.js @@ -120,16 +120,8 @@ ol.control.Rotate.prototype.resetNorth_ = function() { // upon it return; } - var currentRotation = view.getRotation(); - if (currentRotation !== undefined) { + if (view.getRotation() !== undefined) { if (this.duration_ > 0) { - currentRotation = currentRotation % (2 * Math.PI); - if (currentRotation < -Math.PI) { - currentRotation += 2 * Math.PI; - } - if (currentRotation > Math.PI) { - currentRotation -= 2 * Math.PI; - } view.animate({ rotation: 0, duration: this.duration_,