问题描述
如您所见,标签是重复的,有时会被截断。那是因为一个瓷砖不知道另一个瓷砖。如何预防?
禁用部分标签对截止有一点帮助,但重复仍然存在:
谢谢
解决方法
除了@IvanSanchez 在此处的回复:https://gis.stackexchange.com/questions/346467/preventing-clipped-labels-from-qgis-server-wms-in-leaflet-js。
您实际上可以将 tileSize 设置为地图的宽度/高度,并且您不会遇到此类问题,因为整个地图将由 1 个图块组成(尽管此解决方案会给 MapServer 带来额外压力)。 tileSize 是 GridLayer 定义的一部分:https://leafletjs.com/reference-1.7.1.html#gridlayer。
Param: tileSize
Default: 256
Type: number|Point
Def: Width and height of tiles in the grid. Use a number if width and height are equal,or L.point(width,height) otherwise.