Add a vector tile layer
Learn how to add a vector tile layer to a map.
A vector tile layer is a hosted data layer with vector tile data. You can create a vector tile layer by publishing your data with data management tools.
In this tutorial, you display a parcels layer from a public vector tile service with its default styling.
Prerequisites
You need an ArcGIS Developer or ArcGIS Online account to access the developer dashboard and create an API key.
Steps
Create a new pen
- To get started, either complete the Display a map tutorial or .
Set the API key
To access location services, you need an API key or OAuth 2.0 access token. To learn how to create and scope your key, visit the Create an API key tutorial.
Go to your dashboard to get an API key. The API key must be scoped to access the services used in this tutorial.
In CodePen, update
api
to use your key.Key Use dark colors for code blocks Change line
Add a vector tile layer
To access the vector tile service, you use the vector
class.
- Create a
vector
and set theTile Layer url
of the layer before adding it to the map.
Run the app
In CodePen, run your code to display the map.
You should see the vector tile layer with parcels displayed on the basemap layer.
What's next?
Learn how to use additional ArcGIS location services in these tutorials: