[Users] LegendPanel fires GetLegendGraphic requests for invisible Layers

Thomas Colley it087 at neath-porttalbot.gov.uk
Thu Jun 7 13:10:09 CEST 2012


Hi Just

I have looked at applying your modifications to GeoExt but have not
managed it.

Are you planning to add it to the GeoExt GitHub and if not could you
possibly help with the code that needs to be altered in LegendPanel.js?

Many thanks

Tom

-----Original Message-----
From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On
Behalf Of Just van den Broecke
Sent: 24 May 2012 09:56
To: users at geoext.org
Subject: Re: [Users] LegendPanel fires GetLegendGraphic requests for
invisible Layers

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/wid
gets/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.htm
> l 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
>



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




More information about the Users mailing list