When attempting to update an existing hosted tile service in ArcGIS Online with a new tile package (.tpk) using the Import Tiles operation through the REST endpoint, the following error message is returned.
Invalid min scale in the specified source item
The tile package used to update the hosted tile service does not contain minimum and maximum scale values in the mapserver.json file. This only occurs if the tile package is created using the Create Map Tile Package tool. The Create Map Tile Package tool does not apply values for the minimum and maximum scale in the mapserver.json file of the created tile package. For more information, refer to BUG-000104517.
Solution or Workaround
Set the minimum and maximum scale of the tile package in the mapserver.json file to be the same as the hosted tile service before updating the tile service using the Import Tiles operation in ArcGIS Online.
- In ArcGIS Online, delete the tile package used to publish the hosted tile service to avoid duplicating the tile package in later steps.
- Copy the minimum and maximum scale values of the hosted tile service to update.
- In ArcGIS Online, open the item details page of the hosted tile service.
- Scroll to the URL section, and click View. The Services Directory page of the tile service is opened.
- Scroll to the Min Scale and Max Scale section, and copy the Min Scale and Max Scale values.
- Extract the tile package containing the updates and edit the mapserver.json file to paste the copied minimum and maximum scale values.
- In ArcMap, extract the tile package using the Extract Package tool. The contents of the extracted tile package are located in the specified output folder.
- Locate the extracted tile package folder, navigate to servicedescriptions > mapserver, and open the mapserver.json file in a text editor.
- Locate the minScale and maxScale parameters and replace their values with the values copied in Step 2(c).
- Save the JSON file.
- Repackage or compress (zip) the contents of the extracted tile package folder.
- Set the Archive name to be the same as the hosted tile service, and add a .tpk extension.
- Set the Archive format to ZIP, and the Compression level as Store.
- Click OK. The compressed file is in .tpk format.
- Upload the tile package to ArcGIS Online and copy its item ID.
- In ArcGIS Online, click Add Item > From my computer, and select the tile package.
- Uncheck the checkbox for Publish this file as a hosted layer.
- Enter the Title and Tags of the tile package and click Add Item. Ensure the title is the same as the hosted tile service to update.
- In the item details page of the uploaded tile package, copy the item ID in the URL.
- Update the hosted tile service with the uploaded tile package using the Import Tiles operation. The hosted tile service is updated with new tiles from the tile package. The status of the import operation can be viewed in the Tile Service Jobs Summary section in the Services Directory page.
- In the item details page of the hosted tile service, scroll to the URL section, and click View to open the REST page of the tile service.
- In the URL of the tile service REST page, type admin/ after rest/ as shown below, and press Enter.
- Scroll to the bottom of the page and click Import. Log in using the ArcGIS Online credentials if prompted.
- In the Source Item Id parameter, paste the copied tile package item ID, and click Import.