0

I have struggled with duplication of labels in polygons using WMS in Leaflet. Is there a workaround that does not involve publishing another point layer based on the polygon with a label? I am looking for a similar approach as OpenLayers with an SingleTile option. But as far as I have seen there is not.

Using param tiled:false is not enough https://docs.geoserver.org/latest/en/user/services/wms/vendor.html#tiled The link mention tilesorigin, but I am not sure what this is or if it is relevant to how the tile/s are rendered?

This is how I have instantiated the layer, but that does not solve the issue with duplicated labels inside polygons.

L.tileLayer.wms(GEOSERVER_BASE_URL, {
    transparent: true,
    format: "image/png",
    layers: "layer",
    tiled: false
});

I have been searching a fair bit to find a solution, but I have not came across a solution that worked/I fully understood to implement.

  • Please edit your question and add relevant existing code, otherwise question is most likely to be closed as not compliant to GIS SE site policy. And what exactly do you mean by "duplication of labels"? – TomazicM Nov 24 '20 at 11:57
  • 2
    Does this help github.com/Leaflet/Leaflet/issues/558? The server side metatiling with tiled:false is the best you can do on the server side and you have used that trick already. – user30184 Nov 24 '20 at 12:11
  • It does include some good info yes, thanks. I will have a go with the plugin and see if that might help. – geogrow Nov 24 '20 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.