<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Enabling offline mode with arcgis api in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1039640#M5786</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a script that updates the vector basemap, what I would like for the script to do is enable offline mode after it has updated the vector basemap I have done a lot of searching and cant seem to find the code that would enable this. below is a copy of the script.&lt;/P&gt;&lt;P&gt;I imagine it would come in under this line # Replace Field Maps Basemap&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Name: CreateVectorTilePackage.py&lt;BR /&gt;# Description: Find all the maps in the project and&lt;BR /&gt;# create a vector tile package for each map&lt;BR /&gt;# import system modules&lt;BR /&gt;import os&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;#set environment settings&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Share Field Maps Basemap package online&lt;BR /&gt;print("Starting Packaging Basemap")&lt;BR /&gt;TempHarvestBasemap = arcpy.SharePackage_management(r"L:\GIS\ArcGIS Pro Projects\Vector_Tiles\TempPackages\TEMPFieldMapsBasemap.vtpk", "AUSERNAME", "APASSWORD",&lt;BR /&gt;"Authoritive Field Collection Base Map", "Field, Vector Basemap", "Created from arcgis pro vector tiles",&lt;BR /&gt;"MYGROUPS", "ABC", "MYORGANIZATION", "True",&lt;BR /&gt;"Packages")&lt;BR /&gt;print("Uploaded TempFieldMapsBasemap")&lt;/P&gt;&lt;P&gt;# Login to AGOL&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;gis = GIS("&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;", "AUSERNAME", "APASSWORD")&lt;BR /&gt;print("Logged in")&lt;BR /&gt;# Update the Field Maps Base Map&lt;BR /&gt;# Search for a layer&lt;BR /&gt;print("searching for layer")&lt;BR /&gt;package = gis.content.search(query="title:TempFieldMapsBasemap",item_type="Vector Tile Layer" )[0]&lt;/P&gt;&lt;P&gt;# Replace Field Maps Basemap&lt;BR /&gt;print ("replacing field maps basemap")&lt;BR /&gt;gis.content.replace_service('503aacb9c3c146f0ba5d25847ebd6f87',package,"FieldMapsBaseREPLACE",True)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Search for update layer&lt;BR /&gt;print ("searching for temporary layer")&lt;BR /&gt;package = gis.content.search(query="title: FieldMapsBaseREPLACE",item_type="Vector Tile Layer" )[0]&lt;/P&gt;&lt;P&gt;# Delete Update Layer&lt;BR /&gt;print("deleting temporary layer")&lt;/P&gt;&lt;P&gt;package.delete()&lt;/P&gt;&lt;P&gt;print ("Done")&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Tue, 23 Mar 2021 03:23:39 GMT</pubDate>
    <dc:creator>RoryBennison</dc:creator>
    <dc:date>2021-03-23T03:23:39Z</dc:date>
    <item>
      <title>Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1039640#M5786</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a script that updates the vector basemap, what I would like for the script to do is enable offline mode after it has updated the vector basemap I have done a lot of searching and cant seem to find the code that would enable this. below is a copy of the script.&lt;/P&gt;&lt;P&gt;I imagine it would come in under this line # Replace Field Maps Basemap&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Name: CreateVectorTilePackage.py&lt;BR /&gt;# Description: Find all the maps in the project and&lt;BR /&gt;# create a vector tile package for each map&lt;BR /&gt;# import system modules&lt;BR /&gt;import os&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;#set environment settings&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Share Field Maps Basemap package online&lt;BR /&gt;print("Starting Packaging Basemap")&lt;BR /&gt;TempHarvestBasemap = arcpy.SharePackage_management(r"L:\GIS\ArcGIS Pro Projects\Vector_Tiles\TempPackages\TEMPFieldMapsBasemap.vtpk", "AUSERNAME", "APASSWORD",&lt;BR /&gt;"Authoritive Field Collection Base Map", "Field, Vector Basemap", "Created from arcgis pro vector tiles",&lt;BR /&gt;"MYGROUPS", "ABC", "MYORGANIZATION", "True",&lt;BR /&gt;"Packages")&lt;BR /&gt;print("Uploaded TempFieldMapsBasemap")&lt;/P&gt;&lt;P&gt;# Login to AGOL&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;gis = GIS("&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;", "AUSERNAME", "APASSWORD")&lt;BR /&gt;print("Logged in")&lt;BR /&gt;# Update the Field Maps Base Map&lt;BR /&gt;# Search for a layer&lt;BR /&gt;print("searching for layer")&lt;BR /&gt;package = gis.content.search(query="title:TempFieldMapsBasemap",item_type="Vector Tile Layer" )[0]&lt;/P&gt;&lt;P&gt;# Replace Field Maps Basemap&lt;BR /&gt;print ("replacing field maps basemap")&lt;BR /&gt;gis.content.replace_service('503aacb9c3c146f0ba5d25847ebd6f87',package,"FieldMapsBaseREPLACE",True)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Search for update layer&lt;BR /&gt;print ("searching for temporary layer")&lt;BR /&gt;package = gis.content.search(query="title: FieldMapsBaseREPLACE",item_type="Vector Tile Layer" )[0]&lt;/P&gt;&lt;P&gt;# Delete Update Layer&lt;BR /&gt;print("deleting temporary layer")&lt;/P&gt;&lt;P&gt;package.delete()&lt;/P&gt;&lt;P&gt;print ("Done")&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 03:23:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1039640#M5786</guid>
      <dc:creator>RoryBennison</dc:creator>
      <dc:date>2021-03-23T03:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1040653#M5811</link>
      <description>&lt;P&gt;I'm trying to "Enable Offline Mode" for a map (I'm actually trying to disable Offline Mode).&amp;nbsp; &amp;nbsp;There's an Offline Map Area Manager in the Python API.&amp;nbsp;&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.mapping.html#offlinemapareamanager" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.mapping.html#offlinemapareamanager&lt;/A&gt;&amp;nbsp; But it's not clear to me how to Enable or Disable Offline Mode (just like under Settings "Enable Offline Mode").&amp;nbsp; &amp;nbsp; Not sure if you're asking a similar question or not.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 16:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1040653#M5811</guid>
      <dc:creator>KarenRobine1</dc:creator>
      <dc:date>2021-03-25T16:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170265#M7360</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/303886"&gt;@KarenRobine1&lt;/a&gt;&amp;nbsp;- Were you able to find a way to Enable/Disable the "Enable Offline Mode" parameter using the Python API?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 17:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170265#M7360</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2022-05-03T17:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170323#M7362</link>
      <description>I haven’t investigated it for a while. I think there might be a way by sharing the webmap ...&lt;BR /&gt;</description>
      <pubDate>Tue, 03 May 2022 19:38:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170323#M7362</guid>
      <dc:creator>RoryBennison</dc:creator>
      <dc:date>2022-05-03T19:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170558#M7366</link>
      <description>&lt;P&gt;My notes for this are a little fuzzy. I had done this in AGOL Assistant.&amp;nbsp; But under typeKeywords, I added "Offline".&amp;nbsp; I wonder if you can programmatically do this using the item Properties?&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 12:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1170558#M7366</guid>
      <dc:creator>KarenRobine1</dc:creator>
      <dc:date>2022-05-04T12:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1179857#M7457</link>
      <description>&lt;P&gt;I posted a possible solution to this here -&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-change-web-map-quot-offline-mode-quot-and/m-p/1084735#M6421" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-change-web-map-quot-offline-mode-quot-and/m-p/1084735#M6421&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 16:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1179857#M7457</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2022-06-03T16:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239519#M8135</link>
      <description>&lt;P&gt;Has anyone found a solution to the OP's issue which relates to Vector Tile Layers and not Web Maps?&amp;nbsp; I'm encountering the same issue with trying to automate the refreshing of Vector Tile Services.&amp;nbsp; My script uses the same methods as the OP to upload a new vtpk, publish a vector tile service from it and then replace the production service with the new service.&amp;nbsp; When it does this, it looks like everything except 'offline' mode is maintained.&amp;nbsp; The production service has 'offline' mode enabled, but after replacing it, the 'offline' mode is disabled.&lt;/P&gt;&lt;P&gt;I don't think the method for enabling offline mode on web maps via the typeKeywords will work for Vector Tile Services as 'Offline' isn't a listed keyword for this item type.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dan_Joyce_OE_0-1670556480326.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58088i5868D1B3895EE43F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dan_Joyce_OE_0-1670556480326.png" alt="Dan_Joyce_OE_0-1670556480326.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 03:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239519#M8135</guid>
      <dc:creator>Dan_Joyce_OE</dc:creator>
      <dc:date>2022-12-09T03:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239527#M8136</link>
      <description>&lt;P&gt;Check out this blog post&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/enable-offline-mode-tile-layer-hosted/m-p/1131448#M6973" target="_blank" rel="noopener"&gt;Solved: Re: Enable Offline Mode - Tile Layer(hosted) - Esri Community&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;I was having problems getting it working but I was trying to run it through a docker installation. I ran into this bug - BUG-000149882 Python API's VectorTileLayerManager.edit_tile_service export_tiles_allowed has No Effect when using Docker Image Installation. Depending on your setup the code I added in the attached post should work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 05:12:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239527#M8136</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2022-12-09T05:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239532#M8137</link>
      <description>&lt;P&gt;Unfortunately, not this didn't work for me.&amp;nbsp; My Vector Tile Layer is in AGOL, and even though I'm logged in with the Admin account, I can't create the VectorTileLayerManager object.&amp;nbsp; I suspect this is because the url for the service is not an admin url...but I don't know how to get an admin url...unless it's as simple as inserting 'admin' in the correct location in the path?&lt;/P&gt;&lt;P&gt;Here is a snippet I'm running in Jupyter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;vts = gis.content.get(item.id)
