Reset hint first and notify of change when cancelling animations

This commit is contained in:
Tim Schaub
2016-11-11 06:27:44 -07:00
parent 64057d7e6b
commit 7f01de9261
2 changed files with 96 additions and 1 deletions
+2 -1
View File
@@ -272,6 +272,7 @@ ol.View.prototype.getAnimating = function() {
* Cancel any ongoing animations.
*/
ol.View.prototype.cancelAnimations = function() {
this.setHint(ol.View.Hint.ANIMATING, -this.getHints()[ol.View.Hint.ANIMATING]);
for (var i = 0, ii = this.animations_.length; i < ii; ++i) {
var series = this.animations_[i];
if (series[0].callback) {
@@ -279,7 +280,7 @@ ol.View.prototype.cancelAnimations = function() {
}
}
this.animations_.length = 0;
this.setHint(ol.View.Hint.ANIMATING, -this.getHints()[ol.View.Hint.ANIMATING]);
this.changed(); // notify that the hint changed
};
/**