Select to view content in your preferred language

ImageServiceIdentifyResult has no LayerName

727
4
01-05-2011 02:22 PM
RyanCoodey
Frequent Contributor
The ImageServiceIdentifyResult class does not seem to have a LayerName property like IdentifyResult does... is there any way to get this info from either ImageServiceIdentifyEventArgs or ImageServiceIdentifyResult?

Thanks a lot!
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
The ImageServiceIdentifyResult class has a 'Name' property.
For example with this image service, the Name property is returning 'PreAerial2001'.

Is it what you are looking for?
0 Kudos
RyanCoodey
Frequent Contributor
Hmmm, for me the Name property contains the string "Pixel", which is not the Name/ID of the Layer...  any ideas?

Thanks for the reply Dominique!
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You are right, it's returning 'Pixel'.

So it looks like the layer name info is not available.

A workaround might be to add it in the delegate hooked up to ExecuteComplete event:

 
identifyTask.ExecuteCompleted += (s,e) => IdentifyTask_ExecuteCompleted(s, e, "MyImageLayerID");
.........
private void IdentifyTask_ExecuteCompleted(object sender, ImageServiceIdentifyEventArgs args, string layerID)
{
......
 
0 Kudos
RyanCoodey
Frequent Contributor
Thanks for confirming and for the example Dominique! 

I use the same handling method for multiple image layers, so to make my life easier I just keep track of the last identified items layer name and in the method just use this.

Thanks!
0 Kudos