I am pretty new to GeoServer. I am trying to make a style with dynamic labeling. Currently, I am using env
to label multiple attributes, but I don't know how to change the color for each of the attributes that I made. Heres the SLD that I made.
Is there any way for me to have color red for attr0 and blue for attr1?
<TextSymbolizer>
<Geometry>
<ogc:Function name="centroid">
<ogc:PropertyName>the_geom</ogc:PropertyName>
</ogc:Function>
</Geometry>
<Label>
<ogc:Function name="property">
<ogc:Function name="env">
<ogc:Literal>attr0</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
</ogc:Function>
</ogc:Function><![CDATA[
]]>
<ogc:Function name="property">
<ogc:Function name="env">
<ogc:Literal>attr1</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
</ogc:Function>
</ogc:Function><![CDATA[
]]>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">
<ogc:Function name="Categorize">
<!-- Value to transform -->
<ogc:Function name="env">
<ogc:Literal>wms_scale_denominator</ogc:Literal>
</ogc:Function>
<ogc:Literal>10</ogc:Literal>
<ogc:Literal>3000</ogc:Literal>
<ogc:Literal>10</ogc:Literal>
<ogc:Literal>30000</ogc:Literal>
<ogc:Literal>5</ogc:Literal>
</ogc:Function>
</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
</Fill>
</TextSymbolizer>