[Users] gx_layer display in gx_overaylayercontainer

Sascha Müller s.mueller76 at arcor.de
Mon Nov 23 15:18:13 CET 2009


Hi,

I try to use a GroupLayer like in the examples. My problem is, that the 
GroupLayer is shown in the OverlayLayer Node.

var mapOptions = {
          maxExtent: mainBBox,
          allOverlays: false,
          resolutions: [ 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25 ],
          projection: "EPSG:21781",
          units: 'm',
          numZoomLevels: 11
};

var map = new OpenLayers.Map('map', mapOptions, {
          controls :[]
});
        map.addControl( new OpenLayers.Control.LoadingPanel());
       
// Baselayer
var luzern = new OpenLayers.Layer.WMS(
          "Luzern", "http://localhost:8081/geoserver/wms",
          { layers: "VBL:lzw"},
          { isBaseLayer: true
        });
// Overlay Layer
var gemeinden = new OpenLayers.Layer.WMS(
           "Gemeinden", "http://localhost:8081/geoserver/wms",
            {layers: "VBL:Gemeinden",
               transparent: true},
            {isBaseLayer: false
         });

map.addLayer(luzern);  
map.addLayer(gemeinden);        

map.addLayer(new OpenLayers.Layer.WMS("Strassennetz",
        "http://localhost:8081/geoserver/wms", {
                 layers: [
                     "Autobahnen",
                     "Fernstrassen",
                     "Verbindungsstrassen",
                     "Wohnstrassen"
                 ],
                 transparent: true,
                 format: "image/gif"
        }, {
                 isBaseLayer: false,
                 buffer: 0,
                 displayInLayerSwitcher: true,
                 visibility: false
        }
) );
     
// treeConfig
var treeConfig = new OpenLayers.Format.JSON().write([
          {
              nodeType: "gx_overlaylayercontainer",
              expanded: true
           },
          {
             nodeType: "gx_layer",
             layer: "Strassennetz",
             expanded: true,
             isLeaf: false,
             loader: {
                    param: "LAYERS"
             }
          },
          {
            nodeType: "gx_baselayercontainer",
            expanded: true
          }], true
        );

I tried it 'exactly' like in the example. The same result.
Did I overlooked something like a filter?

Thanks!
    
Regards

Sascha


More information about the Users mailing list