Does webmap JSON get updated from ArcGIS Online feature layer?

1212
2
Jump to solution
09-08-2021 03:40 PM
Labels (2)
StefanieWenker
Occasional Contributor

I have a number of webmaps that use ArcGIS Server feature layers in ArcGIS Online (i.e. I added them to our content from a url and they have an itemid).

The idea was that I would use the feature layers to keep the symbology consistent between the different webmaps where I am using them. Now i am moving this into production and I need to change the urls to the final mapservice urls. I changed the url on the feature layer in my content, but when I look at the JSON for the webmap using that layer in AGO-assistant the url is still pointing to the original source, but the itemid for the feature layer is also shown and is still correct.

Will the url in the webmap JSON update eventually (is there a caching lag?) or should I update the urls in AGO-Assistant too. If both the itemid and url are present in the JSON, which one is used by the webmap?

0 Kudos
1 Solution

Accepted Solutions
GaetanPRU
New Contributor III

Hello,

Features layer item and webmap are not dynamically linked together. When you add a feature layer in a webmap the webservice's URL is saved in the json. So you have to change URL in all webmap if you change the feature layer datasource.

You could correct it without change the symbology if you use AGO Assistant to only change URL. You can do this automatically in all of your webmap using python too. See : https://developers.arcgis.com/python/sample-notebooks/using-and-updating-gis-content/

You just have to read all your webmaps' json and if you find your old url, change it with the new and save the new webmap's data json.

The ItemID in the json it makes it possible to link webmap and item in your content when you click on the option "Show more details" on a layer. It is not really useful but if the item ID is not correct you could have error message when the webmap is loaded. If you delete it, the option "Show more details" redirect to the ArcGIS Server REST page of your webservice. Maybe it will be usefull for something else with widget in application...

GaetanPRU

View solution in original post

0 Kudos
2 Replies
GaetanPRU
New Contributor III

Hello,

Features layer item and webmap are not dynamically linked together. When you add a feature layer in a webmap the webservice's URL is saved in the json. So you have to change URL in all webmap if you change the feature layer datasource.

You could correct it without change the symbology if you use AGO Assistant to only change URL. You can do this automatically in all of your webmap using python too. See : https://developers.arcgis.com/python/sample-notebooks/using-and-updating-gis-content/

You just have to read all your webmaps' json and if you find your old url, change it with the new and save the new webmap's data json.

The ItemID in the json it makes it possible to link webmap and item in your content when you click on the option "Show more details" on a layer. It is not really useful but if the item ID is not correct you could have error message when the webmap is loaded. If you delete it, the option "Show more details" redirect to the ArcGIS Server REST page of your webservice. Maybe it will be usefull for something else with widget in application...

GaetanPRU
0 Kudos
StefanieWenker
Occasional Contributor

Thank you for the explanation.

I was able to change the url in AGO assistant - and the itemid still points to the original feature layer in AGOL. I am also updating the url in the feature layer and have found that the layer id in mapservice on AGOL needs to be the same as the id tag in the Json for the feature layer (can also be changed in AGO assistant). 

0 Kudos