[Users] adding legendURL, legend tree

karsten karsten at terragis.net
Sat May 12 02:22:08 CEST 2012


In a Ext.tree.TreePanel I am grouping layers as below. When the layer is a
tiled (tile cache layer) I would like to use an alternate image for the
legend to still show up 
so I wanted to use legendURL for the legend image
 
// add legend images for tiled layers        
var regierungsbezirke_rec  =
mapPanel.layers.getByLayer(regierungsbezirke_tile);
regierungsbezirke_rec.set("legendURL",
"http://vfsviewer.vfs-muenchen.de/legend/regierungsbezirke.gif");
 
However i could not get it show up in geoext 1.1 in the tree yet -  any
hints what I am doing wrong ?
Karsten
 
// in layer tree
...
{nodeType: "gx_layercontainer",
    text: 'Kartendaten',
    layerStore: mapPanel.layers,
    expanded: false,
    loader: {
        filter: function(record) {  
           return record.get("layer").group == "Kartendaten";// this.group; 
        },
        baseAttrs: {
            uiProvider: "custom_ui"
        },
        createNode: function(attr) {
            // add a WMS legend to each node created
            if
(GeoExt.WMSLegend.supports(mapPanel.layers.getByLayer(attr.layer))){
               attr.component = {
                   xtype: "gx_wmslegend",
                   layerRecord: mapPanel.layers.getByLayer(attr.layer),
                   showTitle: false,
                   cls: "legend"
               };
            }   
            return GeoExt.tree.LayerLoader.prototype.createNode.call(this,
attr);
        }
    }    
}
...




=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 9.0.0.888, Virus/Spyware Database: 6.19640)
http://www.pctools.com/
=======
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120511/53081c87/attachment.htm 


More information about the Users mailing list