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');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.animation');
|
|
||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
goog.require('ol.css');
|
goog.require('ol.css');
|
||||||
goog.require('ol.easing');
|
goog.require('ol.easing');
|
||||||
@@ -131,13 +130,14 @@ ol.control.Rotate.prototype.resetNorth_ = function() {
|
|||||||
if (currentRotation > Math.PI) {
|
if (currentRotation > Math.PI) {
|
||||||
currentRotation -= 2 * Math.PI;
|
currentRotation -= 2 * Math.PI;
|
||||||
}
|
}
|
||||||
map.beforeRender(ol.animation.rotate({
|
view.animate({
|
||||||
rotation: currentRotation,
|
rotation: 0,
|
||||||
duration: this.duration_,
|
duration: this.duration_,
|
||||||
easing: ol.easing.easeOut
|
easing: ol.easing.easeOut
|
||||||
}));
|
});
|
||||||
|
} else {
|
||||||
|
view.setRotation(0);
|
||||||
}
|
}
|
||||||
view.setRotation(0);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user