I am trying to setup meta-tiling in Geoserver 2.8.0 (I can version up if necessary) in order to prevent multiple labels on polygons which span across tiles.
I am using Leaflet (1.0 RC) on the client.
L.tileLayer.wms("http://178.62.114.162:8080/geoserver/geolytix/wms", {
layers: 'seamless_locales',
format: 'image/png',
transparent: true,
styles: 'seamless_locales',
tiled: true,
tilesorigin: [-180, 90]
})
I was initially confused about the tiles origin. Turns out that it doesn't matter whether I use [-180, 90] or [-180, -90]. The result is the same. See screenshot. Left without meta-tiling, right with meta-tiling.
There are still some duplicate labels in the meta-tiled example. As suggested in the comments this might is probably due to the meta-tile size which is 3*3.
I am trying to change the meta-tile size but have yet been unable to do so.
Edit:
I changed the labels to a point layer of the polygon centroids but labels are not rendered across the tile boundaries and I don't like the idea of having a separate layer for labels.
I am having a workaround with a non-tiled layer leaflet plugin which works well. It's neither the prettiest or quickest solution but it works.