Searching for Web Maps in Portal and querying if saved in Classic or New Map Viewer

252
2
Jump to solution
04-14-2024 08:31 PM
Kalu_Ribush
New Contributor II

Hello

When searching for web map in the Portal, for example using python below:

webmaps_contents = gis.content.search("*",item_type="Web Map", max_items=500)

Is it possible to filter for Web Maps saved in Classic or the New Map Viewer?

Or can this be done with with an if statement in a loop:

for webmap_item in webmaps_contents:

    if webmap_item. .....

 

Thanks

 

0 Kudos
2 Solutions

Accepted Solutions
EarlMedina
Esri Regular Contributor

I think one way you might be able to do this is:

for webmap in webmaps_contents :
    data = webmap.get_data()
    authoring_app = d["authoringApp"]
    if authoring_app  == "ArcGISMapViewer"
        # Created with new MapViewer
        pass
    else:
       # Classic webmap (authoring_app is "WebMapViewer")
       pass

 

At least, based on my observations the Authoring App value is "ArcGISMapViewer" for the new MapViewer and "WebMapViewer" for the classic MapViewer.

View solution in original post

Kalu_Ribush
New Contributor II

Thank you.  Worked with a  couple of tweaks:

 

for webmap in webmaps_contents :
    data = webmap.get_data()
    authoring_app = data["authoringApp"]
    if authoring_app  == "ArcGISMapViewer":
        # Created with new MapViewer
        pass
    else:
       # Classic webmap (authoring_app is "WebMapViewer")
       pass

View solution in original post

0 Kudos
2 Replies
EarlMedina
Esri Regular Contributor

I think one way you might be able to do this is:

for webmap in webmaps_contents :
    data = webmap.get_data()
    authoring_app = d["authoringApp"]
    if authoring_app  == "ArcGISMapViewer"
        # Created with new MapViewer
        pass
    else:
       # Classic webmap (authoring_app is "WebMapViewer")
       pass

 

At least, based on my observations the Authoring App value is "ArcGISMapViewer" for the new MapViewer and "WebMapViewer" for the classic MapViewer.

Kalu_Ribush
New Contributor II

Thank you.  Worked with a  couple of tweaks:

 

for webmap in webmaps_contents :
    data = webmap.get_data()
    authoring_app = data["authoringApp"]
    if authoring_app  == "ArcGISMapViewer":
        # Created with new MapViewer
        pass
    else:
       # Classic webmap (authoring_app is "WebMapViewer")
       pass
0 Kudos