I am trying to publish a raster layer with qgis2web, when I set the parameters in the popup qgis2web window, the raster doesn´t show up in the preview window (there is a question mark instead). Then, after exporting/publishing, the folder with index.html file and other folders are created, but there is nothing inside the data folder, and the raster does not show on the index.html page. A similar thing happens if trying with qgis2leaf. Any idea of what might been wrong? The raster is a 3 band composite RGB from Sentinel2 bands, saved as rendered raster, projection EPSG:4326.QGIS Version is 2.18. Raster link: https://www.dropbox.com/s/l1dvxzq37oe10yp/7%20rendered.tif?dl=0

  • Confirmed that it fails with OpenLayers 3 export. However, it works for me with Leaflet export - can you confirm? I'll investigate the OpenLayers issue. – Tom Chadwin Feb 4 '17 at 11:31
  • No, it doesn´t work with Leaflet export for me. Qgis MacOS ver 2.18. – APR Feb 4 '17 at 12:12
  • 1
    Ah, perhaps you have the same bug as github.com/tomchadwin/qgis2web/issues/…. Some MacOS rasters fail. No fix for it yet, I'm afraid. – Tom Chadwin Feb 4 '17 at 12:17

It looks like there was a regression in qgis2web for OpenLayers 3 raster layers. I've committed a fix to the Github master branch at https://github.com/tomchadwin/qgis2web. Please try that and leave a comment to this answer to say whether it fixes the problem or not.

  • thank you very much Tom, but by knowledge is limited for executing your recommendation, I see the utils.py file that you have added, but I wouldn´t know how to proceed to try it. I´d be thankful if you adviced me how. – APR Feb 4 '17 at 12:38
  • On the page I linked to, click the green button "Clone or download", and choose "Download ZIP". Open the downloaded zip file, and copy the contents of the folder "qgis2web-master" over the contents of the qgis2web installation folder (the installation folder is listed in the plugin's details screen in the QGIS plugin manager). Then restart QGIS - you now have the most up-do-date development version of qgis2web. Try your raster again, and report back what happens. – Tom Chadwin Feb 4 '17 at 13:08
  • I updated the folder content, but everything stays the same: there is no problem with vector layers, but with rasters, nothing show in preview when selecting OpenLayers 3, and I can see a square outline with a question mark in the center when selecting Leaflet. – APR Feb 4 '17 at 19:02
  • Now, what I did is installed QGis Windows version on the same machine, with Parallels Desktop. Now, OpenLayers 3 doesn´t work but Leaflet does the export fine. – APR Feb 7 '17 at 22:32
  • Can you post any errors, either from the QGIS Python console, or from the browser console? – Tom Chadwin Feb 8 '17 at 7:08

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.