diff --git a/src/ol/control/rotatecontrol.js b/src/ol/control/rotatecontrol.js index 3de372ce91..8b64185d34 100644 --- a/src/ol/control/rotatecontrol.js +++ b/src/ol/control/rotatecontrol.js @@ -5,6 +5,7 @@ goog.require('goog.dom'); goog.require('goog.dom.TagName'); goog.require('goog.events'); goog.require('goog.events.EventType'); +goog.require('goog.math'); goog.require('ol.animation'); goog.require('ol.control.Control'); goog.require('ol.css'); @@ -146,7 +147,7 @@ ol.control.Rotate.prototype.handleMapPostrender = function(mapEvent) { return; } var rotation = frameState.viewState.rotation; - var transform = 'rotate(' + rotation * 360 / (Math.PI * 2) + 'deg)'; + var transform = 'rotate(' + goog.math.toDegrees(rotation) + 'deg)'; if (this.autoHide_) { this.element.style.opacity = (rotation === 0) ? 0 : 1; }