[Users] UrlLegend

Florent Gravin florent.gravin at gmail.com
Tue May 11 15:32:19 CEST 2010


hi,

a way to solve the problem :

problem : if legendPanel is already created, we cannot add a layer to the 
map with a UrlLegend
cause : we have to put the param URLLegend to the layerRecord of the 
layerStore of the mapPanel, which is created after the layer is added (and 
after the layerLegend has been created with another format).

solution: inherit GeoExt.LayerLegend class the same way as GeoExt.UrlLegend 
but change the condition of matching type with something like :
GeoExt.InsideUrlLegend.supports = function(layerRecord) {
    return layerRecord.get("layer").insideLegendURL != null;
};

the matching param have to be set directly in the layer, that's the way it 
can be reconized on the creation of the layerLegend.
and on creation of the layer, before adding to map, add the new param :
myLayer.insideLegendURL = url;


flo 



More information about the Users mailing list