Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain pitching not updating NavigationControl or firing pitch events #10197

Closed
leigeber opened this issue Dec 13, 2020 · 6 comments · Fixed by #12354
Closed

Terrain pitching not updating NavigationControl or firing pitch events #10197

leigeber opened this issue Dec 13, 2020 · 6 comments · Fixed by #12354
Assignees

Comments

@leigeber
Copy link

The new terrain option is great but if you zoom into the side of a mountain for instance the camera will pitch without updating the pitch control or firing pitch events.

Steps to Trigger Behavior

  1. Create a map
  2. Add a NavigationControl with visualizePitch
  3. Add the raster-dem source and setTerrain
  4. Zoom into a mountain and see the control doesn't update

Link to Demonstration

https://jsfiddle.net/zq3v6h9p/

@mourner
Copy link
Member

mourner commented Dec 14, 2020

Pitch is defined relative to the zero plane, not to the mountain geometry the camera looks at, so I'd say this is working as designed as pitch doesn't change when you zoom in. Would would you need it to be defined by terrain?

@mourner mourner removed the bug 🐞 label Dec 14, 2020
@leigeber
Copy link
Author

Thanks for the reply. Sure, totally understood about defining the plane. But with terrain on as you zoom in close to the ground (anywhere, the mountains were just an example), I'm saying that since the camera seems to change the pitch on its own, which I'm assuming is intentional (not that I like that behavior in our use case), the control in the example as you see no longer aligns with the on-screen pitch anymore. Hope that makes more sense.

@mourner
Copy link
Member

mourner commented Dec 14, 2020

Oh, just noticed the pitch shift on higher zooms — sorry, misunderstood earlier. Let me check back on this — we might have introduced some constraints to pitch when close to the ground, but I can see how this behavior can be confusing.

@leigeber
Copy link
Author

leigeber commented May 5, 2021

Hey @mourner, sorry to bug you but wanted to follow up on this. Any plans to allow disabling the auto-pitch? Pretty major pain point for us. If this is better to route through support let me know. Thanks!

@avpeery avpeery self-assigned this Aug 18, 2021
@erinc35
Copy link

erinc35 commented Jan 7, 2022

@avpeery any update would be appreciated.

@leigeber
Copy link
Author

leigeber commented Sep 1, 2022

MapLibre released their terrain without auto-pitch behavior, which is exactly what we're after. Any update?

https://maplibre.org/maplibre-gl-js-docs/example/3d-terrain/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants