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"><<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>></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>
>>> Paul james <<a href="mailto:pauljame@gmail.com">pauljame@gmail.com</a>> 05/20/09 9:54 AM >>><br>
<div><div></div><div class="h5">Hi Steve!<br>
I didn'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 < _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>
<<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>>wrote:<br>
<br>
> If you'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'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'd use one of the other query methods and then<br>
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>
> >>> Paul james <<a href="mailto:pauljame@gmail.com">pauljame@gmail.com</a>> 05/20/09 7:56 AM >>><br>
> 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>
> <<a href="mailto:pvoudouris@gaiocorp.com">pvoudouris@gaiocorp.com</a>>wrote:<br>
><br>
> >  Probably don’t understand what exactly you are trying to achieve<br>
here<br>
> but<br>
> > it is not as simple as map.getLayer(0) to get the topmost layer? And<br>
> once<br>
> > you have the layer object use one of the query function to select<br>
the<br>
> > record? E.g.  myLayerObj.queryByPoint ?<br>
> ><br>
> ><br>
> ><br>
> > Pano<br>
> ><br>
> ><br>
> ><br>
> > *From:* <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mailto:<br>
> > <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>] *On Behalf Of *Paul james<br>
> > *Sent:* 19 May 2009 21:46<br>
> > *To:* <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> > *Subject:* [mapserver-users] Get the nearest layer with mapscript...<br>
> ><br>
> ><br>
> ><br>
> > Hello guys...<br>
> > I have several layers (lines, points, poly) ...<br>
> > Ím developing a measure tool... User can click on map and I have to<br>
> > select that layer to calculate de Area with postgis...<br>
> ><br>
> >  Ím trying to do that WITHOUT using "LAYER ACTIVE SYSTEM"...<br>
> ><br>
> >  Is That possible using mapscript? How Can I find the nearest and<br>
> toppest<br>
> > layer ?<br>
> ><br>
> > Thanks!<br>
> ><br>
> > Paul<br>
> ><br>
> > _______________________________________________<br>
> > mapserver-users mailing list<br>
> > <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
> ><br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br>