Overscale canvas if sources have non-zero min zoom
This commit is contained in:
@@ -153,9 +153,15 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
let width = Math.round(frameState.size[0] * tilePixelRatio);
|
let width = Math.round(frameState.size[0] * tilePixelRatio);
|
||||||
let height = Math.round(frameState.size[1] * tilePixelRatio);
|
let height = Math.round(frameState.size[1] * tilePixelRatio);
|
||||||
if (tileResolution < viewResolution) {
|
if (tileResolution < viewResolution) {
|
||||||
// scale canvas so it covers the viewport until new tiles come it
|
// scale canvas so it covers the viewport until new tiles come in
|
||||||
width *= 1.5;
|
let scale;
|
||||||
height *= 1.5;
|
if (z <= tileGrid.minZoom) {
|
||||||
|
scale = Math.round(viewResolution / tileResolution);
|
||||||
|
} else {
|
||||||
|
scale = 1.5; // rely on lower z tiles
|
||||||
|
}
|
||||||
|
width *= scale;
|
||||||
|
height *= scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation) {
|
if (rotation) {
|
||||||
|
|||||||
Reference in New Issue
Block a user