In adddition to what Ian and Ryan already said, you can also set your
opacity level later on in your application.
For example,  if you decide  to add a slider control for example, by
using the setOpacity call  for a layer:

map.layers[1].setOpacity(0.3) //float b/n 0 and 1

Alex



On Wed, Feb 9, 2011 at 11:22 AM, Ryan Williams
<[email protected]> wrote:
> Robert,
>
> Without seeing a code example, my first guess is that the opacity option
> isn't in the right place in the Layer constructor.
> Initial layer opacity gets set in the 'Options' section when you construct
> the OpenLayers.Layer
> Here's an example creating a layer from a WMS:
>
> var layer_name = new OpenLayers.Layer.WMS(
>                 "Layer name here",
>                 "/geoserver/ows",
>                 {
>                    layers: 'public:roads',
>                    srs: 'EPSG:4326',
>                    format: 'image/png',
>                    transparent: true
>                 },
>                 {
>                     opacity: 0.8,
>                     isBaseLayer: false,
>                     visibility:true
>                 }
>             );
>
> Note that the 'opacity' setting is in the second set of 'squiggly brackets'
> {} (this is where options are set). I think lots of people get confused as
> to where to put settings/options like this.
>
> Ryan
>
>
> On 2/9/2011 11:45 AM, Robert Hunte wrote:
>
> I am attempting to create a map which shows a satellite image over a
> basemap.  The problem is that the satellite image is too opaque such that
> the basemap isn’t visible.  I’ve tried setting opacity to some small amount
> but have not seen any affect.
>
>
>
>
>
> Robert Hunte
>
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> --
> Ryan Williams, GISP
> GIS Analyst / Programmer
> PAQ Interactive Inc.
> Monticello, IL
> www.paqinteractive.com
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to