I'm using QGIS Version 3.22.4. I'm using the qgis2web plugin to create a web map from a layer in QGIS with OpenLayers export. It has a number of fields, some are complete with data, while others can have null values. Then with popups for points on my map, there are displayed field labels and a blank space for the null values. I would like to hide these fields when there is no data.

enter image description here

I know I can turn off 'inline' labels to 'no label' for different fields when creating the map using the qgis2web plugin, but this then leaves vertical gaps between lines in the popup which I could do without.

enter image description here

And I know the qgis2web.js file can also be edited, and there was a post with code to edit, but it was nearly three years ago and it doesn't work for me which I assume may be due to software version changes?

I am a novice with QGIS.

  • Specify to what kind of web map you exported it (OpenLayers, Leaflet, Mapbox) because source code for each one is different.
    – Pepe N O
    Commented Mar 4, 2022 at 21:51
  • Apologies. The export is OpenLayers. Commented Mar 4, 2022 at 22:49


Your Answer

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

Browse other questions tagged or ask your own question.