[Users] Symbol in layer tree disappears when applying numberFormat in SLD
Andrew Parker
andrew at source3.com
Mon Mar 7 00:40:15 CET 2011
And to those who is following, here is the complete SLD for GeoServer
2.0.2 for reference:
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
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"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>USGS GW Elev</Name>
<UserStyle>
<Title>USGS GW Elev</Title>
<Abstract>Groundwater elevation, feet mean sea level</Abstract>
<FeatureTypeStyle>
<!--FeatureTypeName>Feature</FeatureTypeName-->
<Rule>
<Name>GW Elev (ft msl)</Name>
<MaxScaleDenominator>90e6</MaxScaleDenominator>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>triangle</WellKnownName>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
</Fill>
</Mark>
<Size>9</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<MaxScaleDenominator>150000</MaxScaleDenominator>
<TextSymbolizer>
<Label>
<ogc:Function name="if_then_else">
<ogc:Function name="isNull">
<ogc:PropertyName>gwelevft</ogc:PropertyName>
</ogc:Function>
<ogc:Literal></ogc:Literal>
<ogc:Function name="numberFormat">
<ogc:Literal>#.#</ogc:Literal>
<ogc:PropertyName>gwelevft</ogc:PropertyName>
</ogc:Function>
</ogc:Function>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">08</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>
7
</DisplacementX>
<DisplacementY>
0
</DisplacementY>
</Displacement>
</PointPlacement>
</LabelPlacement>
<Halo>
<Radius>2</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
</Fill>
<VendorOption name="autoWrap">60</VendorOption>
<VendorOption name="maxDisplacement">150</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
--
Andrew Parker
More information about the Users
mailing list