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

Add "pitch" and "rotation" values to be available to expressions similar to how "zoom" is available. #6759

Closed
mkv123 opened this issue May 30, 2018 · 3 comments

Comments

@mkv123
Copy link

mkv123 commented May 30, 2018

Motivation

Currently there is no way to change the styling depending on what the pitch is. For example if the pitch is close to zero, we would like to hide the 3D effects or replace them with 2D effects.

Additionally, using the pitch and rotation values would likely allow to workaround #3993

Design

Add the expressions:

  • ["pitch"]
  • ["bearing"]
@wangxiaoyu
Copy link

Pitch is a global parameter so you can create two separate layers sharing a data source, one for 2D and one for 3D and then setup different styles. Then you can toggle visibility between 2D and 3D layer in 'pitchend' event.

It would be hard to try to use a single layer to represent two perspectives. It is not just different syntax for fill or extrusion styles but different approaches to handle events like hovering and highlighting.

@markusand
Copy link

markusand commented Apr 30, 2021

Adding a ['pitch'] and ['bearing'] accessor would have multiple applications, specially in animations. The most straightforward I can think about now is to use it in an interpolate exporession for the exaggerationattribute in 3D terrain, so the extrusion can be animated out while the pitch is increasing and viceversa.

@SnailBones
Copy link
Contributor

SnailBones commented Oct 20, 2021

['pitch'] has been added in #10795.

Since this issue seems focused on that and doesn't mention any example use cases for ['bearing'], I'm going ahead and closing it.

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

No branches or pull requests

5 participants