Git Product home page Git Product logo

Comments (12)

andreaordonselli avatar andreaordonselli commented on July 23, 2024

Can you attach your .qgz project and some example data in a zip?

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

@andreaordonselli
seven.001.zip

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

seven.002.zip

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

@andreaordonselli please change the above files to seven.zip.001 and seven.zip.002, then unzip them, thanks very much for your quick response

from qgis2web.

andreaordonselli avatar andreaordonselli commented on July 23, 2024

What gives error is the unsupported symbology of v6_time....
You could use this symbology to avoid export errors

image

Let me know if you can solve it with this method

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

Hi @andreaordonselli, I changed the symbology of v6_time to "simple fill", the export works now, thanks.

But there are still two issues, 1)the labels of the "Waihai" contour are missing; 2) I used an expression to control the Stroke width of the "Waihai" contour, it seems that the exported web map doesn't support expression.

Do we have a support or un-support feature list?

from qgis2web.

andreaordonselli avatar andreaordonselli commented on July 23, 2024

Yes, in WIKI there are supported feature list:

https://qgis2web.github.io/qgis2web/#SetStyles

https://qgis2web.github.io/qgis2web/#setLabels

The expressions are not supported for example. I'll see if I can provide you with code for repeating the label along the perimeter.

from qgis2web.

andreaordonselli avatar andreaordonselli commented on July 23, 2024

For the labels I have to work on it, for the line stroke you could create a new field where you place the expression result values ​​and theme the stroke based on these

image

Then

image

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

The solution of "replacing expression with a new field" works, thanks!

from qgis2web.

andreaordonselli avatar andreaordonselli commented on July 23, 2024

As for the labels, I can't understand why if I use your project the export doesn't show the labels.
If instead I copy all the multilines of "Waihai" into a new linear vector layer, and export, the labels are visible.

Add this code to the bottom of the "Waihai" style file located in the "styles" folder of the export

    var interval = 1200;
    var geometry = feature.getGeometry();
    if (geometry.getType() === 'MultiLineString') {
      geometry.getLineStrings().forEach(function (line) {
        var length = line.getLength();
        var intervals = Math.ceil(length / (interval * resolution));
        for (let i = 1; i < intervals; ++i) { //will not place labels at the start and end of the line
     // for (let i = 0; i <= intervals; ++i) to include them	
          var point = line.getCoordinateAt(i / intervals);
          var styletext = new ol.style.Style({
            text: new ol.style.Text({
              text: labelText,
              font: labelFont,
              fill: new ol.style.Fill({
                color: labelFill
              }),
              stroke: new ol.style.Stroke({
                color: bufferColor, 
                width: bufferWidth
              }),
            })
         });
          styletext.setGeometry(new ol.geom.Point(point));
          style.push(styletext);
        }
      });
    }

Here:
image

The result will show the labels repeated along the linestring, adjust "var interval" with the necessary value

image

from qgis2web.

flyisland avatar flyisland commented on July 23, 2024

@andreaordonselli thanks, I'll try if I could apply your solution in my project

from qgis2web.

andreaordonselli avatar andreaordonselli commented on July 23, 2024

You're welcome. If you are happy with qgis2web I kindly ask you to consider donating a virtual coffee via the button on the home page to support the development of the project, thank you.

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.