Skip to content

Commit

Permalink
fixed(display): Pointerevents at intermediate zoom levels now activat…
Browse files Browse the repository at this point in the history
…e accurately when used alongside StyleZoomRanges/StyleValueFunctions.

Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Jan 8, 2024
1 parent 37800be commit ded5ccc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/display/src/displays/styleTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ded5ccc

Please sign in to comment.