Hide Table of Contents
View Vector tiles sample in sandbox
Vector tiles


This sample shows how to add a VectorTileLayer to a map. A VectorTileLayer displays cached data in vector format, making the styles of its layers customizable on the client.

Unlike image caches, vector tiles contain data for rendering the tile information. Because the data in VectorTileLayer is vector, it is stored in individual layers containing geometry, attributes, and styles that may be customized by the developer client-side.


<!DOCTYPE html>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
  <title>VectorTileLayer sample</title>
  <link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
    #map {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
  <script src="https://js.arcgis.com/3.20/"></script>
    ], function(Map, VectorTileLayer) {

      var map = new Map("map", {
        center: [2.3508, 48.8567], // longitude, latitude
        zoom: 2

      //The URL referenced in the constructor may point to a style url JSON (as in this sample)
      //or directly to a vector tile service
      var vtlayer = new VectorTileLayer("https://www.arcgis.com/sharing/rest/content/items/bf79e422e9454565ae0cbe9553cf6471/resources/styles/root.json");
  <div id="map"></div>