Select to view content in your preferred language

How do I “bump” a webmap in code to make it available to QuickCapture?

375
1
a week ago
Dirk_Vandervoort
Frequent Contributor

Short story: I am using Python to create and fully hydrate a QuickCapture project. QuickCapture requires a webmap so I create one:

from arcgis.map import Map
new_map = Map()
new_map.extent = {
    "spatialReference": {"wkid": 102100},
    "xmin": -13800000,
    "ymin": 3600000,
    "xmax": -11300000,
    "ymax": 6200000
}

# Save as a new WebMap item
 my _item = new_map.save({
     "title": project_name,
     "tags": ["webmap", "python"],
     "snippet": "WebMap focused on the somewhere USA"
 })

In code I can do things in code like set the basemap, change the extent, change the thumbnail, add operational layers, changing the snippet, etc. 

This creates a fully (almost) functional webmap. I can open it in the Map Viewer. It looks great. 

Note that I have not saved the WebMap in the Map Viewer. So far it is entirely built in code.

When I add the webmap to a QuickCapture project, and open the project in the QuickCapture app. I get this error:

Dirk_Vandervoort_0-1755211502104.png

If I open the webmap in the Map Viewer and simply change the extent and save the webmap, the webmap loads in the QuickCapture app just fine:

Dirk_Vandervoort_1-1755211528073.png

We do not want to have to manually open, bump, and save the webmap in ArcGIS Online. We changed the map extent in code still without creating a QuickCapture-worthy webmap.

My question is:

How can I programmatically “bump” the webmap so it loads in QuickCapture?

I hope you can help. TIA

0 Kudos
1 Reply
Dirk_Vandervoort
Frequent Contributor

UPDATE: I've managed to successfully added the webmap as the QuickCapture project webmap by essentially rebuilding the QC configuration as a dictionary. 

HOWEVER: The map does not display the operational layers in QuickCapture that I have added to the webmap in code. I still have to bump-and-save in order for the operational layers to be visible.. Note that the rudimentary layer list in QuickCapture correctly lists the operational layers, they are just not visible in the map.

0 Kudos