[mapserver-users] wms transparency

Jim White jbw2003 at earthlink.net
Tue Mar 8 13:14:50 EST 2011


Arlen,

Thanks that helped. However I had to explicitly set my layers to the 
same projection.

    // override default epsg code
     aliasproj = new OpenLayers.Projection("EPSG:3857");
     wms.projection = gphy.projection = aliasproj;

Your site looks nice. However, I can't read Dutch so I don't know what 
the layers mean.

Jim



On 03/07/2011 05:21 PM, Arlen Poort wrote:
> Jim,
>
> You might check the code of my page. This has a transparent mapserver
> wms. You can find the code here:
> mapserver.nrc-handelsblad.com/PS2011.html
>
> Best regards,
>
> Arlen Poort
>
> Op maandag 7 maart 2011 schreef Jim White (jbw2003 at earthlink.net) het volgende:
>> I have a MapServer WMS server and I want to overlay its layers on a Google map WMS layer in OpenLayers.
>> I have tried to follow the example http://openlayers.org/dev/examples/layer-opacity.html , but am unable to get any transparency. All I get is a less bright layer.
>>
>> var options2 = {
>>      maxExtent: new OpenLayers.Bounds(-7564972, 2022817, -7260079, 2099643),
>>      units: 'm',
>>      projection: "EPSG:3857",
>>      maxScale: 2000000
>> }
>> var map;
>> var wms;
>> var gphy;
>>
>>
>> $(document).ready(function() {
>>      map = new OpenLayers.Map('map', options2);
>>      wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
>>          "http://metacomet.zo.ncsu.edu/wms/prgap.php",
>>              {layers: 'pd009', format: "image/png", srs: "EPSG:3857"},
>>              { opacity: 0.3}
>>          );
>>
>>      gphy = new OpenLayers.Layer.Google(
>>          "Google Physical",
>>          {type: google.maps.MapTypeId.TERRAIN, //sphericalMercator: true,
>>              'maxExtent': new OpenLayers.Bounds(-7564972, 2022817, -7260079, 2099643)
>>          });
>>
>>      map.addLayer(wms);
>>      map.addLayer( gphy);
>>      map.zoomToMaxExtent();
>>
>> Wil appreciate any suggestions for my MapServer config or OpenLayers script.
>>
>> Jim
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>



More information about the mapserver-users mailing list