Select to view content in your preferred language

unable to access webmap definition in version 2.4

193
2
12-04-2024 01:16 PM
Labels (1)
TrishPeller
Emerging Contributor

I have a script that, in version 2.3, accesses the webmap definition property ("wm.definition"). This property does not appear to be refactored in the new Map class (it's not listed here: https://developers.arcgis.com/python/latest/guide/overview24/). Is there another way to access the webmap definition that I'm missing?

 

0 Kudos
2 Replies
Clubdebambos
MVP Regular Contributor

Hi @TrishPeller 

It is not present as a property for the Map class. You can access the same information using the Item object get_data() method.

from arcgis.gis import GIS

## access AGOL
agol = GIS("home")

## get the WebMap Item as an Item object
wm_item = agol.content.get("WM_ITEM_ID")

## get the WebMap definition
wm_def = wm_item.get_data()

print(wm_def)
~ learn.finaldraftmapping.com
0 Kudos
TrishPeller
Emerging Contributor

This works for me, thank you!

I'm relatively new at working with this api. Is it common for ESRI to introduce a bunch of breaking changes with a minor version update? That is not a good recipe for a good developer experience.

 

0 Kudos