Select to view content in your preferred language

Determining which maps have offline areas in the "Managed Offline Areas"

235
2
2 weeks ago
Labels (2)
MichaelBruening
Frequent Contributor

I am trying to find if there is a means of programmatically determining which Map Viewer within my ArcGIS Online organization has Maps that are currently set to package map packages. I need to run through and stop some of these maps that have this functionality set up for them. I provide a screenshot below of the area that I am talking about.

 

Any ideas would be greatly appreciated.

MichaelBruening_0-1758629802831.png

 

2 Replies
gis_KIWI4
Frequent Contributor

 

 

@MichaelBruening - You can use a python notebook in AGOL.
Run the below code - 

 

from arcgis.gis import GIS
import pandas as pd

gis = GIS("home")

# Search org
webmaps = gis.content.search(
    query='type:"Web Map" AND typekeywords:"Offline"', 
    max_items=10000, 
    outside_org=False
)

rows = []
for wm in webmaps:
    # offline areas
    areas = wm.related_items("Map2Area", "forward")
    if areas:
        for a in areas:
            rows.append({
                "webmap_title": wm.title,
                "webmap_id": wm.id,
                "map_area_title": a.title,
                "map_area_id": a.id
            })

df = pd.DataFrame(rows)
df
​

 

You should see a list of all webmaps and the areas associated with them. 

gis_KIWI4_0-1758843770223.png

 

0 Kudos
MichaelBruening
Frequent Contributor

Hello, I will run this code on either Monday or Tuesday and let you know what happens. I appreciate you sharing this and will return with an answer

0 Kudos