Select to view content in your preferred language

How to change web map "Offline Mode" and "Offline: Advanced Options"?

1383
3
07-31-2021 02:59 PM
GB_MattPanunto_GISS
Frequent Contributor

I'm looking to replicate a web map's switch for "Enable offline mode" via ArcGIS Python API, but am not having much luck figuring out how. All I can find are options for managing actual offline areas, which I do not want to do. Seems like this should be a simple option:

GB_MattPanunto_GISS_0-1627768735191.png

 

Additionally, I'm also wanting to change the "Offline: Advanced Options". I found this documentation, but it doesn't seem to be working for me. When I submit a dictionary key and value, as shown below, all I get is "TypeError: 'dict' object is not callable". Am I doing something wrong?

webmap_obj.offline_areas.offline_properties({"download":"features"})

 

GB_MattPanunto_GISS_1-1627768774529.png

 

3 Replies
MarkEastwood
Frequent Contributor

@GB_MattPanunto_GISS were you able to figure out how to switch the "Offline Mode" on/off? I was having the same issue recently, any time I updated my webmaps using the python api, the "Offline Mode" would automatically switch to off. 

I was able to preserve the original web map configuration using the following update syntax...

web_map_obj.update({'typeKeywords': ",".join(wm_item.typeKeywords)})

 

I was also able to manually set the setting with a similar update syntax...

web_map_obj.update({'typeKeywords':'ArcGIS Online, CollectorDisabled, Data Editing, Explorer Web Map, Map, Offline, Online Map, useOnly, Web Map'})

 

The important part for the "Offline Mode" toggle is to have "Offline" in the typeKeywords.

vpelleritoCritigen
Emerging Contributor

That works! Thanks, @MarkEastwood.

For clarity, the update method used is for the arcgis.mapping.Webmap module.

0 Kudos
jtmouw_NCDOT
Regular Contributor

Hi, did this ever get reported as a bug or go anywhere? We are experiencing this, where even if the map has "Offline" in its keywords, if we update with the Python API it removes it. We are going to use your workaround to prevent this (thank you!) but this certainly is not expected behavior...

0 Kudos