diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index 74d2cfb622..67647dcb0f 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -4,7 +4,6 @@ goog.provide('ol.interaction.Interaction'); goog.require('ol'); goog.require('ol.Object'); -goog.require('ol.animation'); goog.require('ol.easing'); @@ -139,22 +138,16 @@ ol.interaction.Interaction.rotateWithoutConstraints = function(map, view, rotati if (rotation !== undefined) { var currentRotation = view.getRotation(); var currentCenter = view.getCenter(); - if (currentRotation !== undefined && currentCenter && - opt_duration && opt_duration > 0) { - map.beforeRender(ol.animation.rotate({ - rotation: currentRotation, + if (currentRotation !== undefined && currentCenter && opt_duration > 0) { + view.animate({ + rotation: rotation, + anchor: opt_anchor, duration: opt_duration, easing: ol.easing.easeOut - })); - if (opt_anchor) { - map.beforeRender(ol.animation.pan({ - source: currentCenter, - duration: opt_duration, - easing: ol.easing.easeOut - })); - } + }); + } else { + view.rotate(rotation, opt_anchor); } - view.rotate(rotation, opt_anchor); } };