Use view.animate() in the rotation control
This commit is contained in:
@@ -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,14 +130,15 @@ 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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user