Select to view content in your preferred language

snippets to manage a web map with the ArcGIS API for Python

2930
6
04-04-2021 03:34 PM
AndresCastillo
MVP Alum
1 6 2,930

updateWMRenderer&Label

updateWMRenderer&Label.png

 

checkWMLayerOrder

checkWMLayerOrder.png

 

 

configureWMSearch

configureWMSearch_1.png

configureWMSearch_2.png

 

 

updateWMLayerItemID&ConfigurePopup

updateWMLayerItemID&ConfigurePopup.png

     

6 Comments
AndresCastillo
MVP Alum

The methodology to update a web map can be summarized as such:

1

Get the web map json (item.get_data())

Similar to the ArcGIS Rest API:
https://developers.arcgis.com/rest/users-groups-and-items/item-data.htm

2
Prepare the web map dictionary by overwriting the chosen dictionary values with the desired values:

3
Update the target web map (item.update(item_properties=desired web map dictionary keys:values))

Similar to the ArcGIS Rest API:

https://developers.arcgis.com/rest/users-groups-and-items/update-item.htm

by Anonymous User
Not applicable

thanks for sharing. 

I've been using the above approach updating the layer source, i.e to point a layer Url into another one

AndresCastillo
MVP Alum

Excellent @Anonymous User , thank you for commenting.

GPGeoespacialIDSM
Occasional Contributor

That's great, thanks for the write-up. But it would be really nicer and helpful if your snippets were posted as code blocks instead of images, don't you think?

MehdiPira1
Esri Contributor

Thanks @AndresCastillo .

davedoesgis
Frequent Contributor

Thanks for these tips.

These would be more useful as code blocks for copy/paste ease. Someone already mentioned that above, but it also would help with SEO, because I will probably never find this post later when I need it. Adding a bit of text with keywords about what these do will help. I know what updateWMLayerItemID means when I read it, for example, but I'll never manage to search on that months from now when I actually need to do it. 

 

Contributors
About the Author
I am really interested in Programming. GeoNet MVP.