foreach (IdentifyResult result in identifyArgs.IdentifyResults) { Graphic graphic = AddGraphicToLayer(MyMap.Layers[CUSTOM_GRAPHICS_LAYER_ID] as GraphicsLayer, result.Feature, GetResultsSymbolForGeometry(result.Feature.Geometry),result.LayerName); //ResultsFillSymbol); }
The foreach loop (taken from the ESRI example) never gets executed because identifyArgs.IdentifyResults is empty.
The only difference between my code and the ESRI code is that I am pulling in my own dynamic map service. I am confident the map service is set up correctly because the layers appear in the application; i.e. can be turned on and off. However, the service does not seem to be working for the identify tool. The line of code used to access the service was taken from the ESRI example.
David, To make sure that your service is behaving correctly I suggest you invoke the Identify task directly from your map service. To do this open your browser and navigate to http://pc231/example/rest/services/hou/MapServer and at the end of the page click on "Identify" link, then pass the parameters like the input you see in Fiddler (passed from your application).
Thanks for the reply. The issue is my service has a different spatial reference than the ESRI map service that I am using for my base layer. Would it be easier to change the spatial reference of my service or convert the Geometry Parameters on Identify to the correct units?
Any chance either of you can help with my Identify issue that I described here?
Basically similar sitiuation to David's - running an identify against a layer with a different projection than the map but args.Identify results is NULL even though a) the spatial reference is set for the IdentifyTask and b) I can see correct results coming back in Fiddler. Thanks, Terry