Select to view content in your preferred language

Issue with Multi-Layer View Creation in ArcGIS Online Using Python API: Only Point Layer is visible

259
1
10-24-2025 05:46 AM
Labels (3)
AbinayaAS
Esri Contributor

I’m facing an issue with creating a view layer from a multi-layer hosted feature service in ArcGIS Online using ArcGIS API for Python (v2.4). The hosted service contains points, lines, and polygons. When I create a view layer using Python by passing the required layer objects to  create_view(), only the point layer appears on the AGOL Item page (as shown in image), even though the polygon layers (Zones, RestrictedArea) are visible in the service REST page (as shown in image). If I use a list of layer IDs in create_view(), all layers appear, but I only want the specific layers defined in my configuration.

AbinayaAS_0-1761309242200.png

Bringing the AGOL URL into ArcGIS Pro, exporting each layer into a new FGDB, and republishing works as expected. But when republishing the File Geodatabase which is exported directly from the feature service in AGOL or using the Item ID directly in the code, the problem persists (only the point layer shows on the Item page). I’ve also attached the Python code I used for creating the view layer.

I’m looking for a way to ensure that the view layer displays only the specified layers in AGOL without having to republish via ArcGIS Pro. Has anyone experienced this before, or can anyone help me with a solution?

0 Kudos
1 Reply
Clubdebambos
MVP Regular Contributor

Hi @AbinayaAS,

I tested your code and it worked fine for me so I don't believe the issue is with your code. 

EDIT: interesting and very concerning is that the layers have not been used in the view are not now visible in the original hosted feature service the view was created from 🤕

~ learn.finaldraftmapping.com
0 Kudos