Select to view content in your preferred language

How do you add a layer into a group layer in ArcGIS Online using Python?

09-27-2018 01:15 PM
New Contributor

I am writing a Python script to add a batch of (many) layers to an existing web scene on ArcGIS Online. All the layers are already hosted, so I'm just going to get each layer by it's item ID and add it to the web scene. Each layer needs to be added to a particular group layer in the scene. So basically I'm iterating through a CSV file with item IDs in one column and the name of the group layer in another column.

The problem is that there doesn't seem to be an easy way in the ArcGIS API to add a layer to a group layer in ArcGIS Online. What I'm really looking for is an arcgis equivalent to the arcpy function AddLayerToGroup. An alternate approach might be to add the layer and then move it to the correct group layer, but again I'm not sure if this is doable. 

Tags (1)
0 Kudos
0 Replies