[Users] filter wms layers in legend
Bart van den Eijnden (OSGIS)
bartvde at osgis.nl
Fri Dec 17 12:39:00 CET 2010
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
>
More information about the Users
mailing list