2

When I export my QGIS generated shapefile with layers to a web map using qgis2web, the output map is showing repeated number of labels for the same layers. In my QGIS desktop, the label appears only once for each layer but once exported into a map, it shows multiple labels for the same layer. How can I solve this issue?

  • 1
    What are the option you set while creating the labels, could you add a screenshot? – LaughU Jan 25 '18 at 11:52
4

This is probably because your layers use multipart geometry. I'm afraid it's a limitation of the labelling techniques available in the webmapping libraries to which qgis2web exports that mean there is no solution for this yet.


The workaround is a hack. Turn off labelling on your layer. Add another point layer to your project, and style it with transparent outline and fill. Add a points to this new layer where you want your labels to appear. You'll obviously have to add a field for the label text. Turn labelling on on this layer.

  • Yes I did use multiple geometries and merged it into one later while creating the layer. :( – Nishaan Brahmananthan Jan 25 '18 at 15:42
  • Will you be able to suggest me another software similar to qgis, because my research project requires me to create an interactive ancient world map. – Nishaan Brahmananthan Jan 25 '18 at 15:49
  • I've added a possible workaround to my answer. – Tom Chadwin Jan 25 '18 at 15:50
  • I thought about this method before. If I do this, I will have multiple layers (Check box) in my layer pannel. My professor doesn't want me to have different checkboxes for the same geometry, unless there is a way to like both the checkboxes into one. – Nishaan Brahmananthan Jan 25 '18 at 16:03
  • 1
    Thanks Tom. I managed to solve this issue. I created additional shapefiles for each label (polygon) and merged that shapefile with the existing geometry shapefile. Later used the label shapefile field to show the labels. – Nishaan Brahmananthan Jan 30 '18 at 9:02
1

I managed to solve this issue. I created additional shapefiles for each label (polygon) and merged that shapefile with the existing geometry shapefile. Later used the label shapefile field to show the labels.

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.