[Users] Layer group with legend

Phil Scadden p.scadden at gns.cri.nz
Tue Oct 19 22:36:15 CEST 2010


>> Do you have any example to share ?
>
My code - When I create a layer, I add a property called group to it.
(layer.group = 'this group';)

The groups is array with my list of groups and I do this:

             for (i = 0; i < groups.length;i++){
                 layercontainers[i] = {
                     nodeType: "gx_layercontainer",
                     text:groups[i],
                     layerStore: mapPanel.layers,
                     leaf:false,
                     expanded:true,
                     loader:{
                         group: groups[i],
                         filter:function(record){
                             return record.get("layer").group == this.group;
                         }
                     }
                 };
             }
             tree.setRootNode({
                 children: layercontainers
             });
-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Users mailing list