[Users] efficient way to group overlay layers in tree node

karsten vennemann karsten at terragis.net
Wed Mar 14 11:55:10 CET 2012


Hi All,

 

Using geoext 1.1, what is the best way to filter (or create) a Tree node
with non-baselayers ("overlay") GIS layers and group them ?

 

I have this node but am failing to only show non-baselayers . I even
manually created a two stores store that holds the list of layers I would
like to have in a tree node 

 

        var kartendaten_layer = new Array();   

        kartendaten_layer =
[hintergrund,emptylayer,maske,waldbesitzer,waldbesitzer_jahr,waldbesitzer_ti
le,gemeinde_tile,landkreise_tile,regierungsbezirke_tile,flkgrenzenbayern_til
e,annotation];

        

        var schutzgebiete_layer = new Array();   

        schutzgebiete_layer =
[nationalparke,vogelschutzgebiete,naturparke,landschaftsschutzgebiete,biosph
aerenreservate,naturschutzgebiete,ffh_gebiete,ramsar_gebiete];

        

           

        var kartendaten_layerstore = new GeoExt.data.LayerStore({

            map: map,

            layers: kartendaten_layer

        });

        var schutzgebiete_layerstore = new GeoExt.data.LayerStore({

            map: map,

            layers: schutzgebiete_layer

        });

 

but I still get either the base layers also listed in the node when using
gx_layercontainer (see below, and could not cerate a correct filter get rid
of base layers see the ??? below)

how could I filter out baselayer e.g. ? Or even use my layer.options.Group
?

 

or strangely it is not honoring my list of layers and show all overlay layer
when using gx_overlaylayercontainer 

.

{nodeType: "gx_layercontainer",

                                      text: 'Kartendaten',

                                      layerStore: kartendaten_layerstore, //
mapPanel.layers,

                                      expanded: true,

                                      loader: {

                                                 filter: function(record) {

                                                    ???

                                            },

                                          baseAttrs: {

                                              uiProvider: "custom_ui"

                                          },

                                          createNode: function(attr) {

                                              if
(GeoExt.WMSLegend.supports(mapPanel.layers.getByLayer(attr.layer))){

                                                 attr.component = {

                                                     xtype: "gx_wmslegend",

                                                     layerRecord:
mapPanel.layers.getByLayer(attr.layer),

                                                     showTitle: false,

                                                     cls: "legend"

                                                 };

                                              }   

                                              return
GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);

                                          }

                                      }    

                                }, .

 

Any suggestions how to make this work ?

Cheers

Karsten

 

Karsten Vennemann

 

Terra GIS Ltd

2119 Boyer Ave E

Seattle, WA 98112

USA

tel ++ 206 905 1711

fax ++ 925 905 1711

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120314/3ce30c56/attachment-0001.htm 


More information about the Users mailing list