[Users] Legend Panel Does Not Display Icons for Cached Layers

Andreas Hocevar ahocevar at opengeo.org
Mon Nov 8 08:40:43 CET 2010


Hi,

if your layer is an OpenLayers.WMS layer, GeoExt's LegendPanel will use a WMSLegend and issue a GetLegendGraphic request.

If your layer record was copied from a WMSCapabilities store, and the Capabilities document includes a URI for GetLegendGraphic, it will be used. Otherwise the GetLegendGraphic will be built using the URL of the layer, which will not work for GWC.

You can also create your layer records with a legendURL field. If found, a UrlLegend will be created instead of a WMSLegend, using that URL.

Hope this helps.

Regards,
Andreas.

On Nov 4, 2010, at 18:20 , IT Intern wrote:

> Hello GeoExt Users,
> 
> I've been playing with the ExtJS and GeoExt libraries for a bit and now have what I can call a map browser.  I was originally calling layers from the server and had their icons displaying in a GeoExt.LegendPanel.  Ever since I started using GeoWebCache to get my layers from a cache location, the LegendPanel does not display the icons.  I actually do not understand why this had any effect since my styles are still located in the same place as they were before.  If anyone can provide me with some insight, I'd be very greatful.  I have read that the LegendPanel pulls this from the WMS GetLegendGraphic parameter, but I do not have any idea where or how GeoExt.LegendPanel gets that info.  I've also seen some weird/dirty looking hack to override LegendPanel icons..but I couldn't make much sense of that either :-/
> 
> //This is the code to my legend panel and I am wondering if it is just a config option I am supposed to change/set?
> var legend = new GeoExt.LegendPanel({
>                 region: "east",
>                 title: "Legend",
>                 width: 200,
>                 autoScroll: true,
>                 layerStore: mapPanel.layers
>             });
> 
> Thank you for your time oh wise ones :),
> 
> elshae
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list