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

fill-opacity not interpolated correctly outside of a tile's zoom range #8817

Closed
ansis opened this issue Sep 27, 2019 · 0 comments · Fixed by #8818
Closed

fill-opacity not interpolated correctly outside of a tile's zoom range #8817

ansis opened this issue Sep 27, 2019 · 0 comments · Fixed by #8818
Assignees
Labels

Comments

@ansis
Copy link
Contributor

ansis commented Sep 27, 2019

mapbox-gl-js version: 1.4.0

browser: all

Steps to Trigger Behavior

  1. Create a style with an opacity expression that uses linear interpolation with both zoom and a data property:
"fill-opacity": [
            "interpolate",
            ["linear"],
            ["zoom"],
            0.5,
            0,
            1,
            ["match", ["get", "fakeprop"], "nope", 1, 1]
        ]

  1. start at zoom 0
  2. zoom to zoom 2

Link to Demonstration

I'm opening a PR with a patch and regression test soon. This issue is just to document the problem.

Expected Behavior

Opacity is applied as intended.

Actual Behavior

Opacity is interpolated to a value greater than 1 resulting in the incorrect color for the split second before new tiles are loaded.

@ansis ansis added the bug 🐞 label Sep 27, 2019
@ansis ansis self-assigned this Sep 27, 2019
ansis added a commit that referenced this issue Sep 27, 2019
fix #8817

The interpolation factor could be outside of the range 0..1 which
could result in rendering errors.
ansis added a commit that referenced this issue Oct 1, 2019
fix #8817

The interpolation factor could be outside of the range 0..1 which could result in rendering errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant