<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \, serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.errormessage
        {mso-style-name:errormessage;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Just to complement my previous email and show you how I am dealing with this issue.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Here is my code:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>var</span></b><span style='font-size:10.0pt;font-family:Consolas'> activeLayer;</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F5F'>// get the active layer.</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>var</span></b><span style='font-size:10.0pt;font-family:Consolas'> registerRadio = </span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>function</span></b><span style='font-size:10.0pt;font-family:Consolas'>(node){</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>if</span></b><span style='font-size:10.0pt;font-family:Consolas'>(!node.hasListener(</span><span style='font-size:10.0pt;font-family:Consolas;color:#2A00FF'>"radiochange"</span><span style='font-size:10.0pt;font-family:Consolas'>)) {</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> node.on(</span><span style='font-size:10.0pt;font-family:Consolas;color:#2A00FF'>"radiochange"</span><span style='font-size:10.0pt;font-family:Consolas'>, </span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>function</span></b><span style='font-size:10.0pt;font-family:Consolas'>(node){</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> activeLayer = node.layer.name;</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> activeLayerID = node.layer.id;</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> map.raiseLayer(activeLayerID, 1);</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> });</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> }</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> };</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> LayerTree.on({</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><span style='font-size:10.0pt;font-family:Consolas;color:#2A00FF'>"insert"</span><span style='font-size:10.0pt;font-family:Consolas'>: registerRadio,</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> </span><span style='font-size:10.0pt;font-family:Consolas;color:#2A00FF'>"append"</span><span style='font-size:10.0pt;font-family:Consolas'>: registerRadio,</span><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas'> scope: </span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>this</span></b><span style='font-size:10.0pt;font-family:Consolas;color:windowtext'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas'> });</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>This is working to get the legend of the active layer.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><pre><span style='font-family:"Calibri","sans-serif";color:#1F497D'>I am now trying the raiseLayer method but once I am using the layer ID instead of the variable, I get this error on the console: </span><span style='color:windowtext'>TypeError: layer.setZIndex is not a function<o:p></o:p></span></pre><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Jacinto Estima [mailto:jacinto.estima@gmail.com] <br><b>Sent:</b> Wednesday, August 08, 2012 10:17 AM<br><b>To:</b> 'Alexandre Dubé'<br><b>Cc:</b> users@geoext.org<br><b>Subject:</b> RE: [Users] Active layer on top<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Thank you very much Alexandre. I really appreciate your help.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>To use the <b>setLayerIndex</b> I have to provide the variable that holds the layer.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>My problem now is that when I get the active layer I only can get its ID or Name, but not the name of the variable and I need it to set the Layer Index to the highest value. Any idea on how to get the variable?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Jacinto<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Alexandre Dubé <a href="mailto:[mailto:adube@mapgears.com]">[mailto:adube@mapgears.com]</a> <br><b>Sent:</b> Tuesday, August 07, 2012 4:16 PM<br><b>To:</b> Jacinto Estima<br><b>Cc:</b> <a href="mailto:users@geoext.org">users@geoext.org</a><br><b>Subject:</b> Re: [Users] Active layer on top<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Jacinto,<br><br> The following example shows how to listen to the event triggered when a layer is selected using the radio button. You can start from there.<br> <a href="http://api.geoext.org/1.1/examples/tree.html">http://api.geoext.org/1.1/examples/tree.html</a><br><br>HTH,<br><br>Alexandre<br><br><br>On 12-08-07 02:31 AM, Jacinto Estima wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='color:#1F497D'>Just to complement my previous email.</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>My idea is to build a function that reorder the layers and for that I already have something in mind. My problem is how to call that function every time the users sets the active layer through the radio button.</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Thanks again</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Jacinto Estima [<a href="mailto:jacinto.estima@gmail.com">mailto:jacinto.estima@gmail.com</a>] <br><b>Sent:</b> Tuesday, August 07, 2012 10:28 AM<br><b>To:</b> 'Alexandre Dubé'; '<a href="mailto:users@geoext.org">users@geoext.org</a>'<br><b>Subject:</b> RE: [Users] Active layer on top</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Thanks Alexandre. I think this is what I was looking for.</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>I have now to figure out how to put this working. I have several raster layers and a lot of users are expected to access them so I cannot go with the “highest layer number + 1” . I have to find a way to reorganize the order every time the user sets the active layer through the radio button (I have radio buttons in the tree nodes to set the active layer). Do you have any suggestion?</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Regards,</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Jacinto</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:users-bounces@geoext.org">users-bounces@geoext.org</a> <a href="mailto:[mailto:users-bounces@geoext.org]">[mailto:users-bounces@geoext.org]</a> <b>On Behalf Of </b>Alexandre Dubé<br><b>Sent:</b> Monday, August 06, 2012 4:33 PM<br><b>To:</b> <a href="mailto:users@geoext.org">users@geoext.org</a><br><b>Subject:</b> Re: [Users] Active layer on top</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><div><p class=MsoNormal>Hi Jacinto,<br><br> The OpenLayers.Map.setLayerIndex may be what you're looking for :<br> <a href="http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.setLayerIndex">http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.setLayerIndex</a><br><br>HTH,<br><br>Alexandre<br><br><br>On 12-08-06 07:41 AM, Jacinto Estima wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>I have an Issue to solve as follows: I have several layers on my application. These layers are organized in subfolders with async tree nodes. I need to find a way to put the active layer on top of all of the other layers without moving it.<o:p></o:p></p><p class=MsoNormal>I was wondering if someone already did that or have the same issue to solve.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Thanks for your help.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Jacinto<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman , serif","serif"'><br><br></span><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a href="mailto:Users@geoext.org">Users@geoext.org</a><o:p></o:p></pre><pre><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre></blockquote><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman , serif","serif"'><br><br></span><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre>Alexandre Dubé<o:p></o:p></pre><pre>Mapgears<o:p></o:p></pre><pre><a href="http://www.mapgears.com">www.mapgears.com</a><o:p></o:p></pre></blockquote><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Alexandre Dubé<o:p></o:p></pre><pre>Mapgears<o:p></o:p></pre><pre><a href="http://www.mapgears.com">www.mapgears.com</a><o:p></o:p></pre></div></body></html>