Merge pull request #6393 from ahocevar/only-set-center-when-animating

Only stop animation when animating
This commit is contained in:
Andreas Hocevar
2017-01-21 21:05:03 +01:00
committed by GitHub
+3 -1
View File
@@ -133,7 +133,9 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
view.setHint(ol.ViewHint.INTERACTING, 1); view.setHint(ol.ViewHint.INTERACTING, 1);
} }
// stop any current animation // stop any current animation
view.setCenter(mapBrowserEvent.frameState.viewState.center); if (view.getHints()[ol.ViewHint.ANIMATING]) {
view.setCenter(mapBrowserEvent.frameState.viewState.center);
}
if (this.kinetic_) { if (this.kinetic_) {
this.kinetic_.begin(); this.kinetic_.begin();
} }