maplibre-gl-js
maplibre-gl-js copied to clipboard
transformCameraUpdate leads to unexpected camera jumps when targetting terrain
maplibre-gl-js version: 4.3.2
browser: Firefox 126, Chrome 125
Steps to Trigger Behavior
- Use the 3D-terrain example
- Add a transformCameraUpdate function in the options that returns the input or an empty object.
- Drag pan the map a little bit (inertia must be triggered). After end of drag, the jump happens.
- After the jump, it works fine until the terrain is targetted again with the camera.
Link to Demonstration
https://jsbin.com/pobidixeqa/1/edit?html,output
Expected Behavior
The empty ((tr)=>({}) or identity (tr)=>tr transformCameraUpdate option should never have an effect on the camera movement.
Actual Behavior
The camera jumps to a different location when drag panning with triggered inertia and terrain targeted.
Terrain movement changes the zoom at the end, I guess the fact that there is a trasform being kept and then applied at the end collides with how terrain works. Feel free to dig into it.
Fix available in #4299.