Feature request #12769
Data defined opacity for vector features
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||20868|
Lately, more and more settings got data-definable. But it seems opacity/transparency was somewhat forgotten !
Of course, it's possible to achieve the result by data-defining the color of each symbol layer, but then one must hardcode the color in the code.
So I'd suggest adding the ability to data-define transparency, which I think can be useful in a lot of cases.
#2 Updated by Olivier Dalang over 4 years ago
@Karolina do you have an idea when you'd be able to work on this ? I had a look at the source, unfortunately it seems a bit above my C++ skills...
From what I understand, data-defined properties are only possible at symbol layer level.
Data-defined properties at root level (size and rotation for point layers, and width for line layers) seem to be copied to the underlying symbol layers with some intelligence so that they scale/rotate/... proportionally.
This has (at least) two drawbacks :
- it leads to some unexpected behaviour when you add a new symbol layer after having data-defined a root level property (the new symbol layer won't scale/rotate) - I just created #13033
- it's not applicable for opacity, which is defined in the color in the symbol layers
Probably best would be to implement data-defined properties at root symbol level too, instead of copying them to the symbol layers.
This probably means to change the "size" and "width" fields at root symbol level to "scale" (which makes more sense anyways, since the width of the child elements can be different).
Without doing that, implementing data-defined opacity for the whole symbol will be very tricky.