CSBP-CPSE / web-mapping-components

Other
2 stars 2 forks source link

Opacity paint property could be set independently from color #11

Closed roikle closed 3 years ago

roikle commented 3 years ago

When the opacity of a feature is updated, we currently set the paint property for the fill colour of the feature (e.g. circle-color) with an RGBA value, which sets the alpha value to the opacity value. e.g. a red circle feature with 50% opacity would be equal to rgba(255,0,0,0.5).

Although this works, it may be useful to separate the responsibilities of opacity and color paint updates, especially since Mapbox has dedicated opacity paint properties for each of it's layer types (e.g. circle-opacity).