Select to view content in your preferred language

How to call the min_scale and max_scale of a previously created offline area

515
1
10-19-2022 07:13 PM
SamuelMcAuley
New Contributor II

I am attempting to recreate an existing offline area of my web map using a Python script that I can schedule to run overnight. Using the Python API documentation I am using the recommended workflow of calling my webmap like so:

 

WebMap(portalItem)

Then I am duplicating it's existing properties like so:

offline_area = WebMap(portalItem).offline_areas.list()[0]

name = offline_area.title

properties = {'description': 'ENTER DESCRIPTION HERE', 'name': name+'_V2'}

extent = offline_area.properties['extent']

wkid = extent['spatialReference']['wkid']

xmin = extent['xmin']

xmax = extent['xmax']

ymin = extent['ymin']

ymax = extent['ymax']

 

However, I cannot work out how to extract the minimum scale and maximum scale of the existing offline area. This is apparently not one of the properties of the map area itself. Is it possible to call this property of the map area so that I can recreate the map area with the same minimum and maximum scales?

 

0 Kudos
1 Reply
SamuelMcAuley
New Contributor II

SOLVED - I have since spoken with someone at ESRI who provided support for this question. You can view the map area information with this bit of code:

 

#First call your offline area associated with your web map

Offline_area = WebMap(Portal_map_item).offline_areas.list()[0]

#Then call the JSON for the properties of that map area

Map_area_json=Offline_area.get_data(try_json=True)

Map_area_json

 

0 Kudos