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 - 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.
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