0

I am trying to add transparency to a set of polygons (city bounds) within a .sld style file for OSM. Please see below:

no transparnecy

As you can see the city bounds are overlapping Montana State University. My goal is to have no fill or transparent fill for the city bounds. In this image I have it set to #00FFFFFF and GeoServer is not liking it as you can see.

Here is the SLD chunk for the polygon:

<sld:Name>Boundary</sld:Name>
<sld:Title>Boundary</sld:Title> 
<sld:PolygonSymbolizer>
    <sld:Fill> 
        <sld:CssParameter name="fill">#00FFFFFF</sld:CssParameter>
    </sld:Fill>
    <sld:Stroke>
        <sld:CssParameter name="stroke">#6a7c87</sld:CssParameter> 
        <sld:CssParameter name="stroke-width">0.5</sld:CssParameter>
        <sld:CssParameter name="stroke-linejoin">round</sld:CssParameter>
    </sld:Stroke> 
  • 1
    Where are you using this? Usually the WMS properties in the script of the application is where this is handled. – DPSSpatial Jun 11 at 23:02
  • 1
    Show the relevant portion of the sld file you are using, especially the polygon fill opacity. – JGH Jun 12 at 0:36
  • <sld:Name>Boundary</sld:Name> <sld:Title>Boundary</sld:Title> <sld:PolygonSymbolizer> <sld:Fill> <sld:CssParameter name="fill">#00FFFFFF</sld:CssParameter> </sld:Fill> <sld:Stroke> <sld:CssParameter name="stroke">#6a7c87</sld:CssParameter> <sld:CssParameter name="stroke-width">0.5</sld:CssParameter> <sld:CssParameter name="stroke-linejoin">round</sld:CssParameter> </sld:Stroke> here is the sld chunk for the polygon – lowsparked Jun 12 at 15:31
0

You will need to specify an opacity as a CssParameter

<sld:Fill> 
   <sld:CssParameter name="fill-opacity">0</sld:CssParameter>
</sld:Fill>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.