I am creating a qgis2leaf webmap from QGIS 2.8.1. It is comprised of several polygon and point layers. I am able to make my polygon layers semi transparent, but not 100% transparent. I want to be able to show only the border of my polygon and have a transparent fill. Howevere, when I set this my webmap shows all black polygons that should have a transparent fill. I would just convert it to a line feature but I want to be able to click the polygon to view the features. Is this a bug in qgis2leaf or is there a workaround?


QGIS Map with transparent polygons.


qgis2leaf webmap with all black polygons.

3 Answers 3


With the current version you are able to create unfilled polygons. check this : video

Simply use no brush fill instead of solid fills.

this issue was covered here: https://github.com/Geolicious/qgis2leaf/issues/187

  • 2
    I updated the plugin and now we are in business. It still has trouble transferring the opacity for a layer that is being styled categorically, but I can make separate layers to get around this. Will file bug report.
    – cbunn
    Commented Apr 13, 2015 at 18:09

Seems like a bug to me. Also reading the README.MD in Qgis2leaf git gave me the impression that opacity should be transffered to the GEOJSON. You might consider opening a bug report.

Exporting an example data with opacity of the fill color == 0 %, gave the following in qgis:


and the following (as yours) after exporting to leaflet using qgis2leaf plugin.


It is easy to modify with a text editor. Open the data folder in your qgis2leaf output, and drag the exp_your shapefile name to an open notepad. Shown below. Note to set the

"transp_fill_qgis2leaf": 0.0

to 0.0. Unfortunately it produces only ones. I also noticed it can't be modified in this way if you have used a categorial symbology.


Here is the result, in which I have set one of the two polygons to be hollow.


It is a teadious work-around, but I couldn't figure out a different way to do it.

  • 1
    yeah I was able to manually adjust the opacity but was hoping to get around it.
    – cbunn
    Commented Apr 13, 2015 at 18:08
  • @cbunn, I managed to write a code in R, reading the .js as text, and exporting it back, but it didn't work. It might be worth to manualy extract the GEOJSON part out and modify it with jsonlite package in R, than wrap it up. manually with the js tags.
    – dof1985
    Commented Apr 13, 2015 at 19:51

Opacity is partially implemented in qgis2leaf. The problem is the many ways in which opacity is specified in QGIS:

  • layer transparency
  • fill transparency
  • fill style
  • rgba colours

We're still in the process of implementing the full range of these in qgis2leaf. It has improved in the last few weeks, so make sure you have the latest master from Github. More will follow.

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.