[Users] UrlLegend
florent.gravin at bluecham.net
florent.gravin at bluecham.net
Thu May 6 15:31:10 CEST 2010
Bart,
actually, the legend could update sure, but cannot change its type.
in the geoext example, layerRec0.set("legendURL", otherUrl) works only
because the "legendURL" is set once BEFORE the legendPanel is created. So,
on creation, legendPanel knows it's an UrlLegend, creates it as so, and
then we could update the url.
this is a perfect example, i tried on this example to comment the
layerRec0.set("legendURL", otherUrl) before the creation of the
legendPanel. Then, on creation of the legendPanel, it finds it's a
WMSLegend, it creates as so, and after that, the updateLegendUrl() no more
works, and layerRec0.set("legendURL", otherUrl) have no effect...
that is the point, we have to specify we want a url legend before the
legendPanel is created, otherwise it's created as WmsLegend and no way to
change it after...
do you understand the trouble ?
thks for your help
> The sequence should not matter, an event will be fired and the legend
> should update.
>
> See also the legendpanel example:
>
> layerRec0.set("legendURL", otherUrl)
>
> the legend image changes in this case.
>
> Otherwise, please show us a minimal example which we can use to reproduce.
>
> Best regards,
> Bart
>
More information about the Users
mailing list