geoserver +openlayer3+styles 加载点以及本文样式
1.直接上代码:往goeserver中styles中粘贴即可
<?xml version=”1.0″ encoding=”GB2312″?>
<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”>
<!– a Named Layer is the basic building block of an SLD document –>
<NamedLayer>
<Name>experimenting transparent</Name>
<UserStyle>
<!– Styles can have names, titles and abstracts –>
<Title>GeoServer Beginners Guide:transparent</Title>
<Abstract>A sample style that draws a point</Abstract>
<!– FeatureTypeStyles describe how to render different features –>
<!– A FeatureTypeStyle for rendering points –>
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Red Square</Title>
<Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
<MaxScaleDenominator>40000</MaxScaleDenominator><!–设置点跟着比例次的显示效果–>
<PointSymbolizer>
<Graphic><!–这里可以设置为一个图片的格式–>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name=”fill”>#ff9900</CssParameter>
<CssParameter name=”fill-opacity”>0.35</CssParameter>
</Fill>
<Stroke>
<CssParameter name=”stroke”>#ff0000</CssParameter>
<CssParameter name=”stroke-width”>1</CssParameter>
</Stroke>
</Mark>
<Size>9</Size>
<Rotation>30</Rotation>
</Graphic>
</PointSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>bdzname</ogc:PropertyName>
</Label>
<Font>
<CssParameter name=”font-family”>SimSun</CssParameter>
<CssParameter name=”font-size”>12</CssParameter>
<CssParameter name=”font-style”>normal</CssParameter>
<CssParameter name=”font-weight”>bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0</AnchorPointX>
<AnchorPointY>0</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>2</DisplacementX>
<DisplacementY>5</DisplacementY>
</Displacement>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name=”fill”>#0000ff</CssParameter>
</Fill>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
2.geoserver中文乱码请查看:
https://blog.csdn.net/weixin_41591572/article/details/84590100
需要转载,请注明本文地址
转载自:https://blog.csdn.net/weixin_41591572/article/details/84590487