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

transformCameraUpdate leads to unexpected camera jumps when targetting terrain

Open chrneumann opened this issue 1 year ago • 1 comments

maplibre-gl-js version: 4.3.2

browser: Firefox 126, Chrome 125

Steps to Trigger Behavior

  1. Use the 3D-terrain example
  2. Add a transformCameraUpdate function in the options that returns the input or an empty object.
  3. Drag pan the map a little bit (inertia must be triggered). After end of drag, the jump happens.
  4. 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.

chrneumann avatar Jun 05 '24 13:06 chrneumann

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.

HarelM avatar Jun 05 '24 17:06 HarelM

Fix available in #4299.

chrneumann avatar Jul 10 '24 09:07 chrneumann