Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have created a feature layer and deployed it as a service on ArcGIS Online? Is there any way to pass lat/long values as query parameters and get respective feature layer details?

share|improve this question
    
I tried adding featureService as feature layer over a basemap. Now I want to plot a point on the map and if the point falls on the feature layer, I want to get the feature layer detail. Is it possible to get details of feature layer based on the coordinate using arcgis javascript api? –  Rax215 Feb 11 '14 at 10:42
    
Can you edit your Question to revise it with these details, please ? That keeps it easy to read for potential answerers. –  PolyGeo Feb 11 '14 at 11:01

1 Answer 1

up vote 0 down vote accepted

When you publish a layer as a Feature service, it is served through a Rest API; The Rest API for a feature Service usually supports the Query Operation.

You can pass in your point coordinates and do a spatial query, to get the resulting features.

Unfortunately, I currently don't have an ArcGIS Online Account, so I can't give you a running example.

I can give you a simple example of a Query Task which return the polygon that contains the input point. Please see this query on the US States layer. It will return that states, that contains the point with latitude 38N and longitude 100 W

share|improve this answer
    
Thanks for reply Devdatta, this is where I got stuck like what sould be the query parameters. As the examples I have seen have "where" clause that works on point data but the feature layer I have, contains polygon and my query should return the polygon details where the point coordinate fall. It would be vey useful if you could help me with the query. Thanks –  Rax215 Feb 11 '14 at 13:04
    
@user2011364: Please see my updated answer. –  Devdatta Tengshe Feb 12 '14 at 5:29
    
Thanks a lot Devdatta, it worked. That's what I was looking for. –  Rax215 Feb 12 '14 at 7:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.