|
Hello all, I tried to add an array of layers to my map object but it fails. First I have created some layers and added these to a layerlist (=array) which is also used for a layer tree. How can I add this array to the map? Do I have to create a GeoExt.data.layerStore? Thank you for some sugestions... Here the relevant code: /* * Layer */ var OLwms = new OpenLayers.Layer.WMS( "Topographic map", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {isBaseLayer: true} ); var BMwms = new OpenLayers.Layer.WMS( "Blue Marble Global Imagery", "http://sigma.openplans.org/geoserver/wms?", {layers: 'bluemarble'}, {isBaseLayer: true } ); var NASAwms = new OpenLayers.Layer.WMS( "NASA WMS", "http://wms.jpl.nasa.gov/wms.cgi?", {layers: 'BMNG', format: 'image/png'}, {isBaseLayer: true} ); ... /* * Array with layers */ var layerList =[{ text: 'Background Layers', leaf: false, expanded: true, children: [{ nodeType: 'gx_layer', layer: OLwms, checked: false }, { nodeType: 'gx_layer', layer: BMwms, checked: false }, { nodeType: 'gx_layer', layer: NASAwms, checked: false }, ... ] }]; ... /* * the map panel */ var mainPanel = new Ext.Panel({ region: 'center', deferredRender: false, margins: '5 5 5 5', activeTab: 2, items:[ { xtype: 'gx_mappanel', title: 'Maps', split: true, map: mainMap, layer: ([layerList]), zoomTo: 'maxExtent', }] }); Best regards, Christian |
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
