AnsweredAssumed Answered

publishing tile package does not 'publish tiles' for tile layer

Question asked by mbrc on May 11, 2017

I started using ArcGIS API for Python since yesterday. Today I found there is a problem publishing tiles automatically. The following is my script,

from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com", "username", "password")
cm = gis.content
data = r"something.tpk"
item = cm.add({}, data=data)
if item != None:
     print(item)
     tiledServiceItem = item.publish()
     if tiledServiceItem != None:
          print("published")

It successfully created a tile package and a tile layer in ArcGIS Online but 'publish tiles' didn't work.

I've tried manually uploading the tile package and publishing it and it worked perfectly. I tracked the network requests and found the manual process had a 'edit' map service to update minScale, maxScale and sourceItemId properties. Not sure if it is a bug or my coding error. Any suggestion?

Outcomes