[OpenLayers-Users] layers not transparent

Richard Greenwood richard.greenwood at gmail.com
Sun May 27 19:28:53 EDT 2007


On 5/27/07, bradleyspencer <brad at cubewerx.com.au> wrote:
> Richard,
>
> Have you tried Opacity: 0.5 in the options part of the layer def?
>
> Cheers,
>
> Brad....

Brad, Christian;

Thanks, but that forced it back to a "base layer".  I looked at ticket
6678 as Christian suggested, but I'm not sure I followed it exactly.
In my Apache logs, "true" is lowercase for the transparency. Is it
supposed to be uppercase? I doubt it, because all the example apps
seem to work correctly.

I tested on my Mac with a recent nightly build of MapServer "4.99" and
the problem is the same. I must be missing something. I've included
more of my app below in case something jumps out at anybody. (I'm only
on my 2nd day w/ OL, so mistakes are plentiful).

Thanks,
Rich



var map = new OpenLayers.Map("map",
            {maxExtent: new OpenLayers.Bounds(-111.2, 40.95, -103.9, 45.01),
                maxResolution: "auto", units: 'degrees', projection:
"EPSG:4326"});

var countiesLayer = new OpenLayers.Layer.MapServer.Untiled( "Wyoming
Counties",
"http://lucca:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/OpenLayers/rwg/wwdc/wwdc.map",
{layers: 'county'}, {isBaseLayer: true});

var irrigationLayer = new OpenLayers.Layer.MapServer.Untiled( "Irrigated Land",
"http://lucca:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/OpenLayers/rwg/wwdc/wwdc.map",
{layers: 'irrigatedland',transparent: "true", format: "image/png"}

var podLayer = new OpenLayers.Layer.MapServer.Untiled( "Points of Diversion",
"http://lucca:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/OpenLayers/rwg/wwdc/wwdc.map",
{layers:'pod'}, {isBaseLayer: false }, {Opacity: 0.5}  );

map.addLayers([countiesLayer,irrigationLayer,podLayer]);



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Users mailing list