[Users] problem using 'legendURL'

karsten vennemann karsten at terragis.net
Wed Nov 24 19:17:32 CET 2010


Ok changed but I still get a call to the wms layer for the legend instead of
the URL I provide see below. No errors otherwise...
I have no idea what’s going on 

I have this now 
        var legendLayerStore = mapPanel.layers;
        
        // set legendurls        
        var watershedsrec  = legendLayerStore.getByLayer(watersheds);
        watershedsrec.set("legendURL",
"http://myurl/legend/watersheds_legend.png");
        
        legendPanel = new GeoExt.LegendPanel({
            title: 'legend',
                collapsed : false,             
                collapsible : true,
                defaults: {
                labelCls: 'mylabel',
                style: 'padding:5px'
            },
            bodyStyle: 'padding:5px',
            autoScroll: true,
            layerStore: legendLayerStore
        })

Karsten 

 

> -----Original Message-----
> From: Bart van den Eijnden (OSGIS) [mailto:bartvde at osgis.nl] 
> Sent: Wednesday, November 24, 2010 04:29
> To: karsten vennemann
> Cc: users at geoext.org
> Subject: Re: [Users] problem using 'legendURL'
> 
> Hi,
> 
> you are creating a new store, don't do that.
> 
> Use mapPanel.layers instead.
> 
> Best regards,
> Bart
> 
> >
> > Thanks I upgraded to v 1.0 at that resolved the function issue.
> > Now I can see in firebug  that watershedsrec and publiclandsrec are 
> > filled with the layerrec objects ...
> >
> > However I still get a wms getlegendgraphic call to retrieve the the 
> > legend from my TileCache layer (which obviously doesn't get a valid 
> > legend back) So is the anything else wrong with by approach - see 
> > below
> >
> >
> >         var legendLayerStore = new GeoExt.data.LayerStore({
> >             map: map,
> >             layers: [publiclands,watersheds,quads,counties,overlay1]
> >         });
> >
> >         // set legendurls
> >         var watershedsrec  = 
> legendLayerStore.getByLayer(watersheds);
> >         var publiclandsrec = 
> legendLayerStore.getByLayer(publiclands);
> >
> >         watershedsrec.set("legendURL", 
> > "http://myurl/legend/watersheds_legend.png");
> >         publiclandsrec.set("legendURL",
> > "http://myurl/legend/publiclands_legend.png")
> >
> > Karsten
> >
> > _______________________________________________
> > Users mailing list
> > Users at geoext.org
> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
> >
> 
> 



More information about the Users mailing list