[OpenLayers-Users] WMS format image/gif and opacity from SLD

Andreas Hocevar ahocevar at opengeo.org
Sat Jan 9 02:55:19 EST 2010

Dragan Podvezanec wrote:
> Is it normal that opacity parameter from SLD is ignored while trying to use
> GIF image format (WMS layer from geoserver)?
> With PNG it works well, but PNG's are simply too large when having 20 or
> more WMS layers on the map.

Opacity in SLD requires Alpha transparency, which is only available for 
PNG. IIRC there are ways to have Alpha with 8-bit PNG, which would give 
you images with about the same size as GIF. Look in the docs of your WMS 
for details on how to configure that.

Another option would be to pack all your layers into one 
OpenLayers.Layer.WMS, instead of using separate ones. So let's say your 
WMS has layers called layer1, layer2 and layer3, then your WMS layer 
would look like this:

var layer = OpenLayers.Layer.WMS("my layers", "path/to/my/wms", {
    layers: ["layer1", "layer2", "layer3"]


Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

More information about the Users mailing list