<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6002.18167" name=GENERATOR>
<STYLE>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" vLink=purple
link=blue leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>I can tell you from a lot of trial & error,
that the 'children' property of any gx_layerXXX nodetype are not evaluated.
BaselayerContainer, OverlaylayerContainer, ParamLayer all use loaders to
populate their child node arrays. The best you can do with either of these 3
node types is to set a 'baseParams' property which will need get applied as part
of the node config for each of the child nodes created by the
loader.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If you use gx_layer as the nodetype, then the
childnodes do get evaluated. However, it also expects to find a layer property
on the node and a matching layer in the layer store. If either of these
conditions aren't met, errors will occur and your tree won't render or work
correctly.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>You have a few options:</FONT></DIV>
<DIV><FONT face=Arial size=2>1. Be highly specific for the layer nodes you want
to customize. Use 'async' & 'gx_layer' node types with the specific layer
& attributes you wish to represent. You can use a 'gx_layer' node type as a
group layer container node, but it must also have a matching layer in the layer
store (I've never tried a dummy layer here but it might also work).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>2. Use the 'gx_layerparam' or
'gx_overlaylayercontainer' node to create the tree and then modify the node ui
after creation. In other words, write a function to find the layer you are
interested in, access the associated node, access the node's nodeUI and change
properties there (such as the iconCls, etc...)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>3. I have created a custom node type
(gx_complexlayer) that has similar node construction logic as the 'gx_layer'
node type but doesn't expect a layer property and expects it's descendant nodes
(at some level) to have a layer property. This was useful to me as it can
contain both gx_layer nodes and other loader based nodes as well as using a
loader itself if configured to do so. I've made a ticket for this functionality
but not submitted a patch yet, because I 'haven't written test or an example for
this node type yet and it will fail in some corner cases. I have attached it as
a patch here if you want to use it with the understanding that it is certainly
incomplete.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>Kestrel Computer Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT><FONT
face=Arial></FONT><FONT face=Arial></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=RDell@CatawbaCountyNC.gov
href="mailto:RDell@CatawbaCountyNC.gov">Ralph Dell</A> </DIV>
<DIV><B>Sent:</B> Friday, March 26, 2010 1:32 PM</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] layer tree configuration question</DIV></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal>Thanks to the examples and previous forum posts I almost have
my layer tree looking exactly as I would like.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>What I haven’t been able to figure out is under a layer
check box, (in this case Schools), I would like to display icons and text that
would correspond to map symbology for different types of features in the
given layer. I do not get anything displayed under the check box and have
been unsuccessful in finding a solution.<o:p></o:p></P>
<P class=MsoNormal> Any pointers or examples on how to accomplish that
would be appreciated.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>I am pulling my layers from a group layer similar to Tasmania
( Group Layer) in the Tree Nodes example.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Here is my json:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>var treeConfig = new
OpenLayers.Format.JSON().write([<o:p></o:p></P>
<P class=MsoNormal> {<o:p></o:p></P>
<P class=MsoNormal> nodeType:
"gx_baselayercontainer",<o:p></o:p></P>
<P class=MsoNormal> layer: 'Layers',<o:p></o:p></P>
<P class=MsoNormal> isLeaf : false,<o:p></o:p></P>
<P class=MsoNormal> loader: {<o:p></o:p></P>
<P class=MsoNormal> param:
"LAYERS"<o:p></o:p></P>
<P class=MsoNormal> }<o:p></o:p></P>
<P class=MsoNormal> },{<o:p></o:p></P>
<P class=MsoNormal> text: 'School Layers',<o:p></o:p></P>
<P class=MsoNormal> expanded: true,<o:p></o:p></P>
<P class=MsoNormal> children: [{<o:p></o:p></P>
<P class=MsoNormal> nodeType: "gx_layerparam",<o:p></o:p></P>
<P class=MsoNormal> layer: 'Schools',<o:p></o:p></P>
<P class=MsoNormal> param: "LAYERS",<o:p></o:p></P>
<P class=MsoNormal> item: "catawba2:schools",<o:p></o:p></P>
<P class=MsoNormal> text: 'Schools',<o:p></o:p></P>
<P class=MsoNormal> expanded: true,<o:p></o:p></P>
<P class=MsoNormal> children:
[{
// under the Schools check box I want to display symbols and text that
correspond<o:p></o:p></P>
<P class=MsoNormal> text: 'Elementary
Schools',
// to the symbology that I use on the map<o:p></o:p></P>
<P class=MsoNormal> IconCls:
'cc_elem'
// nothing displays<o:p></o:p></P>
<P class=MsoNormal>
},{
// how can I add symbols and text here?<o:p></o:p></P>
<P class=MsoNormal> text: 'Middle School
Districts3',
// I don’t even know if using children: [{}] is the correct
approach.<o:p></o:p></P>
<P class=MsoNormal> iconCls: 'cc_middle'<o:p></o:p></P>
<P class=MsoNormal> }]<o:p></o:p></P>
<P class=MsoNormal>},{<o:p></o:p></P>
<P class=MsoNormal>nodeType: "gx_layerparam",<o:p></o:p></P>
<P class=MsoNormal>layer: 'Schools',<o:p></o:p></P>
<P class=MsoNormal>param: "LAYERS",<o:p></o:p></P>
<P class=MsoNormal>item: "catawba2:elementary_school_districts",<o:p></o:p></P>
<P class=MsoNormal>text: 'Elementary School Districts',<o:p></o:p></P>
<P class=MsoNormal>iconCls: 'cc_elem_line',<o:p></o:p></P>
<P class=MsoNormal>}]<o:p></o:p></P>
<P class=MsoNormal> }], true);<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P></DIV>
<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>