[Users] Grouping kml layers in a tree panel

Andreas Hocevar ahocevar at opengeo.org
Mon Jul 26 14:37:37 CEST 2010


Hi,

your treeConfig is generated with new OpenLayers.Format.JSON().write(). You have to create the configuration directly, otherwise you will lose all functions that you configure. Your tree configuration should look like

var treeConfig = {
    ...
}; 

instead of

var treeConfig = new OpenLayers.Format.JSON().write([{
    ...
}]);

And in your treepanel config, instead of providing

    children: Ext.decode(treeConfig)

you have to provide

    children: treeConfig

Regards,
Andreas.

On Jul 25, 2010, at 21:07 , Jason Woolard wrote:

> hi all,
> 
> I'm fairly new to JS and brand new to GeoExt. I've been teaching myself 
> from some of the excellent examples in the tutorial.
> 
> I've have a tree panel with two groups (with plans for more once it's 
> working). I'd like to display the G1 layers under Group1 and the G2 
> layers under G2, etc. The problem is all of the layers appear under each 
> group. Reading other posts it seems the filter function is the way to 
> accomplish separating out the layers but I've been unable to get it 
> working. Am I on the wrong track here?
> 
> the map can be viewed here:
> http://ngs.woc.noaa.gov/storms/nov09_ne/ge/2010dev/index6.html
> 
> the js here:
> http://ngs.woc.noaa.gov/storms/nov09_ne/ge/2010dev/tree6.js
> 
> Much thanks for any advice.
> 
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list