Select to view content in your preferred language

Adjust theme of vector layer using a json file

476
1
12-08-2022 12:46 AM
JulianBissekkou
Emerging Contributor

We have a vector layer style as .json file on the device. In the web sdk we are able to change the style of a vector layer using the setStyle method.

https://developers.arcgis.com/javascript/3/jsapi/vectortilelayer-amd.html#setstyle

 

This method is not available on Android and iOS. Is there another way of doing that?

 

 

0 Kudos
1 Reply
Shubham_Sharma
Esri Contributor

Use the following constructor, and set the style using the "ItemResourceCache"

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:
vectorTileCache - the vector tile cache to use
itemResourceCache - the vector tile style to use

 

Check out the Android sample: ArcGIS vector tiled layer (custom style)

0 Kudos