[Users] Group Layer - Wrong node load order?

Andreas Hocevar ahocevar at opengeo.org
Thu Mar 24 11:19:10 CET 2011


Hi,

the reverse order is intentional. The layer tree in GeoExt is supposed to draw layers that are on the bottom of the layer stack on the bottom.

Patches for an option to specify the order are, of course, welcome.

Regards,
Andreas.

On Mar 16, 2011, at 05:42 , Tim Heuer wrote:

> Hi,
>  
> I’ve come across a potential problem in GeoExt.tree.LayerParamLoader :
> 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:
>  
>     addParamNode: function(paramItem, allParamItems, node) {
>         var child = this.createNode({
>             layer: node.layer,
>             param: this.param,
>             item: paramItem,
>             allItems: allParamItems,
>             delimiter: this.delimiter
>         });
>         var sibling = node.item(0);
>         if(sibling) {
>             node.insertBefore(child, sibling);
>         } else {
>             node.appendChild(child);
>         }
>     },
>  
> Why not:
>  
>     addParamNode: function(paramItem, allParamItems, node) {
>         var child = this.createNode({
>             layer: node.layer,
>             param: this.param,
>             item: paramItem,
>             allItems: allParamItems,
>             delimiter: this.delimiter
>         });
>         var sibling = node.item(0);
>         node.appendChild(child);
>     },
>  
> 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.
>  
> Cheers,
> Tim
> 
> Please consider the environment before printing this email
> 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.
> The views expressed in this email may not be those of Landcare Research New Zealand Limited.http://www.landcareresearch.co.nz
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list