edit_tile_service doesn't work and returns JSON instead of boolean

05-10-2022 11:27 AM
New Contributor III

I am trying to automatically switch one of our basemaps to be available for offline use by setting the appropriate flags in edit_tile_service (https://developers.arcgis.com/python/api-reference/arcgis.raster.toc.html#arcgis.raster.ImageryLayer...).  The documentation indicates that it should return a boolean indicating success or failure, but all I get is the JSON for the service.  For example, if I run this: 


then I get the JSON, and nothing is changed.

If I go into the server administrator and then edit the JSON manually by adding exportTilesAllowed and maxExportTilesCount then it works fine.

The server version is 10.9.1 and ArcGIS Pro 2.9.2.  The procedure is as follows:

  1. Publish tpkx to portal using arcpy.SharePackage_management
  2. Use this published service to replace the existing basemap service using arcpy.ReplaceWebLayer_server
  3. Enable the basemap for offline use using myImageryLayer.edit_tile_service(export_tiles_allowed=True, max_export_tile_count=99999)

Other than the offline use, this procedure works fine.  The basemap is updated to use the new imagery, but our users can't use it offline unless I manually enable it.

Tags (2)
0 Kudos
0 Replies