Merge pull request #9704 from ahocevar/vectortile-reuse-issue

Handle container reuse properly when layers are added/removed
This commit is contained in:
Andreas Hocevar
2019-06-22 19:33:59 +02:00
committed by GitHub

View File

@@ -129,12 +129,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
} }
const containerReused = this.containerReused; const containerReused = this.containerReused;
super.useContainer(target, transform, opacity); super.useContainer(target, transform, opacity);
if (containerReused && !this.containerReused && !overlayContext) { if (containerReused) {
this.overlayContext_ = null; this.overlayContext_ = overlayContext || null;
this.overlayContextUid_ = undefined; this.overlayContextUid_ = overlayContext ? getUid(overlayContext) : undefined;
}
if (this.containerReused && overlayContext) {
this.overlayContext_ = overlayContext;
} }
if (!this.overlayContext_) { if (!this.overlayContext_) {
const overlayContext = createCanvasContext2D(); const overlayContext = createCanvasContext2D();