Select to view content in your preferred language

Web Map Item Page Pointing To Wrong Data Source

69
2
Jump to solution
yesterday
Labels (2)
AustinAverill
Frequent Contributor

I recently had to regenerate a joined view layer in my organization due to having updated the schema of the underlying feature services. Since this joined view was deployed across a couple of web maps with valid symbology and pop-up definitions, I elected to update the service URL in the web maps directly using the ArcGIS  API for Python:

from arcgis.gis import GIS
gis = GIS(url, un, pw)

webmap = gis.content.get(webmapid)
map_def = webmap.get_data()

new_service_url = "https://services6.arc..."

map_def['operationalLayers'][1]['url'] = new_service_url

webmap.update(data=map_def)

 

This method worked like a charm and when the webmap is opened in MapViewer or its definition is retrieved using the above method, the appropriate layer is being displayed. However, in the item details page for these web maps, if I click the layer that I updated the service url for, it is still pointing to the previous joined view layer.

 

Any ideas?

0 Kudos
1 Solution

Accepted Solutions
MobiusSnake
MVP Regular Contributor

If you read the web map JSON in a text editor you should see an Item ID associated with the layer, it needs to be updated independent of the URL.

View solution in original post

0 Kudos
2 Replies
MobiusSnake
MVP Regular Contributor

If you read the web map JSON in a text editor you should see an Item ID associated with the layer, it needs to be updated independent of the URL.

0 Kudos
AustinAverill
Frequent Contributor

Worked like a charm. I guess I assumed that the service details like that were defined from the REST url and didn't need to be manipulated separately.

0 Kudos