[OpenLayers-Users] WMS layers: overlay between them

Ian Turton ijturton at gmail.com
Thu Feb 7 02:56:10 PST 2013


You need to pass the transparent=true to the wms by placing it in the first
part of the constructor instead of the second so something like:

var wms1 = new OpenLayers.Layer.WMS(
    layername,
    wmsname, {
        layers: layername,
        styles: 'Default',
        transparent: true,
        format: "image/png",
        version: '1.3.0'
    }, {
        wrapDateLine: true,
        opacity: opacitywms1,
        transitionEffect: 'resize'
    });

Ian


On 7 February 2013 09:49, pascal <pascal2833 at gmail.com> wrote:

> Hi,
>
> I try to overlay wms layers which have continental data to wms layers which
> have coastal data. The problem is that where they don't have to have data
> (for example in the sea for continental wms), they are white and if the
> opacity of continental and coastal wms is 1, we can't superpose them.
> I set these 2 wms to transparent, like that :
>
> var wms1 = new OpenLayers.Layer.WMS(
>     layername,
>     wmsname, {
>         layers: layername,
>         version: '1.3.0'
>     }, {
>         styles: 'Default',
>         format: "image/png",
>         transparent: true,
>         wrapDateLine: true,
>         opacity: opacitywms1,
>         transitionEffect: 'resize'
>     });
>
>  What's wrong? I have to change the style/server and to create a style in
> which parts without data can be transparent ? Or i can do it in the client
> part?
>
> Thanks a lot,
>
> Pascal.
>
>
>
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/WMS-layers-overlay-between-them-tp5032734.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Ian Turton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130207/c1c9e442/attachment-0001.html>


More information about the Users mailing list