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