[Users] Layer unvisible in LayerTree

Jacinto Estima jacinto.estima at gmail.com
Mon Jul 2 08:36:57 CEST 2012


Hi folks!

 

I coded a tree using the following code. The tree is working, but I want the
Layers under 2008 and 2009 nodes to be "unvisible". The "checked: false"
property is working but only for the tree because the layers appear
activated in the map. Is there any property to make layers invisible in the
map?

 

Thanks,

Jacinto

 

layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({

              text: "2010",

              layerStore: mapPanel.layers,

              expanded: true,

              enableDD: true,

              loader: {

                     filter: function(record) {

            return record.get("layer").name.indexOf("2010") !== -1;

        }},

       }));

       

       layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({

              text: "2009",

              layerStore: mapPanel.layers,

              expanded: true,

              enableDD: true,

              loader: {

                     filter: function(record) {

            return record.get("layer").name.indexOf("2009") !== -1;

              },

              baseAttrs: {

//            checked: false,

//            visible: false,

        }},

       }));

       

       layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({

              text: "2008",

              layerStore: mapPanel.layers,

              expanded: true,

              enableDD: true,

              loader: {

                     filter: function(record) {

            return record.get("layer").name.indexOf("2008") !== -1;

            console.log(record);

        },

              baseAttrs: {

              checked: false,

//            visible: false,

        }},

       }));

              

       var LayerTree = new Ext.tree.TreePanel({

//            title: 'Map Layers',

              renderTo: 'layers',

              root: layerRoot,

       });

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120702/2f5901a4/attachment.html 


More information about the Users mailing list