<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 12 (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;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Tahoma","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</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 lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1F497D'>Probably don’t understand what exactly you are trying to achieve
here but it is not as simple as map.getLayer(0) to get the topmost layer? And
once you have the layer object use one of the query function to select the record?
E.g.  myLayerObj.queryByPoint ?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1F497D'>Pano<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> mapserver-users-bounces@lists.osgeo.org
[mailto:mapserver-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Paul james<br>
<b>Sent:</b> 19 May 2009 21:46<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] Get the nearest layer with mapscript...<o:p></o:p></span></p>

</div>

<p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p>

<p class=MsoNormal style='margin-left:36.0pt'>Hello guys...<br>
I have several layers (lines, points, poly) ...<br>
I´m developing a <span class=apple-style-span><span style='font-size:10.0pt;
font-family:"Arial","sans-serif";color:black'>measure tool... User can click on
map and I have to select that layer to calculate de Area with postgis...</span></span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><br>
<br>
<span class=apple-style-span><o:p></o:p></span></span></p>

<p class=MsoNormal style='margin-left:36.0pt'><span class=apple-style-span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>I´m
trying to do that WITHOUT using "LAYER ACTIVE SYSTEM"...</span></span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><br>
<br>
<span class=apple-style-span><o:p></o:p></span></span></p>

<p class=MsoNormal style='margin-left:36.0pt'><span class=apple-style-span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>Is That
possible using mapscript? How Can I find the nearest and toppest layer ?</span></span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><br>
<br>
<span class=apple-style-span>Thanks!</span><br>
<br>
<span class=apple-style-span>Paul</span></span><o:p></o:p></p>

</div>

</body>

</html>