3

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.

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.

J. Monticolo
16k1 gold badge30 silver badges65 bronze badges
asked Sep 12, 2019 at 15:35
1
  • 1
    The answers to this question suggest trying a graduated style Commented Sep 12, 2019 at 19:10

1 Answer 1

2

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

answered Sep 13, 2019 at 8:49
2
  • 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. Commented 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/fieldswitcher Commented Sep 16, 2019 at 11:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.