[Users] sublayers at layer tree

Sarah Schuessler sarah_flip at yahoo.de
Thu Feb 4 11:08:47 CET 2010


Hi,

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.

Here is my code:
new Ext.Viewport({
                layout: "border",
                items: [{
                    title: "Map",
                   id: "map",
                    region: "center",
                    xtype: "gx_mappanel",
                    map: map,
                    layers: layerStore,
                   center: new OpenLayers.LonLat(   
                   9.5,48.5),
                    zoom: 4,
                    items: [{
                        xtype: "gx_zoomslider",
                        aggressive: true,
                        vertical: true,
                        height: 100,
                        x: 10,
                        y: 20,
                        plugins: new GeoExt.ZoomSliderTip({
                            template: "Massstab: 1 : {scale}<br>Aufloesung: {resolution}"
                        })
                    }],
                    tbar: createTbarItems(map)
                }, {
                    title: "Layer tree",
                    region: "west",
              id: "layertree",        
                    width: 150,
                    xtype: "treepanel", 
               loader: new Ext.tree.TreeLoader({applyLoader: false}),
                    root: {
                    nodetype: "async",
                    children: [{        
                                    nodeType: "gx_baselayercontainer"},
                            {
                            nodeType: "gx_overlaylayercontainer",
                            expanded: true,
                            loader: {
                                baseAttrs: {radioGroup: "foo"}
                                }
                            },
                            {
                            nodeType: "gx_layer",
                            layer: layers,
                            isleaf: false,
                            loader: { param: "LAYERS"}
                            }
                            ],
                    rootVisible: false
                    }
                
                }, .....})

var createLayers = function() {
        return [
               
         new OpenLayers.Layer.WMS("layer1", "http://myserver/wmsconnector/com.esri.wms.Esrimap/layer?",
        {layers: '0', format: "image/png", transparent: true }, {projection: "EPSG:4326", isBaseLayer: true, displayInLayerSwitcher: true, visibility: true} ), ....}


Anybody know what I´m doing wrong?


Thanks.
best regards
Sarah


________________________________
Von: Sarah Schuessler <sarah_flip at yahoo.de>
An: users at geoext.org
Gesendet: Freitag, den 22. Januar 2010, 14:48:53 Uhr
Betreff: [Users] sublayers at layer tree


Hi list,

I´m using mapfish (1.2).
I have some wms layers (published with Geoserver and ArcIMS). Now I want to organize my layers at layer tree like

forest
    -deciduous forest
    - coniferious forest
different types of forest
    - type a
    - type b
..

I use viewport to build layer tree:
{
                    title: "Layer tree",
                    region: "west",
                    width: 150,
                    xtype: "treepanel",
               loader: new Ext.tree.TreeLoader({applyLoader: false}),
                    root: {
                        nodeType: "gx_layercontainer",
                        layerStore: new GeoExt.data.LayerStore({
                map: map, layers: layers}),
                        leaf: false,
                        expanded: true
                    }, 

I played around with tree.js from GeoExt example page but could not manage this.(I´m new to JS).

my layer:
new OpenLayers.Layer.WMS("Waldfunktionen", "http://localhost:81/geoserver/wms?service=wms",
        {layers: ['layer1','layer2'], transparent: true, format: "image/gif"}, {projection: "EPSG:4326", isBaseLayer: false, displayInLayerSwitcher: true, visibility: true}),

So my question: do anybody has a hint for that? Or do I  rather have a quite new code/application?

Thanks.
best regards
Sarah

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100204/95818245/attachment.htm 


More information about the Users mailing list