print(vts.type)
vtl = VectorTileLayer.fromitem(vts)
print(vtl)
for k in dir(vtl):
    print(k)
        
vtl_manager = vtl.manager&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;Vector Tile Service
&amp;lt;VectorTileLayer url:"https://tiles.arcgis.com/tiles/xxxxxxxxxxxx/arcgis/rest/services/Refresh_Test_VTP/VectorTileServer"&amp;gt;
__class__
__delattr__
__dict__
__dir__
__doc__
__eq__
__format__
__ge__
__getattribute__
__gt__
__hash__
__init__
__init_subclass__
__le__
__lt__
__module__
__ne__
__new__
__reduce__
__reduce_ex__
__repr__
__setattr__
__sizeof__
__str__
__subclasshook__
__weakref__
_con
_gis
_hydrate
_hydrated
_invoke
_lyr_dict
_lyr_domains
_lyr_json
_refresh
_time_filter
_token
_url
filter
fromitem
info
properties
styles
tile_fonts
tile_sprite
url
vector_tile&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;AttributeError&lt;/SPAN&gt;                            Traceback (most recent call last)
&lt;SPAN class=""&gt;&amp;lt;ipython-input-27-402e9dbb5c0b&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;     25&lt;/SPAN&gt;             print&lt;SPAN class=""&gt;(&lt;/SPAN&gt;k&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;     26&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;---&amp;gt; 27&lt;/SPAN&gt;         vtl_manager &lt;SPAN class=""&gt;=&lt;/SPAN&gt; vtl&lt;SPAN class=""&gt;.&lt;/SPAN&gt;manager

&lt;SPAN class=""&gt;AttributeError&lt;/SPAN&gt;: 'VectorTileLayer' object has no attribute 'manager'&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Dec 2022 06:52:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239532#M8137</guid>
      <dc:creator>Dan_Joyce_OE</dc:creator>
      <dc:date>2022-12-09T06:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239844#M8144</link>
      <description>&lt;P&gt;I think I was running into a similar error as well and it had to do with the version of Python I was using.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 22:13:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1239844#M8144</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2022-12-09T22:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1240475#M8153</link>
      <description>&lt;P&gt;It's got me beat...will revert to an alternative approach.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Python 3.7.11 [MSC v.1927 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt; import arcgis
&amp;gt;&amp;gt;&amp;gt; arcgis.__version__
'1.9.1'
&amp;gt;&amp;gt;&amp;gt; for i in dir(arcgis.mapping):
...   print(i)
...
BuildingLayer
FormCollection
FormElement
FormExpressionInfo
FormFieldElement
FormGroupElement
FormInfo
IntegratedMeshLayer
MapFeatureLayer
MapImageLayer
MapImageLayerManager
MapRasterLayer
MapServiceLayer
MapTable
Object3DLayer
OfflineMapAreaManager
PackagingJob
Point3DLayer
PointCloudLayer
SceneLayer
VectorTileLayer
WebMap
WebScene
__all__
__builtins__
__cached__
__doc__
__file__
__loader__
__name__
__package__
__path__
__spec__
_basemap_definitions
_msl
_scenelyrs
_types
_utils
create_symbol
display_colormaps
export_map
forms
generate_renderer
get_layout_templates
renderer
show_styles
symbol&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 06:09:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1240475#M8153</guid>
      <dc:creator>Dan_Joyce_OE</dc:creator>
      <dc:date>2022-12-13T06:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling offline mode with arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1546545#M10746</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Unsure if this is still affecting you but I thought I'd post my solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis.server import Server
sourceServ = Server(gis=sourceGIS, url="https://exampleenterpriseurl/server")

#In this instance I want to find a service in the hosted folder of a specific URL.
## Almost certainly a better way of doing this!
vbmSearch = [serv for serv in sourceServ.services.list(folder="Hosted") if serv.url == "https://exampleenterpriseurl/server/services/Hosted/VectorBasemap.VectorTileServer"]
if vbmSearch:
    vbmService = vbmSearch[0]
    newProp = vbmService.properties
    newProp['exportTilesAllowed'] = True    
    vbmService.edit(newProp)&lt;/LI-CODE&gt;&lt;P&gt;Where "sourceGIS" is a typical GIS portal connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 14:35:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/enabling-offline-mode-with-arcgis-api/m-p/1546545#M10746</guid>
      <dc:creator>MorganLancaster</dc:creator>
      <dc:date>2024-10-08T14:35:50Z</dc:date>
    </item>
  </channel>
</rss>

