Detach label cache on Map#setTarget()

This commit is contained in:
ahocevar
2019-06-03 13:21:28 +02:00
parent 9bedfb7cb0
commit 153e06e4d5

View File

@@ -546,7 +546,6 @@ class PluggableMap extends BaseObject {
cancelAnimationFrame(this.animationDelayKey_);
this.animationDelayKey_ = undefined;
}
this.detachLabelCache();
this.setTarget(null);
super.disposeInternal();
}
@@ -1046,6 +1045,7 @@ class PluggableMap extends BaseObject {
removeEventListener(EventType.RESIZE, this.handleResize_, false);
this.handleResize_ = undefined;
}
this.detachLabelCache();
} else {
targetElement.appendChild(this.viewport_);