<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-15>
<META content="MSHTML 6.00.6002.18309" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" text=#333333
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial color=#000000 size=2>The most likely issue is that the
layer parameter is not quite right.</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>If you are referencing a the variable
name for layer then don't use quotes, if you are referencing the layer name then
do use quotes and make sure that capitalization is correct.</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>ex:</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>var wmsLayer = new
OpenLayers.Layer.WMS('wms',{layers:'layer1,layer2'},{buffer:0,isBaseLayer:false})</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>then using one of these
configurations will work</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>{nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>layer : wmsLayer}</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>{nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>layer : 'wms'}</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>these however will not </FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>{nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>layer : 'wmsLayer'}</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>{nodeType:'gx_layer',</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>layer : 'WMS'}</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>Kestrel Computer
Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial color=#000000></FONT><FONT face=Arial
color=#000000></FONT><FONT face=Arial color=#000000></FONT><FONT face=Arial
color=#000000></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=christian.gadge@ufz.de
href="mailto:christian.gadge@ufz.de">Christian Gadge</A> </DIV>
<DIV><B>Sent:</B> Monday, November 22, 2010 8:29 AM</DIV>
<DIV><B>To:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] children in layertree not visible</DIV></DIV></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT><FONT face=Arial color=#000000
size=2></FONT><FONT face=Arial color=#000000 size=2></FONT><FONT face=Arial
color=#000000 size=2></FONT><BR></DIV>Hi all,<BR><BR>until now I only used
OpenLayers and GeoExt with the experience gained from several tutoials ;)<BR>I
created MapPanels and LayerTrees like this...<BR><PRE><SPAN class=nx>root</SPAN><SPAN class=o>:</SPAN> <SPAN class=k>new</SPAN> <SPAN class=nx>GeoExt</SPAN><SPAN class=p>.</SPAN><SPAN class=nx>tree</SPAN><SPAN class=p>.</SPAN><SPAN class=nx>LayerContainer</SPAN><SPAN class=p>({</SPAN>
<SPAN class=nx>layerStore</SPAN><SPAN class=o>:</SPAN> <SPAN class=nx>mapPanel</SPAN><SPAN class=p>.</SPAN><SPAN class=nx>layers</SPAN><SPAN class=p>,</SPAN>
<SPAN class=nx>expanded</SPAN><SPAN class=o>:</SPAN> <SPAN class=kc>true</SPAN>
<SPAN class=p>}),
</SPAN></PRE><BR>Now I tried to define a customized layerlist with sublayers and
make them visible in map onClick:<BR><BR><PRE>var layerList =[{ </PRE><PRE> "text":"Land use",</PRE><PRE> "children":[{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"wms"</PRE><PRE> },{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"MAS"</PRE><PRE> },{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"MRS"</PRE><PRE> }] </PRE><PRE> },{</PRE><PRE> "text":"Air quality and health",</PRE><PRE> "children":[{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"wms2"</PRE><PRE> },{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"GMAS"</PRE><PRE> },{</PRE><PRE> "nodeType":"gx_layer",</PRE><PRE> "layer":"MRS"</PRE><PRE> }] </PRE><PRE> }] ;
var tree = new Ext.tree.TreePanel({
                region:                'west',
                title:                 "Layers",
                width:                 200,
                autoScroll:         true,
                enableDD:         true,
                lines:                 false,        
        loader:         new Ext.tree.TreeLoader({
                                applyLoader: false
                        }),
        root:                 {
                                        children: layerList
                                 },
        rootVisible:         true
                });
</PRE>But only <I>root</I> and the first node are visible in LayerTree. The
nodes are not expandable. <BR>What is missing in this definition?<BR><BR>The
error message in Firebug shows:<BR><SPAN
class="objectBox objectBox-errorMessage hasBreakSwitch "
role="presentation">this.node.layer.getVisibility is not a
function</SPAN><BR><BR><BR>Best regards,<BR>Christian<BR><PRE class=moz-signature cols="72"></PRE>
<P>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></BODY></HTML>