Thanks Lucia, for your feedback! In fact, when testing, the transparency is being requested correctly. I think my problem should be related with the isBaseLayer parameter. I think this might be issue because whenever i load a layer it is automatically added to each of my BaseLayerContainers. Moreover, the tree node is also being added to all the overlayconatiners also. The thing i can't understand is why is this happening when i specifically define that this new layer should be added as a new node into a specific existent tree node.
Any suggestions more? Kind regards, Hugo On Mon, Jun 6, 2011 at 4:48 PM, Morper-Busch, Lucia < [email protected]> wrote: > Try instead of > > > > layerClone.mergeNewParams({ > srs: baseMercator, > format: 'image/png', > transparent: true > },{ > isBaseLayer: false, > singleTile: true, > visibility: false > }); > > > > try this with one curly brace only > > > > layerClone.mergeNewParams({ > srs: baseMercator, > format: 'image/png', > transparent: true, > > isBaseLayer: false, > singleTile: true, > visibility: false > }); > > > > My code looks like this: > > > > var array = WMSstore.getRange(); > > for(var i = 0 ; i < array.length ;i++){ > > var record = array[i]; > > var copy = record.copy(); > > copy.data["layer"] = record.getLayer(); > > newParams = { > > format: "image/png", > > transparent: "true" > > }; > > copy.getLayer().mergeNewParams(newParams); > > map.layers.add(copy); > > } > > > > Hope this helps > > Lucia > > > > *Dipl.-Geogr. Lucia Morper-Busch** | **Researcher*** > > University of Salzburg | Centre for Geoinformatics - Z_GIS > > Schillerstr.30 | Techno-Z, Block 15, 3rd floor | 5020 Salzburg, Austria > > Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260 > > *> Z_GIS…experts for the spatial view <http://www.zgis.at/research>* > > > > *Von:* [email protected] [mailto:[email protected]] *Im > Auftrag von *Hugo > *Gesendet:* Montag, 06. Juni 2011 14:38 > *An:* [email protected] > *Betreff:* [Users] Loading WMS layer from WMSCapabilities Store > > > > Hello all, > > I'm having some troubles to add WMS layers from a WMSCapabilities store. > The problem is not related with loading the layer itself. The problem i'm > facing can be divided into two: > > 1. When loading the WMS layer there are some parameters that are not being > set > 2. The layer appears in all the folders and sub-folders of the Tree panel > (baselayers and theme layers) > > About problem one, the layer is loaded but is not transparent as specified > in my code. About the second problem, i really don't understand why is this > happening once i have configured a sepcific layernode to add to the tree > panel. > > The code i'm using is the following: > > for (i=0; i<selLayers.length; i++){ > var layerClone = selLayers[i].get('layer'); > layerClone.mergeNewParams({ > srs: baseMercator, > format: 'image/png', > transparent: true > },{ > isBaseLayer: false, > singleTile: true, > visibility: false > }); > > map.addLayer(layerClone); > > var addWmsNode = new GeoExt.tree.LayerNode({ > layer: layerClone, > text: layerClone.name, > iconCls: 'wms', > leaf: true, > checked: false, > radioGroup: 'tematico', > uiProvider: treeUI > }); > > userRoot.appendChild(addWmsNode); > } > > What am i missing or doing wrong here? > Kind regards, > > Hugo > > -- > Hugo Martins > LabNT - ISEGI UNL > Campus de Campolide > 1070-312 Lisboa > N 38°43'56.84", W 9°9'35.74" > -- Hugo Martins LabNT - ISEGI UNL Campus de Campolide 1070-312 Lisboa N 38°43'56.84", W 9°9'35.74"
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
