Manage tile and attribute cache

The cache and attributes settings for a hosted vector tile layer (item) can be used to set the cache and the attributes that are available for a vector tile service.

These settings allow you to:

  • View the tile layers' current visible range.
  • Enable tiles to be used in offline maps and applications.
  • Rebuild the vector tile cache.
  • Configure the attributes that are included in the cache.
Item page service
Hosted vector tile layer item page in ArcGIS portal showing cache settings.

What is a vector tile cache?

Vector tile services published to and hosted on ArcGIS portal support fast visualization of large datasets using a collection of pre-generated vector tiles. Vector tile layers are ideal when you need to view many features at once.

To take advantage of the drawing performance of hosted tiles, you can publish them from the hosted feature layers or hosted feature layer views you own. Tiles published from hosted features reflect the changes you make to the feature data.

How to manage tile cache properties

The steps to manage map tile cache settings are:

  1. Sign into a data management tool with your ArcGIS account:

  2. Find the item.
  3. Use the item page to manage cache settings.

Types of management operations

You can use an item page or the ArcGIS REST API to perform vector tile cache management operations. The most common operations include the following:

  • Service properties: Service properties contain the current settings of the vector tile service. These include a reference to the tile urls, the tiling schema, levels of detail and more.

  • Cache: The vector tile cache can be rebuilt. When edits occur in the source feature layer you need to rebuild the cache to include any changes from the source feature layer.

  • Feature attributes: Feature attributes can be included in the cache. Attributes included in the cache can be used in styling and for showing popups. Currently only supported in custom applications created using third-party software.

  • Offline mode: Allow the tiles to be downloaded and used in an offline map.

Code examples

You can use data management tools to manage tile cache of a vector tile service or you can use the ArcGIS REST APIs. The following examples illustrate how to programmatically get the properties, synchronize, set feature attributes, and set the offline mode of a vector tile service.

Get the service properties

To access all of the vector tile service properties directly, use the REST API VectorTileServer endpoint to perform a GET request and pass the json and token parameters. A JSON structure will be returned containing the current properties and values of the service.

Request

Use dark colors for code blocksCopy
1
https://vectortileservices3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Santa_Monica_Mountains_Parcels_Styled/VectorTileServer?f=json&token={{ACCESS_TOKEN}}?f=json&token={access_token} HTTP/1.1

Response

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{
    "currentVersion": 11.1,
    "name": "Santa_Monica_Mountains_Parcels_Styled",
    "capabilities": "TilesOnly,Tilemap",
    "type": "indexedVector",
    "serviceItemId": "31793f6c4c114ef684a8a0c6029ae2c0",
    "publishJobId": "d015fc91-795f-42c9-9755-719dc6c28094",
    "jobServiceId": "7506b667-c51f-4515-ac48-a7c0a66f6e73",
    "ownerUserName": "",
    "serviceDescription": "",
    "description": "",
    "isEnabled": true,
    "id": 2241,
    "sourceServiceName": "Santa_Monica_Mountains_Parcels_Styled",
    "sourceServiceType": "FeatureServer",
    "tileContainerName": "441d61e50db94e969ff3e0b61a36a637",
    "creationDate": 1611725149467,
    "datasource": "db",
    "exportTilesAllowed": false,
    "maxExportTilesCount": 100000,
    "tileMap": "tilemap",
    "defaultStyles": "resources/styles",
    "tiles": [
        "tile/{z}/{y}/{x}.pbf"
    ],
    "exportTilesAllowed": false,
    "initialExtent": {
        "xmin": -13240863.776,
        "ymin": 4023715.1402999982,
        "xmax": -13173870.3567,
        "ymax": 4054853.8936000015,
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        }
    },
    "fullExtent": {
        "xmin": -13240863.776,
        "ymin": 4023715.1402999982,
        "xmax": -13173870.3567,
        "ymax": 4054853.8936000015,
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        }
    },
    "minScale": 295828763.795777,
    "maxScale": 35.2655367607897,
    "maxZoom": 23,
    "tileInfo": {
        "rows": 512,
        "cols": 512,
        "dpi": 96,
        "preciseDpi": 96,
        "format": "indexedVector",
        "origin": {
            "x": -20037508.342787,
            "y": 20037508.342787
        },
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        },
        "lods": [
            {
                "level": 0,
                "resolution": 78271.516963999937,
                "scale": 295828763.795777
            },
            {
                "level": 1,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            },
            {
                "level": 2,
                "resolution": 19567.879240999919,
                "scale": 73957190.948944
            },
            {
                "level": 3,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            },
            {
                "level": 4,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            },
            {
                "level": 5,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            },
            {
                "level": 6,
                "resolution": 1222.9924525624947,
                "scale": 4622324.434309
            },
            {
                "level": 7,
                "resolution": 611.49622628137968,
                "scale": 2311162.217155
            },
            {
                "level": 8,
                "resolution": 305.74811314055756,
                "scale": 1155581.108577
            },
            {
                "level": 9,
                "resolution": 152.87405657041106,
                "scale": 577790.554289
            },
            {
                "level": 10,
                "resolution": 76.437028285073225,
                "scale": 288895.277144
            },
            {
                "level": 11,
                "resolution": 38.21851414253662,
                "scale": 144447.638572
            },
            {
                "level": 12,
                "resolution": 19.10925707126831,
                "scale": 72223.819286
            },
            {
                "level": 13,
                "resolution": 9.5546285356341567,
                "scale": 36111.909643
            },
            {
                "level": 14,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            },
            {
                "level": 15,
                "resolution": 2.3886571339746849,
                "scale": 9027.977411
            },
            {
                "level": 16,
                "resolution": 1.1943285668550505,
                "scale": 4513.988705
            },
            {
                "level": 17,
                "resolution": 0.59716428355981721,
                "scale": 2256.994353
            },
            {
                "level": 18,
                "resolution": 0.29858214164761665,
                "scale": 1128.497176
            },
            {
                "level": 19,
                "resolution": 0.14929107082380833,
                "scale": 564.248588
            },
            {
                "level": 20,
                "resolution": 0.074645535411904163,
                "scale": 282.124294
            },
            {
                "level": 21,
                "resolution": 0.037322767705952081,
                "scale": 141.062147
            },
            {
                "level": 22,
                "resolution": 0.018661383852976041,
                "scale": 70.5310735
            },
            {
                "level": 23,
                "resolution": 0.0093306919293428044,
                "scale": 35.265536760789715
            }
        ]
    },
    "resourceInfo": {
        "styleVersion": 8,
        "tileCompression": "gzip",
        "cacheInfo": {
            "storageInfo": {
                "packetSize": 128,
                "storageFormat": "compactV2"
            }
        }
    }
}

