<div dir="ltr">Hi Chris,<div><br></div><div>Indeed :) I just missed it when looking at the API.</div><div>Thanks a lot!</div><div><br></div><div>Cheers,</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-29 12:06 GMT+00:00 Christian Mayer <span dir="ltr"><<a href="mailto:Christian.Mayer@isb-ag.de" target="_blank">Christian.Mayer@isb-ag.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a">Hi Hugo,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a">isn’t it the UrlLegend class [1] what you need?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a">Chris<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a">[1] <a href="http://geoext.github.io/geoext2/docs/#!/api/GeoExt.container.UrlLegend" target="_blank">http://geoext.github.io/geoext2/docs/#!/api/GeoExt.container.UrlLegend</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1b367a"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> users-bounces@</span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><a href="http://geoext.org" target="_blank">geoext.org</a>
[mailto:<a href="mailto:users-bounces@geoext.org" target="_blank">users-bounces@geoext.org</a>] <b>Im Auftrag von </b>Hugo<br>
<b>Gesendet:</b> Mittwoch, 29. Oktober 2014 11:49<br>
<b>An:</b> <a href="mailto:users@geoext.org" target="_blank">users@geoext.org</a><br>
<b>Betreff:</b> Re: [Users] Legend tree custom image URL<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi guys,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I've made a small change to the WmsLegend class and now it works perfectly.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I've just added the following code inside the getLegendUrl method (at line 145):<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">if (rec.get('legendURL') != ''){<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> url = rec.get('legendURL');<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">}<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Obviously this assumes that if legendURL is different than an empty strig, it will override the url returned by the styles definition.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2014-10-28 19:13 GMT+00:00 Hugo <<a href="mailto:hfpmartins@gmail.com" target="_blank">hfpmartins@gmail.com</a>>:<u></u><u></u></p>
<div>
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm building a tree panel similar to the example LegendTree. So far so good, I'm able to use gx_wmslegend ctype to show the legend below each node in the tree.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">However there is a case where i need to override the legendURL and point it to a specific image instead of using the default GetLegendGraphic.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have sucessfully implemented this override in a GeoExt.panel.Legend by "manually" seting the layer record legendurl field [eg: layerRec.set("legendURL", rec.data.legURL);]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">When trying the same approach on th gx_wmslegend it doesn't work. I was reading through the docs of this xtype and it states that <span style="font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#484848">the image can be read from
the styles field of a layer record</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">When looking at the layerModel i cannot see this field defined. So my question would be, where should i set this styles field? GeoExt layer record? Openlayers layer record? How would it look like?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks in advance.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span style="color:#888888">-- <br>
Hugo Martins<u></u><u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <br>
Hugo Martins<u></u><u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Hugo Martins<br>
</div>