maplibre-gl-js
maplibre-gl-js copied to clipboard
Jerky Movement of Markers due to Decimal Part Discard in Pixel-based Coordinates Calculation
I am currently facing an issue with dynamically updating the position of a marker in MapLibre GL JS. As I provide new latitude and longitude values for the marker, MapLibre calculates the new pixel-based coordinates for the marker. However, during this calculation, it discards the decimal part, leading to a jerky and unsmooth movement of the marker, which makes it impossible to create a smooth animation. Could you please help me address this issue? Thank you.
The marker.ts class is fairly closed in terms of scope, feel free to open a PR to solve this.
There was a recent discussion about the same behavior in popups, also during animation. I haven't looked into it in great detail, but it might make sense to solve both at the same time, in the same way.