2

I’ve just made a map that has two layers: one that contains the polygons and other that contains points. For the last one, I used rule-based symbology where I define the size and colour of the points by the following rule structure:

If  “X”(string) = 'a'  and   "Y"(real) <= 0.04   and   "Y" > 0.03 

enter image description hereenter image description here

The problem is that when I try to export it using Qgis2web the layer points disappear no matter if a use Openlayers or Leaflet.

enter image description here

I’ve changed the rule-based symbology and used a simple one. That just worked so I deduce that rule-based symbology and qgis2web don’t get well togheter.

enter image description here

I found here that the rule-based renderer is tied heavily to Qgis expressions, and only a small subset of Qgis expression functions are so far supported in Qgis2web.

I wonder if is there any possible way that I can use my first style layer and not the simple one to export it.

By that I mean, a different rule expression allowed in qgis2web that gives the same result layer, a different way in qgis to recreate my different point size and colour layer that’s also complatible with the qgis2web pluggin, or even any other pluggin that I can use to export my rule-based symbology layer.

  • 1
    The answers to this question suggest trying a graduated style – csk Sep 12 at 19:10
1

Please preselect your layer with "X" = 'a' and export this selection as a new layer. Then go on with your rule-based renderer on this newly created layer which will be supported in qgis2web: enter image description here

The ruleset of this working prototype might be similar to yours: enter image description here

rule based rendering works fine in leaflet and openlayers

  • It worked perfectly, thanks! – Sofia R Sep 14 at 23:04
  • In case someone finds it useful: while I was editing the fields in the layer properties so they didn’t show up in the pop up, I found out I can hide all of them except the field that I used to make the rule. When I hide it, the layer disappears in qgis2web. – Sofia R Sep 14 at 23:05
  • So please accept it as an answer – Riccardo Sep 16 at 4:12
  • @SofiaR maybe this is helpful for you in the context of hiding many fields in qgis: github.com/riccardoklinger/fieldswitcher – Riccardo Sep 16 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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