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 a feature layer from a group layer using ArcGIS REST API in ArcGIS Online.
Procedure
- Log in to ArcGIS Online.
- On the Content page, browse to the desired hosted feature layer, click More Options and select View details.
- On the Overview tab, next to 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": ""
}
]
}
- 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 Layers section.
The image below shows the remaining layers on the web map after deleting Layer_B from the group layer.