Merge pull request #10748 from mike-000/patch-8

Fix "Cannot read property 'anchor' of undefined" in ol/View
This commit is contained in:
Tim Schaub
2020-02-29 07:18:03 -07:00
committed by GitHub
+9 -4
View File
@@ -609,10 +609,15 @@ class View extends BaseObject {
if (series[0].callback) { if (series[0].callback) {
animationCallback(series[0].callback, false); animationCallback(series[0].callback, false);
} }
anchor = anchor || if (!anchor) {
series.filter(function(animation) { for (let j = 0, jj = series.length; j < jj; ++j) {
return !animation.complete; const animation = series[j];
})[0].anchor; if (!animation.complete) {
anchor = animation.anchor;
break;
}
}
}
} }
this.animations_.length = 0; this.animations_.length = 0;
this.cancelAnchor_ = anchor; this.cancelAnchor_ = anchor;