Select to view content in your preferred language

Silverlight, Identify Task, Map Service

2425
4
10-26-2010 06:06 AM
DavidRoberts1
Deactivated User
I recently implemented an identify tool using the example on the Resource Center (http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify).  The tool was working but I am now having a problem with the following code:

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.

IdentifyTask identifyTask = new IdentifyTask("http://pc231/example/rest/services/hou/MapServer");
0 Kudos
4 Replies
AliMirzabeigi
Emerging Contributor
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).
0 Kudos
DavidRoberts1
Deactivated User
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?
0 Kudos
DavidRoberts1
Deactivated User
I was able to correct this by stating the spatial reference of the esri map service in code, i.e., "SpatialReferenceWKID=4326"

Thanks again for the help.
0 Kudos
TerryGiles
Frequent Contributor
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
0 Kudos