Hi guys,

I've made a small change to the WmsLegend class and now it works perfectly.
I've just added the following code inside the getLegendUrl method (at line
145):

if (rec.get('legendURL') != ''){
     url = rec.get('legendURL');
}

Obviously this assumes that if legendURL is different than an empty strig,
it will override the url returned by the styles definition.

Cheers,


2014-10-28 19:13 GMT+00:00 Hugo <hfpmart...@gmail.com>:

> Hi all,
>
> 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.
> 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.
>
> 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);]
>
> 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 the image can
> be read from the styles field of a layer record
>
> 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?
>
> Thanks in advance.
> Cheers,
>
>
> --
> Hugo Martins
>



-- 
Hugo Martins
_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to