mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
10.87k stars 2.19k forks source link

Using transform:scale in css causes mapbox mouse events to be offset #13169

Open xiangyin1987 opened 1 month ago

xiangyin1987 commented 1 month ago

mapbox-gl-js version: ^3.3.0

Question

Snipaste_2024-05-06_17-04-58 Snipaste_2024-05-07_22-22-46

The result returned by the getScaledPoint function does not take into account transform:scale

xiangyin1987 commented 1 month ago

I have temporarily fixed the transform:scale offset problem based on mapbox 3.3.0. Dependency address: https://www.npmjs.com/package/@jkyu/mapbox-gl