Enable Offline Mode of a map

1459
6
03-25-2021 09:22 AM
KarenRobine1
New Contributor III

I'm trying to duplicate the "Enable Offline Mode" functionality of a map using the  ArcGIS Python API. I see there's an Offline Map Area Manager: https://developers.arcgis.com/python/api-reference/arcgis.mapping.html#offlinemapareamanager  but that doesn't seem to have anything about actually setting a map to be offline enabled (I'm actually trying  to do the opposite:  A map is offline enabled. I want to use the Python API to turn that off).

Thoughts?  

0 Kudos
6 Replies
MehdiPira1
Esri Contributor

@KarenRobine1 ,

There is a Sync capability in ArcGIS Python API, when enabled in a feature layer, you can then create replicas for offline use and sync the updates back to the server to update features.

you also have the option to unregister a replica (sort of disabling offline updates).

The following link provides a guide with some examples about how to use replicas:

https://developers.arcgis.com/python/guide/checking-out-data-from-feature-layers-using-replicas/

I hope that helps.
Mehdi

0 Kudos
KarenRobine1
New Contributor III

Nope. Sorry. That's not how I want to handle this.  My question was related to updating it within the map (not Feature Layer). In some of my maps, the Feature Layer is for offline use. In other maps, the Feature Layer is for online use. Essentially I want to duplicate the functionality the "Enable Offline mode" toggle performs (see following image) which is associated with a maps settings.

 

KarenRobine1_0-1617022825383.png

 

0 Kudos
GB_MattPanunto_GISS
Occasional Contributor II

I'm also looking to replicate that switch for "Enable offline mode" via ArcGIS Python API, but am not having much luck figuring out how. Did you ever figure this out? All I can find are options for managing actual offline areas, which I do not want to do.

 

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

 

 

0 Kudos
MarkEastwood
Occasional Contributor II

@GB_MattPanunto_GISS - Were you able to find a way to Enable/Disable the "Enable Offline Mode" parameter using the Python API?

0 Kudos
GB_MattPanunto_GISS
Occasional Contributor II

@MarkEastwood No, I haven't, unfortunately.

0 Kudos
MarkEastwood
Occasional Contributor II
0 Kudos