[Users] Grouping kml layers in a tree panel

Jason Woolard Jason.Woolard at noaa.gov
Mon Jul 26 17:12:28 CEST 2010


Thanks Andreas! That was exactly the problem.

For anyone else who might get stuck on a similar problem I updated the 
example posted previously.

Thanks again!

Andreas Hocevar wrote:
> 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
>>     
>
>
>
>   


More information about the Users mailing list