<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>I managed to create a sublayer tree at a window with mapfish. But now I want to do the same at a viewport, so I copied my code but firebug said that this.node.layer.getVisibility() is not a function.<br><br>Here is my code:<br>new Ext.Viewport({<br> layout: "border",<br> items: [{<br> title: "Map",<br> id:
"map",<br> region: "center",<br> xtype: "gx_mappanel",<br> map: map,<br> layers: layerStore,<br> center: new OpenLayers.LonLat( <br> 9.5,48.5),<br> zoom:
4,<br> items: [{<br> xtype: "gx_zoomslider",<br> aggressive: true,<br> vertical: true,<br> height: 100,<br> x:
10,<br> y: 20,<br> plugins: new GeoExt.ZoomSliderTip({<br> template: "Massstab: 1 : {scale}<br>Aufloesung: {resolution}"<br> })<br> }],<br> tbar:
createTbarItems(map)<br> }, {<br> title: "Layer tree",<br> region: "west",<br> id: "layertree", <br> width: 150,<br> xtype: "treepanel", <br> loader: new Ext.tree.TreeLoader({applyLoader:
false}),<br> root: {<br> nodetype: "async",<br> children: [{ <br> nodeType: "gx_baselayercontainer"},<br> {<br> nodeType:
"gx_overlaylayercontainer",<br> expanded: true,<br> loader: {<br> baseAttrs: {radioGroup: "foo"}<br> }<br> },<br> {<br>
nodeType: "gx_layer",<br> layer: layers,<br> isleaf: false,<br> loader: { param: "LAYERS"}<br> }<br> ],<br>
rootVisible: false<br> }<br> <br> }, .....})<br><br>var createLayers = function() {<br> return [<br> <br><span> new OpenLayers.Layer.WMS("layer1", "<a target="_blank" href="http://myserver/wmsconnector/com.esri.wms.Esrimap/layer">http://myserver/wmsconnector/com.esri.wms.Esrimap/layer</a>?",</span><br> {layers: '0', format: "image/png", transparent: true }, {projection: "EPSG:4326", isBaseLayer: true, displayInLayerSwitcher: true, visibility: true} ), ....}<br><br><br>Anybody know
what I´m doing wrong?<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br>Thanks.<br>best regards<br>Sarah<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Sarah Schuessler <sarah_flip@yahoo.de><br><b><span style="font-weight: bold;">An:</span></b> users@geoext.org<br><b><span style="font-weight: bold;">Gesendet:</span></b> Freitag, den 22. Januar 2010, 14:48:53 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> [Users] sublayers at layer tree<br></font><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: rgb(0, 0, 0);"><div>Hi list,<br><br>I´m using mapfish (1.2).<br>I have some wms layers (published with Geoserver and ArcIMS). Now I want to organize my layers at layer tree like<br><br>forest<br> -deciduous
forest<br> - coniferious forest<br>different types of forest<br> - type a<br> - type b<br>..<br><br>I use viewport to build layer tree:<br>{<br> title: "Layer tree",<br> region:
"west",<br> width: 150,<br> xtype: "treepanel",<br> loader: new Ext.tree.TreeLoader({applyLoader: false}),<br> root: {<br> nodeType: "gx_layercontainer",<br> layerStore: new GeoExt.data.LayerStore({<br>
map: map, layers: layers}),<br> leaf: false,<br> expanded: true<br> }, <br><br>I played around with tree.js from GeoExt example page but could not manage this.(I´m new to JS).<br><br>my layer:<br><span>new OpenLayers.Layer.WMS("Waldfunktionen", "<a rel="nofollow" target="_blank" href="http://localhost:81/geoserver/wms?service=wms">http://localhost:81/geoserver/wms?service=wms</a>",</span><br> {layers: ['layer1','layer2'], transparent: true, format: "image/gif"}, {projection: "EPSG:4326", isBaseLayer: false, displayInLayerSwitcher:
true, visibility:
true}),<br><br>So my question: do anybody has a hint for that? Or do I rather have a quite new code/application?<br><br>Thanks.<br>best regards<br>Sarah<br></div>
</div><br>__________________________________________________<br>Do You Yahoo!?<br>Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. <br><span><a target="_blank" href="http://mail.yahoo.com">http://mail.yahoo.com</a> </span></div></div>
</div><br>__________________________________________________<br>Do You Yahoo!?<br>Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. <br>http://mail.yahoo.com </body></html>