Identify on any feature layer

3649
3
08-04-2010 09:34 PM
StephenLead
Regular Contributor III
The sample at http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify shows how to run an Identify operation on a layer.

The Identify layer is hard-coded:

Dim identifyTask As New IdentifyTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/" & "Demographics/ESRI_Census_USA/MapServer")

Is it possible to write an Identify tool which will work on any visible feature layer?

Thanks,
Steve
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Sure, you can iterate thru your Map.Layers and check for each layer's visible property and pass in the layer's Url to the IdentifyTask if layer is visible.

Jennifer
0 Kudos
StephenLead
Regular Contributor III
Hi Jennifer,

Can you provide any sample code (or even pseudo code)? The sample I mentioned uses:

Dim identifyTask As New IdentifyTask(URL)

What is the syntax if I don't wish to have a new identify task for each layer, but rather a single identify task which works on any visible layer (like the ArcMap Identify tool with the "visible layers" option chosen)?

Thanks,
Steve
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You need one Identify task by Dynamic Map service layer. This task will identify all sublayers at the same time (can be controled by a parameter) .

If you have more than one dynamic map service layer, you will need more than one task but you can put all the results in the same dialog box

Can you provide any sample code (or even pseudo code)?


I did that in the 'Web Map Viewer' sample.

You can test the identify with this webmap
, it's possible to get identify results from the 2 map service layers..
0 Kudos