<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Karsten,<div><br></div><div>WMSLegend does not listen to LegendURL, only UrlLegend does.</div><div><br></div><div>Feel free to open up a github ticket, and patches welcome as always (should be an easy patch). Something like (not tested):</div><div><br></div><div><div> getLegendUrl: function(layerName, layerNames) {</div><div> var rec = this.layerRecord;</div></div><div> if (rec.get("legendURL") != null) {</div><div> return rec.get("legendURL");</div><div> } else {</div><div> … continue as we do now</div><div><br></div><div>Best regards,</div><div>Bart</div><div><br><div apple-content-edited="true">
<div>-- <br>Bart van den Eijnden<br>OpenGeo - <a href="http://opengeo.org/">http://opengeo.org</a><br>Expert service straight from the developers.</div><div><br></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On May 12, 2012, at 2:22 AM, karsten wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=us-ascii" http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 9.00.8112.16440">
<div>
<div><font size="2" face="Arial"><span class="014061700-12052012">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 </span></font></div>
<div><font size="2" face="Arial"><span class="014061700-12052012">so I wanted to use
legendURL for the legend image</span></font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">// add legend images for tiled
layers <br> var
regierungsbezirke_rec =
mapPanel.layers.getByLayer(regierungsbezirke_tile);<br>regierungsbezirke_rec.set("legendURL",
"<a href="http://vfsviewer.vfs-muenchen.de/legend/regierungsbezirke.gif">http://vfsviewer.vfs-muenchen.de/legend/regierungsbezirke.gif</a>");</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><span class="014061700-12052012"><font size="2" face="Arial">However i could not
get it show up in geoext 1.1 in the tree yet - any hints what I am
doing wrong ?</font></span></div>
<div><font size="2" face="Arial"><span class="014061700-12052012">Karsten</span></font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"><span class="014061700-12052012">// in layer
tree</span></font></div>
<div><font size="2" face="Arial"><span class="014061700-12052012">...</span></font></div>
<div><font size="2" face="Arial">{nodeType:
"gx_layercontainer",<br> text:
'Kartendaten',<br> layerStore:
mapPanel.layers,<br> expanded: false,<br>
loader: {<br> filter: function(record)
{ <br> return
record.get("layer").group == "Kartendaten";// this.group;
<br>
},<br> baseAttrs:
{<br>
uiProvider: "custom_ui"<br>
},<br> createNode: function(attr)
{<br> // add a
WMS legend to each node
created<br> if
(GeoExt.WMSLegend.supports(mapPanel.layers.getByLayer(attr.layer))){<br>
attr.component =
{<br>
xtype:
"gx_wmslegend",<br>
layerRecord:
mapPanel.layers.getByLayer(attr.layer),<br>
showTitle:
false,<br>
cls:
"legend"<br>
};<br>
}
<br> return
GeoExt.tree.LayerLoader.prototype.createNode.call(this,
attr);<br> }<br>
} <br>}</font></div>
<div><font size="2" face="Arial"><span class="014061700-12052012">...</span></font></div><br><br><br><br><font face="Tahoma" size="2"><br>=======<br>Email scanned by PC Tools - No viruses or spyware found.<br>(Email Guard: 9.0.0.888, Virus/Spyware Database: 6.19640)<br><a href="http://www.pctools.com/?cclick=EmailFooterClean_51">http://www.pctools.com</a><br>=======</font>
</div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@geoext.org">Users@geoext.org</a><br>http://www.geoext.org/cgi-bin/mailman/listinfo/users<br></blockquote></div><br></div></body></html>