0

I am exporting my map with qgis2web and I would like to export the opacity of my layers as well. It does not work, somebody has an idea?

1 Answer 1

0

Opacity does work on qgis2web but only at the feature level of opacity, it seems. Here's a qgis2web preview (left) and a QGIS main canvas (right) side-by-side:

enter image description here

The opacity on the yellow features comes from the "Fill Color" of the "Simple Fill" styling opacity (note you can see through to the checkerboard under the yellow), and shows through on the web map:

enter image description here

But the blue polygon has opacity from the overall opacity of the layer, set at the top level of the layer styling dialog:

enter image description here

but that opacity does not show up on the web map. I tried OpenLayers and Leaflet versions, both did the same.

However the Mapbox GL JS web map did... the exact opposite! Transparent blue and opaque yellow!

enter image description here

It might be worth a check on the Qgis2web developer site to see if this is a known issue and reporting it if not. I also checked the preview on Firefox and the same things happened. Opacity in QGIS can come from so many places - the layer level, the feature, the styling, the layer group - that it is hard for qgis2web to find all the places where it could be specified. And that's even before considering complicated styles like graduated fills and polygon starbursts.

So if you can set the transparency at the fill symbol level like my yellow layers, that should work for you.

1
  • Thank you very much for your explanations, I work with Leaflet but I can see if MapBox is more developed in that field ! Thank you again Apr 7, 2021 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.