Select to view content in your preferred language

Performing IdentifyTask with CURRENT visible LAYERS

487
1
11-01-2010 12:30 PM
SanjayRajput
Deactivated User
Hello ,
   I am looking for the code snippet to find the current visible layers of a given DynamicMapservice.
During application startup, dynamicmapservice loads all visible layers on the map(defined in the mxd). But after a while users can TURNON/TURNOFF layers. And when I do the QUERYTASK, I should be able to QUERY only the CURRENT visible layers.

Thanks
Sanjay
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
I think there is a confusion between VisibleLayers as defined on the client http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDyna...
and VisibleLayers as defined on the server.

Please note that the LayerOption in the IdentifyParameters
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Iden..., talks about the VisibleLayers as defined on the server - at the given map extent.

You can try out this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Identify

If you click on say Los Angeles, the result comes from Course Counties layer. If you zoom in further but click around the same point in Los Angeles, the result then comes from Cencus Block Group, which was not visible earlier at the initial map extent.

I suspect that what you're doing currently is assign the same MapService to a ArcGISDynamicMapServiceLayer and turn off some layers by setting VisibleLayers.  This does not affect the IdentifyTask as you can see they only work with the same URL.
0 Kudos