From ded5cccee03abbdfc46b5ca0b367f07178d0e447 Mon Sep 17 00:00:00 2001 From: Tim Deubler Date: Mon, 8 Jan 2024 15:55:17 +0100 Subject: [PATCH] fixed(display): Pointerevents at intermediate zoom levels now activate accurately when used alongside StyleZoomRanges/StyleValueFunctions. Signed-off-by: Tim Deubler --- packages/display/src/displays/styleTools.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/display/src/displays/styleTools.ts b/packages/display/src/displays/styleTools.ts index 4da3370e9..b0bdfdd80 100644 --- a/packages/display/src/displays/styleTools.ts +++ b/packages/display/src/displays/styleTools.ts @@ -135,11 +135,11 @@ const parseSizeValue = (size: string | number, float: boolean = false): [number, }; const getSizeInPixel = (property: string, style: Style, feature: Feature, zoom: number, float?: boolean) => { - const rawValue = getValue(property, style, feature, zoom); + const tileGridZoom = getTileGridZoom(zoom); + const rawValue = getValue(property, style, feature, tileGridZoom); let [value, unit] = parseSizeValue(rawValue, float); if (unit == 'm') { - const tileGridZoom = getTileGridZoom(zoom); const dZoomScale = Math.pow(2, zoom % tileGridZoom); value = dZoomScale * meterToPixel(value, tileGridZoom); }