Summary
If a layer is no longer relevant or required within a group layer, deleting it from the group keeps the data layers in ArcGIS Online organized. Deleting a layer from a group layer requires the use of ArcGIS REST API in ArcGIS Online. ArcGIS REST API is useful when it involves projects with large data. In this example, six feature layers are grouped within a single group layer.
This article provides the workflow to delete Layer_B from the group layer using ArcGIS REST API in ArcGIS Online.
Procedure
- Log in to ArcGIS Online and click Content > My content.
- Browse to the hosted feature layer, click More Options
and select View details. - On the Overview tab, under URL, click View to open the ArcGIS REST Services Directory window.
- In the ArcGIS REST Services Directory window, click Admin. Scroll down and click Delete From Definition.
- In the Delete From Service Definition text box, retrieve the ID number of the layer to delete. In this example, the layer to delete is Layer_B and the ID number is 2.
- Delete the text inside the Delete From Service Definition text box.
- Specify the following code in the Delete From Service Definition text box. Replace <ID_NUMBER> with the ID number of the layer to delete.
{
"layers": [
{
"id": "<ID_NUMBER>"
}
]
}
- Click Delete From Service Definition.
- Click Close
to close the ArcGIS REST Services Directory window. - Refresh the Overview tab, and the updated layers are displayed in the map's Layers pane, as shown in the image below.