2

I am working as volunteer on a simple map for an NGO, I have some point layers with rule-based symbology. When I load these layers in qgis2web the symbology disappears, both in Leaflet and OpenLayers. I think I have the same problem posted by Sophia R. and solved (Can qgis2web display rule-based layer style?).

The matter is that I'm new in QGIS and I don't know how to "preselect your layer with "X" = 'a' and export this selection as a new layer" as suggested by Riccardo.

How can I do this?

2 Answers 2

3

qgis2web supports rule-based symbology. However, it only supports a very limited number of expressions. Your rules probably contain expression functions not supported by qgis2web.

If you can post an exported QML style as a new issue at https://github.com/tomchadwin/qgis2web/issues, someone can investigate whether qgis2web can be enhanced to support the currently unsupported function(s).

0

I have a similar issue with rule-based layers. QGIS2web is exporting them and I can see them all in the "layers" folder, but they are not displayed. I checked the HTML file that links to the .js files in the "layers" folder created by QGIS2web, and I can see that one of the layers is referred to correctly:

<script src="resources/proj4.js"></script>
        <script>proj4.defs('EPSG:3857','+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs');</script>
        <script src="resources/polyfills.js"></script>
        <script src="./resources/functions.js"></script>
        <script src="./resources/ol.js"></script>
        <script src="./resources/ol-layerswitcher.js"></script>
        <script src="layers/mossdepotsformerlygeneralsupply_1.js"></script><script src="layers/generalsupplydepots_2.js"></script>
        <script src="styles/mossdepotsformerlygeneralsupply_1_style.js"></script><script src="styles/generalsupplydepots_2_style.js"></script>
        <script src="./layers/layers.js" type="text/javascript"></script> 
        <script src="./resources/Autolinker.min.js"></script>
        <script src="./resources/qgis2web.js"></script>

The other layers do not come up in the HTML file at all. And not even the layer I can see here is displayed on the actual map. All my layers are rule-based and some of them contain rather complicated expressions.

What I will do now is extract all the layers I need as separate GeoJSON files from my original data set using Python, but with this pre-selection, it will be inconvenient to highlight different attributes in the same map at a later stage.

2
  • Please open an issue at github.com/tomchadwin/qgis2web/issues, where you will be able to upload your project and layer files so that others can reproduce the problem and investigate. Commented May 13, 2020 at 10:51
  • 1
    Thanks, I already commented on the closed issue #620 but have now opened issue # 883 and attached my files. Commented May 13, 2020 at 11:23

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.