[Users] Using LegendPanel with Tilecache...

Ryan Williams rwilliams at paqinteractive.com
Wed May 12 18:30:14 CEST 2010


Paul,
we had a similar problem using GeoWebCache. You need to define a url 
where the legend can be found at. in the example below we put a 
GetLegendGraphic request to the WMS layer in as the URL.

     Here's the workaround I posted a while back:
  This is relevant when using the GeoWebCache that is built-in to 
GeoServer 2.0.1, and the GeoExt legendPanel. It might be relevant in 
other situations as well.

Use the mapPanel.layers.layer Set legendURL method to manually define 
the wms getLegendGraphic parameter

I found the example at 
http://dev.geoext.org/trunk/geoext/examples/legendpanel.js

here's a snippet of my code:
//
var LayerRec = mapPanel.layers.getAt(3);
             
LayerRec.set("legendURL","http://something.com/geoserver/wms?FORMAT=image/gif&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application/vnd.ogc.se_xml&LAYER=medford:schools");

//
I'm manually setting the index in "getAt(3)" to the 4th layer added to 
my map. I haven't learned the proper syntax yet to get that index using 
layer name, but I'm sure it can be done; just need to study more.

Ryan

On 5/12/2010 11:10 AM, Paul james wrote:
> Thanks...
> Is there any config to set tilecache off to legend?
>
> Paul
>
> On Wed, May 12, 2010 at 1:03 PM, Christopher Schmidt 
> <crschmidt at crschmidt.net <mailto:crschmidt at crschmidt.net>> wrote:
>
>     On Wed, May 12, 2010 at 12:52:47PM -0300, Paul james wrote:
>     > Hello guys...
>     >
>     > Without Tilecache the LegendPanel works fine, but using the
>     image doesnt
>     > appear...
>     > Any ideia?
>
>     TileCache doesn't do legend graphics, so if you're trying to talk
>     to TileCache to request an image other than a tile, you're going to
>     be out of luck.
>
>     Regards,
>     --
>     Christopher Schmidt
>     Web Developer
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>    

-- 
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
rwilliams at paqinteractive.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100512/9807f420/attachment.htm 


More information about the Users mailing list