<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" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple id=MailContainerBody
name="Compose message area">
<div class=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Matt, Thank you for the detailed
answer. It will be looking at it, with some wrinkling of the brow, next week,
and will post my results.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<p class=MsoNormal><span style='color:#1F497D'>Ralph Dell, GISP<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>GIS Dept.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Catawba County, NC<o:p></o:p></span></p>
</div>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Matt Priour
[mailto:mpriour@kestrelcomputer.com] <br>
<b>Sent:</b> Friday, March 26, 2010 3:29 PM<br>
<b>To:</b> Ralph Dell; users@geoext.org<br>
<b>Subject:</b> Re: [Users] layer tree configuration question<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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.</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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.</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>You
have a few options:</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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).</span><span style='font-size:12.0pt;
font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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...)</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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.</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Matt
Priour</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Kestrel
Computer Consulting</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a
href="mailto:RDell@CatawbaCountyNC.gov" title="RDell@CatawbaCountyNC.gov">Ralph
Dell</a> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>Sent:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Friday, March 26,
2010 1:32 PM<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>To:</span></b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:users@geoext.org"
title="users@geoext.org">users@geoext.org</a> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal style='background:whitesmoke'><b><span style='font-size:
10.0pt;font-family:"Tahoma","sans-serif"'>Subject:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> [Users] layer tree
configuration question<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>
</div>
<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 class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>
<hr size=2 width="100%" align=center>
</span></div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>_______________________________________________<br>
Users mailing list<br>
Users@geoext.org<br>
http://www.geoext.org/cgi-bin/mailman/listinfo/users<o:p></o:p></span></p>
</div>
</body>
</html>