[Users] How Append Legend to each Layer?

Juan Martin cowaboonger at gmail.com
Fri Jan 20 09:53:33 CET 2012


Hello again,

As I just said on my last email, I managed to dinamically generate a
treeConfig var that describes the whole tree with parents and children but
doing in that way, I have lost a functionality I had when I wasn't
groupping the layers, that was appending the Legend to each layer when node
was created through the following function

createNode: function(attr) {
                    // add a WMS legend to each node created
                    attr.component = {
                        xtype: "gx_wmslegend",
                        layerRecord: mapPanel.layers.getByLayer(attr.layer),
                        showTitle: false,
                        // custom class for css positioning
                        // see tree-legend.html
                        cls: "legend"
                    }
                    return
GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);
                },

Any idea to append this after created?

Thank you very much indeed in advance.

Juan,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120120/76bd0627/attachment.htm 


More information about the Users mailing list