Hi there folks,
I am using Python to updated our hosted feature layers within AGOL, however, after updating the feature layer the associated hosted view is no long displaying (spatially). I can view the data, just not the spatially features. Any thoughts on what is going on? Will I need to recreate the hosted view each time? I would hate to do this because I have code that is referencing the content using item id.
Does the Feature Layer draw ok?
Check the "Settings" tab and see if the Optimization is enabled. This can cause issues with some Layers.
Thanks for the suggestions. I will double check the Optimization. As for the hosted feature layer, it is overwritten and displays just fine. In addition, the popup configuration is retained, which is odd because according to documentation the popup config should be delete too.
Does the View have Scale Suppression set?
Could be something applied to the Symbology, like an Arcade expression.
There is scale dependency, but that's it. I am using Arcade Expression to customize the popup but the fields have not changed. Still a mystery to me.
When the Hosted Service is overwritten, the underlying tables are replaced. During the final changes, the View is updated to point to the new tables. You can check this by reviewing the 'admin' service endpoint on the Service and the View to compare.
Access the Service or View item and click on the 'view' link for the URL at the lower right. This will take you to the service REST endpoint. Now, alter the address line and inject 'admin' between 'rest/services', ex. 'rest/admin/services'. The banner should change to a tan color. Now click on the 'json' link just above the service title on the top left to review.
Find the 'layers' property array, this will contain the detailed json for each layer in the service. For each layer, locate the 'adminLayerInfo' property to see what table the layer points to. The property 'tableName' should match on both the Service layers and View layers. The layers in the View will also contain an addition set of properties called 'viewLayerDefinition', which points to the name of the service it depends on (the origin of the view).
The View 'layers' should look similar to this:
And the Service 'layers' should look similar to this:
If the table names match, then the view was updated correctly.
Also, check the 'serviceLayerFields', normally it is '*' for all fields. You could have a restriction what doesn't allow access to the Shape. Though I would expect the UI of the view to show a table icon and not a Point line or Polygon.
Thanks for the info. I will look into this next week during our data updates for AGOL. Hopefully, this will shed some light on the reason my view is not displaying spatially.