[Users] Using LegendPanel with Tilecache...
Paul james
pauljame at gmail.com
Wed May 12 19:13:53 CEST 2010
Thanks Ryan...
But I found other solution...
I edited the setUrl method from LegendImage.Js...
Before
setUrl: function(url) {
this.url = url;
var el = this.getEl();
if (el) {
el.un("error", this.onImageLoadError, this);
el.on("error", this.onImageLoadError, this, {single: true});
el.dom.src = url;
}
},
My modification
setUrl: function(url) {
this.url = url.replace("tilecache.py?","
http://localhost/cgi-bin/mapserv.exe?map=Map.map&");
var el = this.getEl();
if (el) {
el.un("error", this.onImageLoadError, this);
el.on("error", this.onImageLoadError, this, {single: true});
el.dom.src = this.url;
}
},
Worked fine!
Thanks
On Wed, May 12, 2010 at 1:30 PM, Ryan Williams <rwilliams at paqinteractive.com
> wrote:
> 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"<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> 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 listUsers at geoext.orghttp://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-2794rwilliams at paqinteractive.com
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100512/15540bb1/attachment.htm
More information about the Users
mailing list