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.

We are using ArcGIS Rest services on Openlayers. The layers are placed on the map correctly But how to identify a layer feature on mouse over or mouse click and get the details of the particular layer feature...? Is there any function in Openlayers library to do it..?

share|improve this question

2 Answers 2

There is nothing inbuilt in OpenLayers that can directly call the Identify Task on the ArcGIS Server's REST Endpoint.

If you are fairly comfortable with JavaScript, then there is some hope. You can refer to the AgsIdentifyTask.js code present in this sandbox: http://dev.openlayers.org/sandbox/august/trunk/lib/OpenLayers/Control/

There is a sample here, but I haven't been able to get it to work.

share|improve this answer
    
Thanks Devdatta, I checked the sample but its not working. I selected a layer and click on identify button(to activate control) and click(CTRL+click(as they mentioned)) on the layer. But nothing happened.. :( –  Mufeed K Kasim Jun 26 '13 at 6:53
    
@MufeedKKasim I just linked to the sample, so that you can have a look at the source code. Have you added the source code of the control to your application? –  Devdatta Tengshe Jun 26 '13 at 7:07

For those of you still looking for an Identify click event on ArcRest93 layers in OpenLayers 2.x, I have used the following to successfully handle click events for ArcRest93 layers.

I originally found the code in an OSDir thread by someone named giovanni (maybe Giovanni Allegri?).

Which itself refers to the code found in this pastebin.

share|improve this answer

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.