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"
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users