<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)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0cm;
        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 WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve come across a potential problem in GeoExt.tree.LayerParamLoader :<o:p></o:p></p>
<p class="MsoNormal">When loading a group layer with parameter CLASS and you have an ascending order of classes, it displays them in opposite order, so one has to turn it around. I looked into the source code and found this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> addParamNode: function(paramItem, allParamItems, node) {<o:p></o:p></p>
<p class="MsoNormal"> var child = this.createNode({<o:p></o:p></p>
<p class="MsoNormal"> layer: node.layer,<o:p></o:p></p>
<p class="MsoNormal"> param: this.param,<o:p></o:p></p>
<p class="MsoNormal"> item: paramItem,<o:p></o:p></p>
<p class="MsoNormal"> allItems: allParamItems,<o:p></o:p></p>
<p class="MsoNormal"> delimiter: this.delimiter<o:p></o:p></p>
<p class="MsoNormal"> });<o:p></o:p></p>
<p class="MsoNormal"> var sibling = node.item(0);<o:p></o:p></p>
<p class="MsoNormal"> if(sibling) {<o:p></o:p></p>
<p class="MsoNormal"> node.insertBefore(child, sibling);<o:p></o:p></p>
<p class="MsoNormal"> } else {<o:p></o:p></p>
<p class="MsoNormal"> node.appendChild(child);<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal"> },<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Why not:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> addParamNode: function(paramItem, allParamItems, node) {<o:p></o:p></p>
<p class="MsoNormal"> var child = this.createNode({<o:p></o:p></p>
<p class="MsoNormal"> layer: node.layer,<o:p></o:p></p>
<p class="MsoNormal"> param: this.param,<o:p></o:p></p>
<p class="MsoNormal"> item: paramItem,<o:p></o:p></p>
<p class="MsoNormal"> allItems: allParamItems,<o:p></o:p></p>
<p class="MsoNormal"> delimiter: this.delimiter<o:p></o:p></p>
<p class="MsoNormal"> });<o:p></o:p></p>
<p class="MsoNormal"> var sibling = node.item(0);<o:p></o:p></p>
<p class="MsoNormal"> node.appendChild(child);<o:p></o:p></p>
<p class="MsoNormal"> },<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Which seems to work fine for me with a group layer. While I’m at it: I’m writing a class called GroupLayerNode and was thinking of contributing it to GeoExt, since I saw other people having this issue. My current implementation loads each
class as a separate layer. Although this is more overhead when all layers are turned on, it seems more usable since when you turn off a class it does not reload. I also put in there some logic to show a legend icon next to the node in the tree. Please let
me know if you would like the source code of this class.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">Tim<o:p></o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Green" size="1">Please consider the environment before printing this email<br>
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.<br>
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz<br>
</font>
</body>
</html>