1

I want to have the text labels visible on my map.

Unfortunately, I don't know where is the error.

In both cases, the labels are based on one category. In one object I can see the label, in other not. When launch the map preview situation is opposite.

Doesn anyone know how to display the text labels in QGIs2web properly?

enter image description here

1

In the code in our _syle.js layer files we should replace the:

   if ("" !== null) {
    labelText = String("");
   }

with

   if (feature.get("Pole No.") !== null) {
    labelText = String(feature.get("Pole No."));
    }

and it will work

enter image description here

6
  • Also this could help: gis.stackexchange.com/questions/269217/…
    – Jürgen
    Nov 3 '20 at 7:43
  • Are you sure, that your solution is correct? Because within your screenshot "P9" is not within the point....
    – Jürgen
    Nov 4 '20 at 18:38
  • As far as I am concerned I need the P9 to be visible at all. If you have a better solution, you can always suggest something different. I guess, that the alignment section in the code is "responsible" for that.
    – MKR
    Nov 4 '20 at 18:42
  • You could use own svg symbols. With inkscape you can create svg symbols. For example P1-P9. But with a perfect design. Sure, not for all projects a solution.
    – Jürgen
    Nov 5 '20 at 22:17
  • 1
    You could use svg openclipart. These free cliparts you can change for your project. openclipart.org/detail/141541/numbers
    – Jürgen
    Nov 5 '20 at 22:22

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.