Synchronize the cache

The rebuildCache admin operation is used to start a job to rebuild the tile cache. A JSON response will be returned containing the status of the job request. If the request returns a status of success, you can use the jobId returned to track the status of the job.

Request

Use dark colors for code blocksCopy
1
2
3
4
POST https://vectortileservices3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/admin/services/Santa_Monica_Mountains_Parcels_Styled/VectorTileServer/rebuildCache HTTP/1.1

f=json
&token={access_token}

Response

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
{
    "id": "7506b667-c51f-4515-ac48-a7c0a66f6e73",
    "name": "Santa_Monica_Mountains_Parcels_Styled",
    "status": "Success",
    "itemId": "31793f6c4c114ef684a8a0c6029ae2c0",
    "type": "Map Service",
    "jobId": "d36c3a2b-7ec6-4736-8239-53d56b6a3664",
    "message": "success"
}

Set feature attributes

To manage the attributes that are included in the cache, use the REST API edit admin operation. Pass in a JSON object to the serviceDefinition parameter, with an array of strings representing the field names you want to include. Attributes in vector tiles can currently only be used in custom applications.

Request

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
POST https://{VectorTileServiceHost}/{organizationId}/arcgis/rest/admin/services/{ServiceName}/VectorTileServer/edit HTTP/1.1

f=json
&token={access_token}
&serviceDefinition={
    "layerProperties":[{
        "id":0,
        "additionalFields":["APN", "SitusAddre"]
    }]
}

Response

Use dark colors for code blocksCopy
1
2
3
{
    "success": true
}

Set offline mode

To enable a vector tile service for offline use, use the REST API edit admin operation with a POST request. The sourceItemId parameter is the Item ID of the feature service that the vector tile service was created from. Set the exportTilesAllowed parameter to true to enable offline access or to false to disable offline access.

Request

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST https://{VectorTileServiceHost}/{organizationId}/arcgis/rest/admin/services/{ServiceName}/VectorTileServer/edit HTTP/1.1

f=json
&sourceItemId={SourceFeatureLayerItemID}
&exportTilesAllowed=true
&token={access_token}

Response

Use dark colors for code blocksCopy
1
2
3
{
    "success":true
}

Tutorials

Import data to create a feature layer

Use data management tools to import files and create a feature layer in a feature service.


Define a new feature layer

Use data management tools to define and create a new empty feature layer in a feature service.


Manage a feature layer

Use a hosted feature layer item to set the properties and settings of a feature layer in a feature service.


Create a vector tile service

Use data management tools to create a new vector tile service from a feature service.


Create a map tile service

Use ArcGIS Online or scripting APIs to publish a map tile service.


Workflows

Services

API support

Use data management tools or Client APIs to create, manage, and access data services. The table below outlines the level of support for each API.

CreateManageAccess
ArcGIS Maps SDK for JavaScript1
ArcGIS Maps SDK for Kotlin1
ArcGIS Maps SDK for Swift1
ArcGIS Maps SDK for Java1
ArcGIS Maps SDK for .NET1
ArcGIS Maps SDK for Qt1
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2
MapLibre GL JS23
OpenLayers23
Full supportPartial supportNo support
  • 1. Use portal class and direct REST API requests
  • 2. Access via ArcGIS REST JS
  • 3. Requires manually setting styles for renderers

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.