Select to view content in your preferred language

Published Layer Cannot be Added?

1705
7
Jump to solution
01-05-2017 12:17 PM
LesiMai3
Deactivated User

Hi,

I tried to publish a vector tile layer using a vector tile package that is already in ArcGIS Online. The API was able to publish the data but I got an error message saying the layer cannot be added to the map when I tried to do so. I've also tried the same code on an SD and it worked just fine.

Any ideas?

Thank you,

Lesi 

0 Kudos
1 Solution

Accepted Solutions
RohitSingh2
Esri Contributor

Hi Lesi,

Thank you for pointing me to the vtpk item. I was able to look into this and found that the API needed to set a parameter to build the initial cache when publishing Vector Tile Packages, that was not being set. We'll include the fix in the next update, but for now (with version 1.0), you can add the following line in gis.py at c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis.py

line 3027:

                buildInitialCache = True

This should resolve the problem.

Thanks,

Rohit

View solution in original post

0 Kudos
7 Replies
RohitSingh2
Esri Contributor

Hi Lesi,

Are you trying to add a vector tile layer to the map widget? The map widget currently does not support vector tile layers. This is planned for a future update.

Thanks,

Rohit

LesiMai3
Deactivated User

Hi Rohit,

Thanks for the clarification! I didn't use the map widget in the API. I was trying to manually add the vector tile layer published using the API to a map and got the message that it couldn't be added. Should that be the case?

Thank you,

Lesi

0 Kudos
RohitSingh2
Esri Contributor

Hi Lesi,

Thanks for the clarification. I would expect to be able to add the published vector tile layer to a map. Is the vector tile layer public - perhaps I could try and figure out whats going on?

Thanks,

Rohit

0 Kudos
LesiMai3
Deactivated User

Hi Rohit,

Sure! Here is the link to the vector tile package.

Thank you,

Lesi

0 Kudos
RohitSingh2
Esri Contributor

Hi Lesi,

Thank you for pointing me to the vtpk item. I was able to look into this and found that the API needed to set a parameter to build the initial cache when publishing Vector Tile Packages, that was not being set. We'll include the fix in the next update, but for now (with version 1.0), you can add the following line in gis.py at c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis.py

line 3027:

                buildInitialCache = True

This should resolve the problem.

Thanks,

Rohit

0 Kudos
LesiMai3
Deactivated User

Thank you, Rohit!

0 Kudos
RobertWeber
Regular Contributor

What about using add_layer() to add a hosted Tile Layer published from a TPK to a web map?  The API docs say to reference TileLayer (MapImageLayer does not display tiled images. To display tiled map service layers, see TileLayer.) but I cannot find anything that helps...

When I add the item with add_layer() it zooms to the extent of the item but the tiles don't render.

0 Kudos