I am using QGIS 2.18 and plugin qgis2web to produce a web map. In QGIS I have the layer layout I want, with a particular image sitting above all others. This layer-order is changed when I attempt to generate the web map (see image). What am I doing wrong? Is there a way to dictate layer order in the web map?

enter image description here

  • I think the question might be "How do I order the raster layers in the web map when using qgis2web". – IanGS Oct 4 '18 at 22:28
  • 1
    Can you be a little more explicit? Your screenshot has arrows pointing to the geophys layer, which is at the top of the layers list in both QGIS and in the qgis2web preview. This looks correct. Is your issue with the google.cn layers? If so, can you give some info on what kind of layers they are - static rasters/QuickMapServices/OpenLayers/WMS/XYZ, etc.? – Tom Chadwin Oct 5 '18 at 8:27
  • Agreed. But in the QGIS software, it sits as the TOP layer above all other layers on the actual map. In the qgis2web screen, it sits BELOW every other layer on the actual map. All the layers are raster images (Geotiffs). – IanGS Oct 5 '18 at 9:54
  • 1
    Since we can't see your QGIS screen, and don't know your data, that wasn't apparent. OK, thanks. – Tom Chadwin Oct 5 '18 at 9:56

I couldn't recreate this problem if the rasters were not in layer groups. However, when one layer is in a layer group, it seems to be rendered on top regardless of where it should be. However, I see this reflected in the layer order in the Leaflet layers control, whereas your example appears not to be.

As a test, can you try temporarily not using layer groups, and see whether the issue disappears? I suspect you've uncovered a qgis2web bug, related to https://github.com/tomchadwin/qgis2web/issues/175. As such, https://github.com/tomchadwin/qgis2web/issues/ is probably a more appropriate place to discuss.

On the other hand, if you do get the issue even with no layer groups, then I don't yet have an answer.

  • I get the same issue even with no layer groups. Should the order of layers be replicated from QGIS to qgis2web? Or is there some subtle 'importance' being applied as in type of layer or alphabetically or whatever? – IanGS Oct 5 '18 at 14:21
  • That layer is ALWAYS at the bottom once its rendered in qgis2web. Is there any way of tweaking this layer to ensure its always rendered on top? – IanGS Oct 5 '18 at 14:41
  • 1
    Oh dear. No idea what is causing that. No, nothing should be changing the layer order from the QGIS one. To make progress on this, you'll need to open a new issue as per the link in my answer. You can then update project file and layers, to allow others to recreate the issue. Without being able to do that, it's very hard to debug. – Tom Chadwin Oct 5 '18 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.