From b34826500dde29cc67638627510f0d2a1de76655 Mon Sep 17 00:00:00 2001 From: velsl Date: Mon, 3 Feb 2025 12:10:59 +0100 Subject: [PATCH] resolutions should be inclusive the last value --- src/MVTEncoder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MVTEncoder.ts b/src/MVTEncoder.ts index a28e17a..af73975 100644 --- a/src/MVTEncoder.ts +++ b/src/MVTEncoder.ts @@ -332,7 +332,7 @@ export default class MVTEncoder { snapTileResolution(tileGrid: TileGrid, targetResolution: number): number { const resolutions = tileGrid.getResolutions(); - let resolution = resolutions[resolutions.length - 2]; // the last one is exclusive? + let resolution = resolutions[resolutions.length - 1]; //the last one is inclusive for (let i = resolutions.length - 2; i >= 0; i--) { const r = resolutions[i]; if (r <= targetResolution) {