How do I loop through layers in a service to turn layer on/off?
I want to go through layers in one map service and make some layers visible and others not visible in workflow. I do not know how to do this. Please help.
Thanks
0
-
Hi Yinghong,
If you want to loop through a list of layers, then you will need to create a dictionary that contains all your layers. You can then use the ForEach activity to loop through each layer in the dictionary to turn the layer on/off.
I hope this helps,
Carmen0 -
Thanks. How can I get the list of layers dynamically? Do I have to create a list myself (hard code the layer name)? 0 -
Is it possible to dynamically create a dictionary that contains all your layers? 0 -
If you want to do it dynamically, you can use the GetLayerListItemInfo activity to get a list of all the layers in the site. However, you will not be able to tell which map service the layer belongs to with this activity. 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare