Hi Steve!<br>I <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial; white-space: pre;">didn&#39;t know that </span></span>mapObj <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial; white-space: pre;">could call </span></span>queryByPoint as well ... Thanks...<br>
But, How can I get the feature selected after query ?<br><br>Using LayerObj I did that (using layer.getNumResults() )<br><br>if (_layer.queryByPoint(MapaObj, _point, 0, -2) == 0)<br>            {<br>                for (int i = 0; i &lt; _layer.getNumResults(); i++)<br>
                {<br>                    resultCacheMemberObj _result = _layer.getResult(i);<br><br>                    return _result.shapeindex.ToString();<br>                }<br>            }<br><br>How can I do that using MapObj ?<br>
<br>thanks!<br><br><br><div class="gmail_quote">On Wed, May 20, 2009 at 10:51 AM, Steve Lime <span dir="ltr">&lt;<a href="mailto:Steve.Lime@dnr.state.mn.us" target="_blank">Steve.Lime@dnr.state.mn.us</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you&#39;re doing point queries MapServer/MapScript can do this for you.<br>
You do a<br>
mapObj.queryByPoint with the MS_SINGLE mode and then the function will<br>
identify<br>
the closest feature (considering TOLERANCEs!) in the top-most ACTIVE<br>
layer.<br>
<br>
This site uses this to it&#39;s advantage...<br>
<br>
  <a href="http://www.dnr.state.mn.us/maps/compass.html" target="_blank">http://www.dnr.state.mn.us/maps/compass.html</a><br>
<br>
A query drops through the layers until a match is hit.<br>
<br>
Even with other geometry types based on what was described you can<br>
probably do<br>
it pretty easily. You&#39;d use one of the other query methods and then once<br>
the query<br>
is done loop through your layer stack backwards (e.g. starting at the<br>
top) and stop<br>
when you find one with results.<br>
<br>
Steve<br>
<br>
&gt;&gt;&gt; Paul james &lt;<a href="mailto:pauljame@gmail.com" target="_blank">pauljame@gmail.com</a>&gt; 05/20/09 7:56 AM &gt;&gt;&gt;<br>
<div><div></div><div>Thanks Pano...<br>
But It́s not that simple...<br>
What I need is figure out what LAYER was clicked...<br>
<br>
Paul<br>
<br>
On Wed, May 20, 2009 at 6:43 AM, Pano Voudouris<br>
&lt;<a href="mailto:pvoudouris@gaiocorp.com" target="_blank">pvoudouris@gaiocorp.com</a>&gt;wrote:<br>
<br>
&gt;  Probably don’t understand what exactly you are trying to achieve here<br>
but<br>
&gt; it is not as simple as map.getLayer(0) to get the topmost layer? And<br>
once<br>
&gt; you have the layer object use one of the query function to select the<br>
&gt; record? E.g.  myLayerObj.queryByPoint ?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Pano<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; *From:* <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a> [mailto:<br>
&gt; <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] *On Behalf Of *Paul james<br>
&gt; *Sent:* 19 May 2009 21:46<br>
&gt; *To:* <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; *Subject:* [mapserver-users] Get the nearest layer with mapscript...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hello guys...<br>
&gt; I have several layers (lines, points, poly) ...<br>
&gt; Ím developing a measure tool... User can click on map and I have to<br>
&gt; select that layer to calculate de Area with postgis...<br>
&gt;<br>
&gt;  Ím trying to do that WITHOUT using &quot;LAYER ACTIVE SYSTEM&quot;...<br>
&gt;<br>
&gt;  Is That possible using mapscript? How Can I find the nearest and<br>
toppest<br>
&gt; layer ?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Paul<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; mapserver-users mailing list<br>
&gt; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>