[Users] LegendPanel fires GetLegendGraphic requests for invisible Layers

Just van den Broecke just at justobjects.nl
Thu May 24 10:56:01 CEST 2012


Hi,

I got much further in nailing down the issue: GeoExt will 
prefetch/preload Legends, WMS Legends via GetLegendGraphic, for all 
Layers where the "hideInLegend" record item is false/undefined, thus 
even if the Layer is not visible.

I have fixed this and made this behaviour configurable via a 
"prefetchLegends" property for my class that derives from GeoExt 
LegendPanel. Also "hideInLegend" gets set in a Layer record when set for 
a Layer.

See the code at:
http://code.google.com/p/geoext-viewer/source/browse/trunk/heron/lib/widgets/LayerLegendPanel.js 
(Heron MC is a framework on top of GeoExt). Maybe the fix can be cleaned 
some, but for now this works. If found useful I may add this fix/feature 
to GeoExt via GitHub pull.

best,

--Just
Just van den Broecke
The Netherlands
www.justobjects.nl



On 22-05-12 19:48, Just van den Broecke wrote:
> Hi,
>
> Another Legend issue, on GeoExt 1.1/OpenLayers 2.11:
>
> When I add a LegendPanel to a Container, GetLegendGraphic requests are
> issued for every WMS Layer, even if these Layers are initially
> invisible. Basically the same issue as described here:
> http://lists.osgeo.org/pipermail/geoprisma-dev/2010-October/000487.html
> For maps with many layers this gives quite some init delay.
>
> I would like to show/hide legends dynamically, only for Layers that
> become visible/invisible, possibly as a configurable option
> ("showVisibleLayersOnly") on LegendPanel. I could not find an open issue
> or maybe there is a workaround. Thanks for any suggestions. Best,
>
> --Just
>
> Just van den Broecke
> The Netherlands
> www.justobjects.nl
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>





More information about the Users mailing list