Skip to main content
2 of 3
Added another approach using OpenLayers configuration.

Check out GeoWebCache, the tile cache engine that comes with GeoServer. You can specify the gutter parameter. According to the docs: "the gutter parameter is specified in pixels and represents extra padding around the image that is sliced away when the tiles are created. Certain WMS server have edge effects that can be eliminated this way, but it can also result in labels being cut off". Particularly the last statement indicates this may solve your use case.

Another approach would be to simply request a larger image than the viewport of OpenLayers using the ratio parameter. Thus, labels that appear at the edge of the viewport are still labeled centered on their anchor location as there is still enough of the WMS map image that's simply not visible outside the OL viewport.