ArcGISvectorTileLayer: What's an ItemResourceCache and how do I make one?

518
1
05-30-2018 03:30 PM
NathanMellor
Occasional Contributor

One of the constructors for ArcGISVectorTiledLayer takes a vectorTileCache.

I'm hoping this one will let me specify a style for the vtpk without recreating an entire vtpk.

public ArcGISVectorTiledLayer (VectorTileCache vectorTileCache, ItemResourceCache itemResourceCache)

Creates a new ArcGISVectorTiledLayer from the specified VectorTileCache and ItemResourceCache objects. If itemResourceCache is null, it is equivalent to the constructor ArcGISVectorTiledLayer(VectorTileCache)

Parameters
vectorTileCachethe vector tile cache to use
itemResourceCachethe vector tile style to use
Throws
IllegalArgumentExceptionif vectorTileCache is null.

ItemResourceCache(String path)
Constructs an ItemResourceCache with absolute path to a directory containing item resources.

So how is the directory structured?

My best guess so far:

If I unzip a .vtpk, one of the folders inside is called p2/resources

Inside that folder there is:

fonts

info

sprites

styles

root.json.

Is this the structure I need to recreate?

Since there are no examples nor documentation on this, I though it was worth asking.

0 Kudos
1 Reply
JohnFannon
Occasional Contributor III

Hi Nathan

Did you ever work out how to do this?

I have a similar requirement to apply a different style to a a vector tile package. It seems like it's possible, but there's not much info on what the ItemResourceCache should look like!

0 Kudos