[GIS] WMS layer details not clearly visible in Leaflet

layersleafletwms

I cannot figure out where the problm is. I use GeoServer and Leaflet. My problem is that when I visualise some layers (in particular that with the names of the clients) I cannot see them all at each zoom level as I in the layer preview in Geoserver. Why??
The SLD must be correct otherwise I wouldn't have a correct preview right? Then when I load the site in Leaflet and I zoom in and out I cannot see all the names of the clients. I also have a similar problem with pie-chart: in layer preview they are perfect, while in leaflet are cut or not visible. Where is the problem? Moreover, is there a way to solve it??

Best Answer

You are not telling us how you get the WMS in Leaflet: are you using the default object or a plugin?

I have experiences the "cut" issues with labels too.

I suspect that the problem might come from the fact that Leaflet WMS object is a extension of the Tile object and somehow in the request processing somehting ges wrong. The geometric object to which the label correspond is one one tile and the labels would be on two tiles, if it were a tile system. However, as the geometric object is not on the second tile, its label is not rendered and thus you get "cut" labels. => Check whether the issue always appear at the "tile" borders.

Maybe this plugin can help you: https://github.com/heigeo/leaflet.wms

Or you might want to change the default size of tiles, so that you get one big tile (the tile must be slightly bigger than the size of your map on the screen)

Related Question