2

I am making an interactive webmap with QGIS2WEB. Normally when I create layers in QGIS then open QGIS2WEB the layers open up in the preview window, then appear in the website.

However, I now have some custom layers and not only will they not appear in the preview window or the created web map, if I include them at all the whole map shows up blank.

I tried this with layers whose CRS was EPSG:4326 as well as EPSG:3857, neither worked.

I tried opening up some random shapefiles downloaded from the web and they worked fine, but once I added my layers, any of them, the whole map turned up blank.

I know there are some limitations to what QGIS2WEB can display, but these particular .shp layers are fairly basic and work fine elsewhere...

Any advice?

5
  • Can you describe what you mean by "custom" layers? Even better, if you can upload one which doesn't work and link to it, someone can try to reproduce the problem. Commented May 24, 2017 at 23:25
  • Do your "custom layers" have a specified CRS?
    – Vale
    Commented May 26, 2017 at 10:55
  • As described above, yes, I set one set of layers to EPSG 4326 and another to 3857, and neither worked. Commented May 27, 2017 at 15:56
  • Okay, I made a crude website with a link to a .zip file. Here's the URL: eddiearniwhatever.neocities.org/files_to_share.html - click on the red skull. Commented May 27, 2017 at 16:15
  • Update, I found that the file I shared with you was corrupted, how I don't know. But I reopened it in Arc, then exported it as a .shp file, which I reopened in QGis and that seems to have fixed the problem. I have no idea what was wrong with that one.... thanks for responding. Commented May 28, 2017 at 1:01

2 Answers 2

2

Your problem seems to be typical and it needs to take a look at the following things:

  1. is there layer styling simple? When you use some snazzy layer styling including more than 1 element, then it might not be rendered properly by the QGIS2web plugin. See the examples below:

enter image description here

so when you use a simple marker it's absolutely fine, but if some of your layers include more than 1-2 patterns at once or (God forbid!) some patterns, then they won't be rendered.

  1. Open Layer properties and check the "Fields" section. Here you have the Data attribute table fields. Make sure, that they don't include:
  • blank spaces
  • ampersands & ant other unacceptable symbols# enter image description here
  1. Since the problem is related to shapefiles, make sure, that any field with your data attribute table hasn't been cut down to just 10 characters, as explained here:

QGIS keeps cutting off attribute table column names after 10 characters, can I stop this?

If even one field will have name changed due to character cut, the layer also won't be rendered properly.

CONCLUSION:

Open the QGIS2web plugin, untick all the layers first, and next select only one of them and click update preview. Do it one by one until you encounter the faulty layer.

enter image description here

When the problematic layer is found, then play with it, check what is wrong (mentioned in these 3 points above), and adjust what is needed.

1

In my case, qgis2web won't work if in the conditions in the style point to an attribute with a space in it.

I remove all the spaces and voila, qgis2web work again.

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.