Thanks Steve...<br>That worked !<br><br><div class="gmail_quote">On Wed, May 20, 2009 at 1:34 PM, Steve Lime <span dir="ltr">&lt;<a href="mailto:Steve.Lime@dnr.state.mn.us">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;">You just need another loop...<br>
<br>
for( ...each layer...) {<br>
  layer = ... mapObj get layer ...<br>
<br>
  ... now your getNumResults() loop ...<br>
}<br>
<br>
Steve<br>
<br>
&gt;&gt;&gt; Paul james &lt;<a href="mailto:pauljame@gmail.com">pauljame@gmail.com</a>&gt; 05/20/09 9:54 AM &gt;&gt;&gt;<br>
<div><div></div><div class="h5">Hi Steve!<br>
I didn&#39;t know that mapObj could call 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>
On Wed, May 20, 2009 at 10:51 AM, Steve Lime<br>
&lt;<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>&gt;wrote:<br>
<br>
&gt; If you&#39;re doing point queries MapServer/MapScript can do this for you.<br>
&gt; You do a<br>
&gt; mapObj.queryByPoint with the MS_SINGLE mode and then the function will<br>
&gt; identify<br>
&gt; the closest feature (considering TOLERANCEs!) in the top-most ACTIVE<br>
&gt; layer.<br>
&gt;<br>
&gt; This site uses this to it&#39;s advantage...<br>
&gt;<br>
&gt;  <a href="http://www.dnr.state.mn.us/maps/compass.html" target="_blank">http://www.dnr.state.mn.us/maps/compass.html</a><br>
&gt;<br>
&gt; A query drops through the layers until a match is hit.<br>
&gt;<br>
&gt; Even with other geometry types based on what was described you can<br>
&gt; probably do<br>
&gt; it pretty easily. You&#39;d use one of the other query methods and then<br>
once<br>
&gt; the query<br>
&gt; is done loop through your layer stack backwards (e.g. starting at the<br>
&gt; top) and stop<br>
&gt; when you find one with results.<br>
&gt;<br>
&gt; Steve<br>
&gt;<br>
&gt; &gt;&gt;&gt; Paul james &lt;<a href="mailto:pauljame@gmail.com">pauljame@gmail.com</a>&gt; 05/20/09 7:56 AM &gt;&gt;&gt;<br>
&gt; Thanks Pano...<br>
&gt; But It́s not that simple...<br>
&gt; What I need is figure out what LAYER was clicked...<br>
&gt;<br>
&gt; Paul<br>
&gt;<br>
&gt; On Wed, May 20, 2009 at 6:43 AM, Pano Voudouris<br>
&gt; &lt;<a href="mailto:pvoudouris@gaiocorp.com">pvoudouris@gaiocorp.com</a>&gt;wrote:<br>
&gt;<br>
&gt; &gt;  Probably don’t understand what exactly you are trying to achieve<br>
here<br>
&gt; but<br>
&gt; &gt; it is not as simple as map.getLayer(0) to get the topmost layer? And<br>
&gt; once<br>
&gt; &gt; you have the layer object use one of the query function to select<br>
the<br>
&gt; &gt; record? E.g.  myLayerObj.queryByPoint ?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Pano<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; *From:* <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mailto:<br>
&gt; &gt; <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>] *On Behalf Of *Paul james<br>
&gt; &gt; *Sent:* 19 May 2009 21:46<br>
&gt; &gt; *To:* <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; *Subject:* [mapserver-users] Get the nearest layer with mapscript...<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Hello guys...<br>
&gt; &gt; I have several layers (lines, points, poly) ...<br>
&gt; &gt; Ím developing a measure tool... User can click on map and I have to<br>
&gt; &gt; select that layer to calculate de Area with postgis...<br>
&gt; &gt;<br>
&gt; &gt;  Ím trying to do that WITHOUT using &quot;LAYER ACTIVE SYSTEM&quot;...<br>
&gt; &gt;<br>
&gt; &gt;  Is That possible using mapscript? How Can I find the nearest and<br>
&gt; toppest<br>
&gt; &gt; layer ?<br>
&gt; &gt;<br>
&gt; &gt; Thanks!<br>
&gt; &gt;<br>
&gt; &gt; Paul<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; mapserver-users mailing list<br>
&gt; &gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>