When you are working with many layers—both raster and vector layers—you will probably find situations where a layer that is on top of another layer hides the one below it. This is more common when working with raster WMS layers without the transparent
property set to true
or tiled layers such as, OpenStreetMaps, Google, and Bing. The layer opacity is set to 50% in the following screenshot:
The OpenLayers.Layer
base class has an opacity
property, implemented by concrete subclasses, that allows us to modify the opacity of the layers. It is a float value that can range from 0.0
(completely transparent) to 1.0
(completely opaque).