Hi thanks for your reply.. I have gone through the sample but it is same as the above code as it also iterates through every serviceMy problem is that I have about 10 services running and iterating through 10 services takes more time so my identify tool works slow, populating the layername from the results into the combobox take a long time about2 seconds for each ltemmy code goes like thisprivate void QueryPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
// create identifyParams object
IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = mapPoint,
//Tolerance = 50,
MapExtent = mainPage.map.Extent,
Width = (int)mainPage.map.ActualWidth,
Height = (int)mainPage.map.ActualHeight,
LayerOption = LayerOption.visible,
SpatialReference = mainPage.map.SpatialReference
};
// store all the available services in to myMapService stack
storeMapServices();
identifyTask.Url = myMapService.Pop();
identifyTask.ExecuteAsync(identifyParams, identifyParams);
}
void identifyTask_ExecuteCompleted(object sender, IdentifyEventArgs e)
{
if (e.IdentifyResults != null && e.IdentifyResults.Count > 0)
{
boolNeedReset = false;
//get Layerkeyfield and add identify results to dictionary
ShowFeatures(e.IdentifyResults);
}
if (tempInt < 2)
{
identifyTask.Url = myMapService.Pop();
IdentifyParameters identifyParams = e.UserState as IdentifyParameters;
identifyTask.ExecuteAsync(identifyParams, identifyParams);
}
}
public void ShowFeatures(List<IdentifyResult> results)
{
int intFeatureCount = 0;
//Get the Layer Key Field
DataAccessService.DataAccessServiceClient dataAccessServiceClient = new DataAccessService.DataAccessServiceClient();
dataAccessServiceClient.getLayerKeyIDAsync(results[0].LayerName);
dataAccessServiceClient.getLayerKeyIDCompleted += ((s, e) =>
{
if (e.Result != string.Empty && e.Result != null)
{
kvpLayerKeyField.Add(results[0].LayerName, e.Result);
foreach (IdentifyResult result in results)
{
if (!kvpIdentifyResults.Keys.Contains(Convert.ToInt32(results[intFeatureCount].Feature.Attributes[e.Result])))
{
kvpIdentifyResults.Add(Convert.ToInt32(results[intFeatureCount].Feature.Attributes[e.Result]), results[intFeatureCount].LayerName);
intFeatureCount++;
}
}
//add identified layernames to combobox
IdentifyComboBox.Items.Add(results[0].LayerName);
}
});
}
Is there any other way to get mouse map pointer clicked element attributes form other then Identifytask?