<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Verdana;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=FR-CA link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>Hi,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>I’m trying to send a getFeatureInfo to all
queryable layers.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>In the “onComplete” function, I would
like to be able to “know”, for each response, the index of the
corresponding layer (the layer index for which the request was sent).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>But the “index” value in the
“onComplete” function is always wrong (seems to be equal to “</span></font><font
size=2 face="Courier New"><span lang=EN-CA style='font-size:10.0pt;font-family:
"Courier New"'>map.layers.length</span></font><font size=2 face=Verdana><span
lang=EN-CA style='font-size:10.0pt;font-family:Verdana'>” value).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>How can I make sure the index is correctly passed ?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'>Thanks a lot.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>function findLayerClick (
event )<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> var url;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> var
mouseLoc = map.getLonLatFromPixel ( event.xy );<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> for ( var
i = 0; i < map.layers.length; i++ )<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
if ( map.layers[i].queryable )<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
url = map.layers[i].getFullRequestString<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
({<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
REQUEST: "GetFeatureInfo",<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
EXCEPTIONS: "application/vnd.ogc.se_xml",<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
BBOX: map.getExtent().toBBOX(),<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
X: event.xy.x,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
Y: event.xy.y,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
SRS: "EPSG:32187",<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
INFO_FORMAT: "text/html; charset=ISO-8859-1",<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
QUERY_LAYERS: map.layers[i].params.LAYERS, <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
FEATURE_COUNT: 5,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
VERSION: "1.1.1",<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
WIDTH: map.size.w,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
HEIGHT: map.size.h<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
}, map.layers[i].url );<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
OpenLayers.loadURL ( url, '', this, function ( response ) { setHTML ( response,
i ); });<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> OpenLayers.Event.stop(event);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>function setHTML ( response,
index )<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> alert (
index );<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'> ... ...
... // manipulate the result<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-CA
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-CA style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'>James<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><o:p> </o:p></span></font></p>
</div>
</body>
</html>