[OpenLayers-Users] TURN On layers Individually...

Paul james pauljame at gmail.com
Wed Jul 1 15:19:10 EDT 2009


I´m trying to do something like that :
http://demo.mapfish.org/mapfishsample/1.1/examples/tree/tree_automatic.html

There is a layer :

c2cwmsLayers = ['parkings', 'summits', 'refuges', 'sites'];
    c2cwms = new OpenLayers.Layer.WMS("C2C Objects",
        "http://demo.mapfish.org/mapfishsample/1.1/wms?",
        {
            singleTile: true,
            layers: c2cwmsLayers,
            format: 'image/png',
            transparent: true
        }
    );

But using the treeview I can turn on/off : 'parkings', 'summits', 'refuges',
'sites' Individually...

Paul



On Wed, Jul 1, 2009 at 4:12 PM, Christopher Schmidt <crschmidt at metacarta.com
> wrote:

> On Wed, Jul 01, 2009 at 04:08:50PM -0300, Paul james wrote:
> > Hello guys...
> >
> > I have that layer on Openlayers :
> >
> >       var _layer = new OpenLayers.Layer.MapServer(
> >        "PointLayer",
> >        _cgi,
> >        {
> >            map: _mapfile,
> >            singleTile: true,
> >             layers: ['Layer1', 'Layer2', 'Layer3'],
> >            transparent: "true",
> >            format: "image/png"
> >        },
> >     );
> >
> > If I use setVisibility on PointLayer, Layer1, 2 and 3 are turned ON...
> > How Can I turn on/off Layer1,Layer2,Layer3 individually on javascript?
>
> Create three different layers?
>
> (You can probably also use mergeNewParams, but that's not OL
> functioality for turning things 'on/off'.)
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090701/b6ee7fa7/attachment.html


More information about the Users mailing list