Reuse containers for tile, vector and vector tile layers

This commit is contained in:
ahocevar
2019-05-17 22:25:13 +02:00
parent 930318ab7a
commit a55505b36a
5 changed files with 125 additions and 108 deletions
+3 -1
View File
@@ -101,13 +101,15 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
);
makeInverse(this.inversePixelTransform_, this.pixelTransform_);
this.useContainer(target, this.pixelTransform_);
const context = this.context;
const canvas = context.canvas;
if (canvas.width != width || canvas.height != height) {
canvas.width = width;
canvas.height = height;
} else {
} else if (!this.containerReused) {
context.clearRect(0, 0, width, height);
}