Select to view content in your preferred language

Hosted View not displaying after overwrite method on hosted feature

683
6
04-18-2022 07:52 AM
Big-Chill
New Contributor III

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.

Thanks

Jim L.

0 Kudos
6 Replies
PDodd
by
New Contributor III

Does the Feature Layer draw ok?

Check the "Settings" tab and see if the Optimization is enabled. This can cause issues with some Layers.

0 Kudos
Big-Chill
New Contributor III

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.

0 Kudos
PDodd
by
New Contributor III

Does the View have Scale Suppression set?

Could be something applied to the Symbology, like an Arcade expression.

0 Kudos
Big-Chill
New Contributor III

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.

0 Kudos
PDodd
by
New Contributor III

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:

PDodd_0-1650909084202.png

And the Service 'layers' should look similar to this:

PDodd_1-1650909220721.png

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.

0 Kudos
Big-Chill
New Contributor III

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.

0 Kudos