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 here enter 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.
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.
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.
-
1The answers to this question suggest trying a graduated stylecsk– csk2019年09月12日 19:10:11 +00:00Commented Sep 12, 2019 at 19:10
1 Answer 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
-
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– Sofia R2019年09月14日 23:05:13 +00:00Commented Sep 14, 2019 at 23:05
-
@SofiaR maybe this is helpful for you in the context of hiding many fields in qgis: github.com/riccardoklinger/fieldswitcherRiccardo– Riccardo2019年09月16日 11:41:40 +00:00Commented Sep 16, 2019 at 11:41