Load an ArcGIS vector tiled layers using custom styles.

Use case
Vector tile basemaps can be created in ArcGIS Pro and published as offline packages or online services. You can create a custom style tailored to your needs and easily apply them to your map. ArcGISVectorTiledLayer has many advantages over traditional raster based basemaps (ArcGISTiledLayer), including smooth scaling between different screen DPIs, smaller package sizes, and the ability to rotate symbols and labels dynamically.
How to use the sample
Pan and zoom to explore the vector tile basemap. Select a theme to see it applied to the vector tile basemap.
How it works
- Create an
ArcGISVectorTiledLayerwith the URL of a custom style from AcrGIS Online. - Alternatively, create an
ArcGISVectorTiledLayerby taking a portal item offline and applying it to an offline vector tile package: i. Create aPortalItemusing the URL of a custom style.
ii. Create anExportVectorTilesTaskusing the portal item.
iii. Get theExportVectorTilesJobusingExportVectorTilesTask.makeExportStyleResourceCacheJob(itemResourceCacheURL:).
iv. Start the job usingJob.start().
v. Create aVectorTileCacheusing the path of the local vector tile package.
vi. Once the job is complete, create anArcGISVectorTiledLayerusing the vector tile cache and theItemResourceCachefrom the job’s result. - Create a
Basemapfrom theArcGISVectorTiledLayer. - Assign the basemap to the map’s
basemap.
Relevant API
- ArcGISVectorTiledLayer
- ExportVectorTilesTask
- ItemResourceCache
- Map
- VectorTileCache
Offline data
This sample uses the Dodge City OSM vector tile package. It is downloaded from ArcGIS Online automatically.
Tags
tiles, vector, vector basemap, vector tile package, vector tiled layer, vector tiles, vtpk