Git Product home page Git Product logo

Comments (6)

andreaordonselli avatar andreaordonselli commented on May 29, 2024 1

You forgot to put the shp in the zip

from qgis2web.

andreaordonselli avatar andreaordonselli commented on May 29, 2024

can you provide an example qgis project with example data? you can upload the zip in this chat.

from qgis2web.

kraln avatar kraln commented on May 29, 2024

Sure, the mapbox error is around mapboxLayerScripts.py, line 392:

         UnboundLocalError: local variable 'classes' referenced before assignment

So, same as leaflet.

example.qgz.zip

from qgis2web.

andreaordonselli avatar andreaordonselli commented on May 29, 2024

Even without your data, I have verified that it is very complicated for any webgis to execute the "inverted polygon" style. In fact, qgis2web exports do not export a result because they do not export a style, i.e. the geometries are in the map, but they cannot be seen because the system fails to color them.
I don't see any other method than to act on the geometries by drawing the graphic shape reversed with respect to the current one, and applying a standard "fill" style to it.

from qgis2web.

kraln avatar kraln commented on May 29, 2024

Apologies for the missing data, here is a re-upload
example.qgz.zip

I think for me, properly supporting inverted polygons is secondary (and low priority) compared to simply "not crashing" during the output; the existing "not supported" warning is probably enough.

My change which appears to work for leaflet exporter is as follows:
qgis2web/leafletLayerScripts.py:

356         else:          
357             feedback.showFeedback(
358                 """Layer {}: legend for renderer {}
359                  not supported""".format(layer.id(), renderer.type()))
360                                            
361             classes = None                 
362         legend = layer.name().replace("'", "\\'") + "<br />"
363         if classes is not None:                                                                                     
364             legend += "<table>"            
365             for cnt, c in enumerate(classes):
366                 symbol = c.symbol()
367                 legend = iconLegend(symbol, c, outputProjectFileName,
368                                 safeLayerName, legend, cnt)
369             legend += "</table>"
370             symbol = classes[0].symbol()
371         else:
372             symbol = None
373     return (legend, symbol) 

from qgis2web.

andreaordonselli avatar andreaordonselli commented on May 29, 2024

It's not just a matter of python code, webgis can't stylize inverted polygons like qgis does, you have to draw correct polygons and stylize them normally.
You have to choose the "single symbol" item in qgis or the "categorized" item
2023-06-23 15_09_53-Window

from qgis2web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.