3

There are four parameters for WMS Layers: Name, URL, Server Side Params, OpenLayers Options. Transparent Parameter comes under Server Side Params.

Does it mean that transparent images are pre-cached in the GeoServer and return to browser on request. Can transparency be a OpenLayers Property too?

Where can I see all possible server side parameters in OpenLayers?

1 Answer 1

4

When you are dealing with WMS services, you need to pass it certain parameters in the GetMap request. with Openlayers, you usually pass it to the params object.

The WMS class Documentation says:

Properties added to this object will be added to the WMS GetMap requests used for this layer’s tiles. The only mandatory parameter is “layers”. Other common WMS params include “transparent”, “styles” and “format”.

So if you pass transparent:true parameter to your layer, it actually passes the parameter to the WMS server, which returns transparent PNG Tiles.

I have also tested sending different parameters like sld and bgcolor for my Geoserver, since these parameters are used by the WMS GetMap request.

2
  • can I use only format/png property without mentioning transparent:true?
    – GP92
    Commented Feb 23, 2013 at 10:24
  • 1
    Yes; You can do so by using format:'image/png' Commented Feb 23, 2013 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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