Select to view content in your preferred language

Retrieve Webmap Offline Areas with Python

418
2
Jump to solution
03-06-2023 12:36 PM
danbecker
Frequent Contributor

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
Frequent Contributor

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
2 Replies
danbecker
Frequent Contributor

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
vijaybadugu
Frequent Contributor

How to get actual geometry of it ?

0 Kudos