maplibre-gl-js
maplibre-gl-js copied to clipboard
Add a per-layer opacity property
Hello,
User Story
As a user I would like to have an opacity setting at the layer level to avoid "additive opacity" inside the same layer.
Rationale
Here is an example with the current situation:
(Screenshot from https://jsfiddle.net/wq8gk2z5/22/)
We can see that the resulting line has actually ~4 colors due to the way it's rendered. I would like the rendered line to be a single color / opacity no matter how many times it crosses itself.
Impact
Would be a nice addition.
Related
- The matching (old) issue on MapboxGlJS side seems to be https://github.com/mapbox/mapbox-gl-js/issues/4090
- This might also be related to https://github.com/maplibre/maplibre-gl-js/issues/48 though I am not 100% sure.
Might be related to the following: #1191 This PR is out of sync and very old unfortunately...
Hello @HarelM,
I have been chatting with a colleague of mine @philae-ael in the recent days as I know his general interest with the matter being discussed here. And... he has done few POCs already. As happy users of Maplibre, we are willing to allocate a bit of his professional time to contribute back :rocket:
I'll let the mic to him but I'll keep an interested eye on what's happening here :nerd_face:
I guess the next step would be to discuss the actual objective(s) and the different approaches possible and the one that are the most likely to get merged ; what we should be careful, etc. On my side I can help track / followup things if welcomed.
All the best !
If there's a need to update the current style spec with new properties, the best place to discuss this is the style-spec repo and bring it up in the monthly meeting to see what people in the community think and what things we might have forgot to take into consideration. Any contribution is welcomed! :-)
Great, we will try to kick-off a new discussion there in the coming days.
Digging a bit more we found https://github.com/mapbox/mapbox-gl-js/pull/11082, @HarelM any ideas on if we could bring something that resembles to Maplibre (this has no impact on the spec) or should we try to give another shot to https://github.com/maplibre/maplibre-gl-js/pull/1191 - or some version dedicated to lines only for now ?
If we could fix it without a style spec change it would be great. We can't copy code from mapbox as of version 2.0 and I think the above PR is dated after the fork of this repo and the license change. In order not to infringe copyright laws we should avoid looking at the linked code.
This is an example of the problem with real-world data and inset lines.
This makes it flat-out impossible to implement a copy of OpenStreetMap Carto in Maplibre, as it relies on transparent inset lines for national parks, tourism, and some other features.