[Users] filter wms layers in legend

ivan marchesini ivan.marchesini at gmail.com
Fri Dec 17 15:14:08 CET 2010


Many thanks Bart,
in effect your filter is perfect at start...

the problem is that, as you suggested, it seems that the layers are not
added to the legend container when a new layer is swithced to
visibility: true.

should I create some event on map or someting similar to force the
legend to look for new visible layers ??

many many thanks

Ivan




Il giorno ven, 17/12/2010 alle 12.39 +0100, Bart van den Eijnden (OSGIS)
ha scritto:
> Hi,
> 
> you would do something like:
> 
> filter: function(record) {
>     return record.get('layer').visibility;
> }
> 
> However, I am not sure if layers will be added in the legend container
> when you change the visibility of the layer to true, you would need to
> test if this works okay or not.
> 
> Best regards,
> Bart
> 
> > Dear GeoExt users..
> > my GeoExt application use a GeoExt.LegendPanel object
> >
> > I have a lot of wms layers (67) added to the mapPanel.
> > only two of these layers has visibility: true.
> >
> > It happen that each time I load the webpage the legend panel start to
> > ask for the legend of each layer.
> >
> > that creates a lot of getLegend call towards the wms server which become
> > unstable...
> >
> > I would like to filter the layers to be displayed in the legendPanel by
> > means of the visibility property...
> >
> > in this way when I swich on another layer from the layers tree the
> > legendPanel should execute the getLegend call.
> >
> > it seem that using this filter inside the GeoExt legendPanel object is
> > not correct...
> >
> > filter: function(record) {
> > 		return mapPannel.map.getLayersBy('visibility',true)
> > 		}
> >
> > please give me some help...
> >
> > thanks
> >
> > Ivan
> >
> >
> >
> > --
> > Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
> > Preferisco formati liberi.
> > Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
> > I prefer free formats.
> > http://it.wikipedia.org/wiki/Formato_aperto
> > http://en.wikipedia.org/wiki/Open_format
> >
> > Ivan Marchesini
> > Perugia (Italy)
> > Socio fondatore GFOSS "Geospatial Free and Open Source Software"
> > http://www.gfoss.it
> > e-mail: marchesini at unipg.it
> >         ivan.marchesini at gmail.com
> > fax (home): +39(0)5782830887
> > jabber: geoivan73 at jabber.org
> > skype: geoivan73
> > _______________________________________________
> > Users mailing list
> > Users at geoext.org
> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
> >
> 
> 

-- 
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.
http://it.wikipedia.org/wiki/Formato_aperto
http://en.wikipedia.org/wiki/Open_format

Ivan Marchesini
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini at unipg.it
        ivan.marchesini at gmail.com
fax (home): +39(0)5782830887
jabber: geoivan73 at jabber.org
skype: geoivan73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio
 firmata digitalmente
Url : http://www.geoext.org/pipermail/users/attachments/20101217/1ad98588/attachment.pgp 


More information about the Users mailing list