Introduction to data layers
A data layer, also known as an operational layer, is a client-side layer that can access geographic data from a data source. The data source for the layer can be a data service or a file such as GeoJSON.
The data for a data layer is typically stored in ArcGIS as a data service using ArcGIS tools. You can use data layers to display feature or tile data from feature, vector tile, or image tile services in your application.
Feature layers
If you have features containing geometry and attributes, you can import the data to create an ArcGIS feature layer in a feature service. To access the data, you can use the URL of the service to query and return features. You can style and display the results in a map or scene. Feature layers can also contain styling information as part of the service response.
How to access a feature service
- Import your data from a CSV, XLS, GeoJSON, or Shapefile file to create a hosted feature layer.
- Get the URL for the feature layer.
- Reference the MapLibre JS and CSS libraries.
- Define a data source to access and query the feature layer.
- Display the data in a layer.
Example
This example demonstrates how to display a feature layer. To get GeoJSON features from a feature layer, you need to provide a URL that queries the feature service and return the features in GeoJSON format.
Display a feature layer (as GeoJSON)
To learn more, go to the Import data as a feature layer and Add a feature layer tutorials.
Vector tile layers
If you want to access and display your data as vector tile data, you can publish a vector tile layer from a feature layer, and then display it in a map. Vector tile layers closely follow the Mapbox vector tile specification, but there a few important differences:
- URL endpoints end in
/{z}/{y}/{x}.pbf
, rather than/{z}/{x}/{y}.pbf
. - Each style may contain one source.
- The
raster
andhillshade
layer types are not supported.
How to access the vector tile service
- Import your data from a CSV, XLS, GeoJSON, or Shapefile file to create a hosted feature layer.
- Style the feature layer using ArcGIS Online.
- Create a vector tile service by publishing the feature layer as a vector tile layer.
- Get the URL.
- Reference the MapLibre JS and CSS libraries.
- Set the source as the type
vector
and add the tiles. - Define the style of the vector tile layer, found in the Style tab of the item page in your developer dashboard.
Example
Display a vector tile layer
This example demonstrates how you fetch the vector tiles and then use a layer of type fill
to display the tiles.
To learn more, go to the Publish a vector tile layer and Add a vector tile layer tutorials..
Image tile layers
If you want to access and display your data as a tile layer, you can publish an image tile layer from a feature layer, and then display it in a map.
How to access the image tile service
- Import your data from a CSV, XLS, GeoJSON, or Shapefile file to create a hosted feature layer.
- Create a tile layer in ArcGIS Online by navigating to its item page > Publish > Tile layer.
- Get the URL.
- Reference the MapLibre JS and CSS libraries.
- Define the source as the type
raster
and add the layer.
Example
Display an image tile layer
The example shows how to fetch the image (raster) tiles and then add a layer of type raster
to the map.
To learn more, go to the Add a raster tile layer tutorial.