[Users] GeoExt Legend Tree , child node expanded

Andreas Hocevar ahocevar at opengeo.org
Tue May 22 09:55:04 CEST 2012


Hi,

the way the LayerLegend components work, you cannot have them visible
when a layer is unchecked. This would require a new option on the
LayerLegend to tell it not to sync its visibility with the layer's
visibility.

Andreas.

On Tue, May 22, 2012 at 8:58 AM, karsten <karsten at terragis.net> wrote:
> Hi all,
>
> below I have a Ext.tree.TreePanel with legend in child nodes (code below). I
> m trying to have all legend image snot expanded (shown) when the layers is
> not checked on initial loading of the map e.g. but I could not figure out
> how to achieve this. So far I tried to put
> expanded: false,
> all over the place to no avail.
> Any hints how I can get this working ?
>
> Cheers
> Karsten
> ...
> {nodeType: "gx_layercontainer",
>         text: 'Kartendaten',
>         layerStore: mapPanel.layers,
>         expanded: false,
>         loader: {
>             filter: function(record) {
>                return record.get("layer").group == "Kartendaten";//
> this.group;
>             },
>             baseAttrs: {
>                 uiProvider: "custom_ui",
>             },
>             createNode: function(attr) {
>                  // add a WMS legend to each node created
>                  if(attr.layer instanceof OpenLayers.Layer.WMS &&
>                     attr.layer.url.indexOf('tilecache') > 0) {
>                      attr.component = {
>                          xtype: "gx_legendimage",
>                          url:
> "/proxy/gotomaplegend.cgi?TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&FORMAT=image%2Fgif&LAYER="+attr.layer.params.LAYERS.substr(7),
>                          cls: "legend",
>                      };
>                  } else {
>                      attr.component = {
>                          xtype: "gx_wmslegend",
>                          layerRecord:
> mapPanel.layers.getByLayer(attr.layer),
>                          showTitle: false,
>                          cls: "legend",
>                      };
>                  }
>                  return
> GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);
>             }
>         }
>     }
> ...
>
>
>
>
>
>
>
>
>
> =======
> Email scanned by PC Tools - No viruses or spyware found.
> (Email Guard: 9.0.0.888, Virus/Spyware Database: 6.19680)
> http://www.pctools.com
> =======
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list