1

I need to create one checkbox in QGIS (and qgis2web) that than will show two other layers. So basically I don't want to check two checkboxes in the layerlist, but I want to simplify this process by just checking one checkbox. I want to do this without having to merge multiple layers in one shapefile.

enter image description here

1 Answer 1

2

I don't think it works perfectly in qgis2web yet, but you could create a layer group in QGIS and put your two layers into that. As I say, I don't think qgis2web group export works very well yet - I'd try OL3 export rather than Leaflet. See what happens, and report any bugs at https://github.com/tomchadwin/qgis2web/issues.

This means you will still see both layers in the legend, so it might not solve your issue perfectly. To have just a single legend item which controls a pair of layers would need hand-coding, I think.

3
  • Oké, so the only way to get this working in the qgis2web plugin is by coding it myself?
    – L. Grunn
    Jan 17, 2016 at 20:19
  • Unless you are happy with the layer group suggestion, yes. Jan 17, 2016 at 21:01
  • Yeah thnx a lot for the info! It's a good suggestion i just tested it and that worked. But Design wise it's not quite what i want. Just hoped that someone coded it already.
    – L. Grunn
    Jan 17, 2016 at 21:34

Your Answer

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

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