一整行地理服务器生成的形状不会标记
One complete row of geoserver produced shapes will not label
我有一个网络地图,使用 Google 地图 API 和 GeoServer 来显示 7.5' 四边形。它们都是相同的形状,但从北到南(圣乔到阿肯色州卡姆登)的一排 运行 不会标注。除了有问题的行,标签在鼠标悬停时显示在小于 10 的缩放级别,并且所有标签都将显示在更高的缩放级别。
http://www.geology.ar.gov/geologic_maps/quad24k_map.htm
这是我的图层样式...
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Quad Poly With Label</Name>
<UserStyle>
<Title>Quad Poly With Label</Title>
<FeatureTypeStyle>
<Rule>
<Name>QuadLabel</Name>
<Title>Transparent Quad With Label</Title>
<Abstract></Abstract>
<TextSymbolizer>
<Geometry>
<ogc:Function name="centroid">
<ogc:PropertyName>the_geom</ogc:PropertyName>
</ogc:Function>
</Geometry>
<Label>
<ogc:PropertyName>QUAD_NAME</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>
<ogc:Literal>0.5</ogc:Literal>
</AnchorPointX>
<AnchorPointY>
<ogc:Literal>0.5</ogc:Literal>
</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>
0
</DisplacementX>
<DisplacementY>
0
</DisplacementY>
</Displacement>
<Rotation>
<ogc:Literal>0</ogc:Literal>
</Rotation>
</PointPlacement>
</LabelPlacement>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="conflictResolution">false</VendorOption>
<VendorOption name="goodnessOfFit">0</VendorOption>
<VendorOption name="autoWrap">80</VendorOption>
<VendorOption name="maxDisplacement">25</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
既然你指的是缩放级别,我猜你正在使用平铺渲染。跨越 tile 边界的标签不会被绘制,因为不能保证另一半会被绘制。如果您想冒在地图上切割标签的风险,您可以要求 GeoServer(自 2.6.x 如果没记错的话)无论如何使用此供应商选项来绘制它们:
http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#partials
我有一个网络地图,使用 Google 地图 API 和 GeoServer 来显示 7.5' 四边形。它们都是相同的形状,但从北到南(圣乔到阿肯色州卡姆登)的一排 运行 不会标注。除了有问题的行,标签在鼠标悬停时显示在小于 10 的缩放级别,并且所有标签都将显示在更高的缩放级别。 http://www.geology.ar.gov/geologic_maps/quad24k_map.htm
这是我的图层样式...
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Quad Poly With Label</Name>
<UserStyle>
<Title>Quad Poly With Label</Title>
<FeatureTypeStyle>
<Rule>
<Name>QuadLabel</Name>
<Title>Transparent Quad With Label</Title>
<Abstract></Abstract>
<TextSymbolizer>
<Geometry>
<ogc:Function name="centroid">
<ogc:PropertyName>the_geom</ogc:PropertyName>
</ogc:Function>
</Geometry>
<Label>
<ogc:PropertyName>QUAD_NAME</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>
<ogc:Literal>0.5</ogc:Literal>
</AnchorPointX>
<AnchorPointY>
<ogc:Literal>0.5</ogc:Literal>
</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>
0
</DisplacementX>
<DisplacementY>
0
</DisplacementY>
</Displacement>
<Rotation>
<ogc:Literal>0</ogc:Literal>
</Rotation>
</PointPlacement>
</LabelPlacement>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="conflictResolution">false</VendorOption>
<VendorOption name="goodnessOfFit">0</VendorOption>
<VendorOption name="autoWrap">80</VendorOption>
<VendorOption name="maxDisplacement">25</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
既然你指的是缩放级别,我猜你正在使用平铺渲染。跨越 tile 边界的标签不会被绘制,因为不能保证另一半会被绘制。如果您想冒在地图上切割标签的风险,您可以要求 GeoServer(自 2.6.x 如果没记错的话)无论如何使用此供应商选项来绘制它们: http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#partials