Use view.animation() when rotating
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user