diff --git a/src/ol/view.js b/src/ol/view.js index a491962eef..2cd8b2deed 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -304,7 +304,7 @@ ol.View.prototype.updateAnimations_ = function() { continue; } var elapsed = now - animation.start; - var fraction = elapsed / animation.duration; + var fraction = animation.duration > 0 ? elapsed / animation.duration : 1; if (fraction >= 1) { animation.complete = true; fraction = 1; diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index 8b1bbfb33e..e0616571a6 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -379,7 +379,6 @@ describe('ol.View', function() { zoom: 4, duration: 0 }); - expect(view.getAnimating()).to.eql(true); setTimeout(function() { expect(view.getCenter()).to.eql([0, 0]);