Skip to main content

source layer

A source layer is an individual layer of data within a vector source. A vector source can have multiple source layers.

A source layer differs from a style layer, which is used to add styling rules to a specific subset of data in a map style.

Find a source layer's name

There are a few places you can find the name of a source layer:

A map's style document

In a map's style document, each layer with a type of vector has a source-layer property that contains the source layer's name. The following Mapbox GL JS style layer has a source layer named waterway:

"layers": [
{
"id": "rivers",
"source": "my-source",
"source-layer": "waterway",
"type": "line",
"paint": {
"line-color": "#FFC0CB"
}
}
]

Tileset explorer

You can find a source layer's name in the Mapbox Studio Tileset explorer:

  1. Visit your Tilesets page.
  2. Click the name of one of your tilesets to open Tileset explorer.
  3. You will see the tileset's source layers listed under menu Vector layers.

Mapbox Studio style editor

In the Select data tab

You can find the name of source layers used in a style using the Select data tab:

  1. Open the style in the Mapbox Studio style editor.
  2. Click on the name of the layer in the layer list.
  3. Switch to the Select data tab.
  4. Find the source layer listed below the name of the tileset source.

In the Layer overview

You can find the name of source layers used in a style using the Layer overview option:

  1. Open the style in the Mapbox Studio style editor.
  2. Click on the Settings button in the top toolbar.
  3. Scroll down to Layer overview section.

Name a source layer

Your ability to name a source layer depends on the tool you use to prepare your data and upload it to Mapbox.

  • Mapbox Studio. When you upload an accepted file type to Mapbox Studio, Studio generates a name for the resulting tileset's source layer or layers based on the original file. This automatically generated source layer name cannot be edited.
  • Mapbox Tiling Service with the tileset recipe. When you use Mapbox Tiling Service (MTS) to create a new tileset, you can set source layer names for a tileset in the tileset recipe. These source layer names can only be edited at the tileset recipe level, and you must follow the steps outlined in Update a tileset with MTS to see the name change.

Related resources:

Was this page helpful?