Select to view content in your preferred language

How to Change Vector Style by using ItemResourceCache

33
0
6 hours ago
ForrestKaye
New Contributor III
I am attempting to utilize the method in the maps sdk for android & ios to instantiate a vector tiled layer with a resource cache, but attempts to do so fail.  I am utilizing the method:
  • ArcGISVectorTiledLayer(vectorTileCache: VectorTileCache, itemResourceCache: ItemResourceCache?)
If I do not pass in the ItemResourceCache the VectorTiledLayer loads as expected.  
 
There are two issues I am trying to solve. 
  1. How can I generate a valid ItemResourceCache to change the styling of the VectorTiledLayer.  Is there a way to generate one through the 'vector style editor' and use this as a template style to apply to VTPK's? Or is the only way to download one through the 'ExportVectorTilesTask'?
  2. How can I apply style to a hosted Vector tile service so that I can download an ItemResourceCache? I am using my own basemap service for my testing but when I check the 'hasStyleResources' property to ensure that I can download the ItemResourceCache it says false.  I don't see a way to apply or generate a style to that service so that I can download the ItemResourceCache. 
 
As a side note I have used the sample here: 'https://developers.arcgis.com/swift/sample-code/download-vector-tiles-to-local-cache/' which has proved very useful but attempting to utilize my own vector service has not worked.
 
Ultimately my goal is to have a single style template/ItemResourceCache that I can apply to a packaged .vtpk file to change the display and look of the basemap.  At first I was under the impression that the .json file that you can download from the Vector Style Tile Editor would be all you need to pass in as the Item resource cache but that doesn't work. And any attempts to create my own resources.zip package with all the appropriate items to simulate an ItemResourceCache do not seem to work. 
 
Thanks,
0 Kudos
0 Replies