Hello all, once again ;)<br><br>Just an update. My problem is just related with correctly loading the layer as a node in the tree panel. After digging a little bit more i found that the layer is being added to all containers that have been configured a specific loader.<br>
<br>For example, having these 2 containers:<br><br>var adminLCont = new GeoExt.tree.LayerContainer({<br> text: 'Limites Administrativos',<br> expanded: true,<br> layerStore: adminLStore,<br> loader: {<br>
baseAttrs: {<br> radioGroup: 'tematico',<br> uiProvider: 'layernodeui',<br> iconCls: 'wms'<br> }<br> }<br>});<br><br>var salBaseCont = new GeoExt.tree.BaseLayerContainer({<br>
layerStore: salBaseStore,<br> text: 'Outra',<br> allowDrop: false,<br> expanded: true,<br>});<br><br>... the new layer from wmscapabilities store is being added automatically to the first container and not the second. If i add a loader configuration to the second container, then the new layer will also be added to the container.<br>
<br>Is there any property i should define in the loader baseattrs so that thios situation is avoided?? Altgough i was able to overcome my problem i'm still interested to know if there is something else that can be defined.<br>
<br>Cheers,<br>Hugo<br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 6:32 PM, Hugo <span dir="ltr"><<a href="mailto:hfpmartins@gmail.com" target="_blank">hfpmartins@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks Lucia, for your feedback!<br><br>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.<br>
<br>Any suggestions more?<br>Kind regards,<br><font color="#888888"><br>Hugo</font><div><div></div><div><br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 4:48 PM, Morper-Busch, Lucia <span dir="ltr"><<a href="mailto:Lucia.Morper-Busch@sbg.ac.at" target="_blank">Lucia.Morper-Busch@sbg.ac.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="DE-AT"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Try instead of</span></p>
<div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US"> layerClone.mergeNewParams({<br> srs: baseMercator,<br>
format: 'image/png',<br> transparent: true<br> },{<br> isBaseLayer: false,<br> singleTile: true,<br> visibility: false<br> });</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p>
</div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">try this with one curly brace only</span></p><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> layerClone.mergeNewParams({<br> srs: baseMercator,<br> format: 'image/png',<br> transparent: true,</span></p><p class="MsoNormal"><span lang="EN-US"> isBaseLayer: false,<br>
singleTile: true,<br> visibility: false<br> });</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p></div><p class="MsoNormal"><span lang="EN-US">My code looks like this:</span></p><p class="MsoNormal">
<span lang="EN-US"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">var array = WMSstore.getRange();</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">for(var i = 0 ; i < array.length ;i++){</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">var record = array[i];</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> var copy = record.copy();</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> copy.data["layer"] = record.getLayer();</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> newParams = {</span></p>
<div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> format: "image/png",</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> transparent: "true"</span></p>
</div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> };</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> copy.getLayer().mergeNewParams(newParams);</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> map.layers.add(copy);</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">}</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Hope this helps</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Lucia</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p><p class="MsoNormal" style="margin-bottom: 1pt;">
<b><span style="font-size: 8pt; color: rgb(54, 95, 145);" lang="EN-US">Dipl.-Geogr. Lucia Morper-Busch</span></b><b><span style="font-size: 8pt; color: rgb(31, 73, 125);" lang="EN-US"> | </span></b><b><span style="font-size: 8pt; color: rgb(192, 0, 0);" lang="EN-US">Researcher</span></b><b><span style="font-size: 8pt; color: rgb(31, 73, 125);" lang="EN-US"></span></b></p>
<p class="MsoNormal" style="margin-bottom: 1pt;"><span style="font-size: 8pt; color: gray;" lang="EN-US">University of Salzburg | Centre for Geoinformatics - Z_GIS</span></p><p class="MsoNormal" style="margin-bottom: 1pt;">
<span style="font-size: 8pt; color: gray;" lang="EN-US">Schillerstr.30 | Techno-Z, Block 15, 3rd floor | 5020 Salzburg, Austria</span></p><p class="MsoNormal"><span style="font-size: 8pt; color: gray;" lang="EN-US">Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260</span></p>
<p class="MsoNormal"><b><i><span style="font-size: 8pt; color: gray;" lang="EN-US">> <a href="http://www.zgis.at/research" target="_blank"><span style="color: gray; text-decoration: none;">Z_GIS…experts for the spatial view</span></a></span></i></b></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="DE">Von:</span></b><span style="font-size: 10pt;" lang="DE"> <a href="mailto:users-bounces@geoext.org" target="_blank">users-bounces@geoext.org</a> [mailto:<a href="mailto:users-bounces@geoext.org" target="_blank">users-bounces@geoext.org</a>] <b>Im Auftrag von </b>Hugo<br>
<b>Gesendet:</b> Montag, 06. Juni 2011 14:38<br><b>An:</b> <a href="mailto:users@geoext.org" target="_blank">users@geoext.org</a><br><b>Betreff:</b> [Users] Loading WMS layer from WMSCapabilities Store</span></p><div><div>
</div><div><p class="MsoNormal"> </p><p class="MsoNormal">Hello all,<br><br>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:<br>
<br>1. When loading the WMS layer there are some parameters that are not being set<br>2. The layer appears in all the folders and sub-folders of the Tree panel (baselayers and theme layers)<br><br>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.<br>
<br>The code i'm using is the following:<br><br>for (i=0; i<selLayers.length; i++){<br> var layerClone = selLayers[i].get('layer');<br> layerClone.mergeNewParams({<br> srs: baseMercator,<br> format: 'image/png',<br>
transparent: true<br> },{<br> isBaseLayer: false,<br> singleTile: true,<br> visibility: false<br> });<br> <br> map.addLayer(layerClone);<br><br> var addWmsNode = new GeoExt.tree.LayerNode({<br>
layer: layerClone,<br> text: layerClone.name,<br> iconCls: 'wms',<br> leaf: true,<br> checked: false,<br> radioGroup: 'tematico',<br> uiProvider: treeUI<br>
});<br> <br> userRoot.appendChild(addWmsNode);<br>} <br><br>What am i missing or doing wrong here?<br>Kind regards,<br><br>Hugo <br clear="all"><br>-- <br>Hugo Martins<br>LabNT - ISEGI UNL<br>
Campus de Campolide<br>1070-312 Lisboa<br>N 38°43'56.84", W 9°9'35.74"</p></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Hugo Martins<br>LabNT - ISEGI UNL<br>Campus de Campolide<br>
1070-312 Lisboa<br>N 38°43'56.84", W 9°9'35.74"<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Hugo Martins<br>LabNT - ISEGI UNL<br>Campus de Campolide<br>1070-312 Lisboa<br>N 38°43'56.84", W 9°9'35.74"<br>