Retrieve Webmap Offline Areas with Python

224
1
Jump to solution
03-06-2023 12:36 PM
danbecker
Occasional Contributor III

I'm moving webmaps from on-prem Enterprise to an Azure Enterprise site that we're migrating to. I need help with retrieving the webmap offline area properties, so the offline areas can be re-created on the target Enterprise site using:

 

webmap.offline_areas.create(area,item_properties)

 

 

I just can't figure out how to retrieve the offline area "area" property?

Here's what I have so far

 

wm = WebMap(source_item)
    map_areas = wm.offline_areas.list()
    if len(map_areas)>0:
        for ma in map_areas:
            print(ma.title)
            print(ma.get_data())

 

 

 

Area1
{'mapAreas': {'mapAreaTileScale': {'minScale': 147914382, 'maxScale': 2500}, 'mapAreaRefreshParams': {'startDate': '2022-04-12T12:51:22.179Z', 'type': 'weekly', 'nthDay': 1, 'dayOfWeek': 2}, 'mapAreasScheduledUpdatesEnabled': False}}

 

 

But how do I access the area property of the offline area?

0 Kudos
1 Solution

Accepted Solutions
danbecker
Occasional Contributor III

Here's how to retrieve the x,y extents of a webmap offline area:

source_wm = WebMap(source_item)
map_areas = source_wm.offline_areas.list()
if len(map_areas)>0:
    for ma in map_areas:
        offline_item_extent = ma.properties['extent']

View solution in original post

0 Kudos
1 Reply
danbecker
Occasional Contributor III

Here's how to retrieve the x,y extents of a webmap offline area:

source_wm = WebMap(source_item)
map_areas = source_wm.offline_areas.list()
if len(map_areas)>0:
    for ma in map_areas:
        offline_item_extent = ma.properties['extent']
0 Kudos