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

Issue with Building Animation Downward Transition #13159

Open
Fareed-Murtaza opened this issue Apr 19, 2024 · 0 comments
Open

Issue with Building Animation Downward Transition #13159

Fareed-Murtaza opened this issue Apr 19, 2024 · 0 comments

Comments

@Fareed-Murtaza
Copy link

mapbox-gl-js version:

Question

Hi there,

I'm currently implementing a feature where building animations rise and fall based on the zoom level in MapLibre. I've successfully managed the upward animation from 0 to the maximum height of the buildings. However, I'm encountering an issue with the animation when buildings descend from their maximum height to ground level.

Here's the code snippet I'm using to achieve this:

map.setPaintProperty(
    '3d-buildings',
    'fill-extrusion-height',
    [
        "interpolate",
         ["linear"],
         ["zoom"],
         15.5,
         ["get", "render_height"],
         15,
         0
    ]
);

However, this implementation throws an error:
Error: layers.3d-buildings.paint.fill-extrusion-height[5]: Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.

In my scenario, the building descent animation should commence when the zoom level is below 15.5 and conclude at zoom level 15. How can I achieve this specific use case without encountering the error mentioned above?

Thanks,

Links to related documentation

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

No branches or pull requests

1 participant