如何防止 Leaflet/Mapserver(WMS) 中的标签/符号重复/剪切

问题描述

label/symbol duplication with leaflet/mapserver with wms

如您所见,标签是重复的,有时会被截断。那是因为一个瓷砖不知道另一个瓷砖。如何预防?

禁用部分标签对截止有一点帮助,但重复仍然存在:

disabling label partials

谢谢

解决方法

除了@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.

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...