maplibre-gl-js icon indicating copy to clipboard operation
maplibre-gl-js copied to clipboard

Jerky Movement of Markers due to Decimal Part Discard in Pixel-based Coordinates Calculation

Open mezw opened this issue 1 year ago • 2 comments

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.

mezw avatar Feb 02 '24 06:02 mezw

The marker.ts class is fairly closed in terms of scope, feel free to open a PR to solve this.

HarelM avatar Feb 02 '24 23:02 HarelM

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.

neodescis avatar Feb 04 '24 16:02 neodescis