Zum Hauptinhalt gehen

How do I loop through layers in a service to turn layer on/off?

Kommentare

4 Kommentare

  • Permanently deleted user
    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, 

     

    Carmen
    0
  • Permanently deleted user
    Thanks.  How can I get the list of layers dynamically?  Do I have to create a list myself (hard code the layer name)?
    0
  • Permanently deleted user
    Is it possible to dynamically create a dictionary that contains all your layers?
    0
  • Permanently deleted user
    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.