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

Fix fill-color property-function interpolation of alpha value #2846

Closed
peterqliu opened this issue Jul 8, 2016 · 3 comments · Fixed by #2971
Closed

Fix fill-color property-function interpolation of alpha value #2846

peterqliu opened this issue Jul 8, 2016 · 3 comments · Fixed by #2971

Comments

@peterqliu
Copy link
Contributor

peterqliu commented Jul 8, 2016

mapbox-gl-js version: v0.20.1

Steps to Trigger Behavior

Check out https://jsfiddle.net/p6tjyehh/. DDS fill-color based on the property someNumber.

Expected Behavior

I expect the polygon to be nearly transparent here, since the styling rule is [[0, 'rgba(30,60,90,0)'], [1,'rgba(30,60,90,1)']], and the value I provided is near 0.

Actual Behavior

The polygon is opaque. There's some quirk with the alpha value 1, though; when I change it to 0.99 (making the styling rule [[0, 'rgba(30,60,90,0)'], [1,'rgba(30,60,90,0.99)']], it works properly

@jfirebaugh
Copy link
Contributor

This, #2827 and #2828 are probably all related.

@lucaswoj lucaswoj added this to the Ayacucho milestone Jul 29, 2016
@lucaswoj lucaswoj self-assigned this Jul 29, 2016
@lucaswoj lucaswoj changed the title DDS fill-color does not interpolate alpha value Fix property-function interpolation of alpha value Jul 29, 2016
@mollymerp
Copy link
Contributor

Just tested the example and this is not an issue with circle-color interpolation, so for now it seems isolated to the fill-color property functions

https://jsfiddle.net/LLgL3byL/

@lucaswoj lucaswoj changed the title Fix property-function interpolation of alpha value Fix fill-color property-function interpolation of alpha value Aug 3, 2016
@lucaswoj
Copy link
Contributor

This bug is caused by draw_fill's inability to understand property functions when deciding whether to render in the opaque or translucent pass..

For this reason, we should consider StyleLayer#paint and StyleLayer#layout deprecated and work towards #2739.

Like #2065, this use case would benefit from some methods to determine the range of a style function.

lucaswoj added a commit that referenced this issue Aug 10, 2016
…2971)

* Fix bug breaking transparency in fill layers with property functions

fixes #2846

* Fix logic, add test-suite regression test

* Fix render_fill

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

Successfully merging a pull request may close this issue.

4 participants