Root

Root level properties of a Mapbox style specify the map's layers, tile sources and other resources, and default values for the initial camera position when not specified elsewhere.

{
    "version": 8,
    "name": "Mapbox Streets",
    "sprite": "mapbox://sprites/mapbox/streets-v8",
    "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
    "sources": {...},
    "layers": [...]
}

There are some root level properties, including owner and modified, that are not documented here because they do not affect how a style is rendered. For the full list of these properties and their descriptions, see the example style object in the Mapbox Styles API documentation.

layers

Required array of layers.

Layers will be drawn in the order of this array.

"layers": [
  {
    "id": "water",
    "source": "mapbox-streets",
    "source-layer": "water",
    "type": "fill",
    "paint": {
      "fill-color": "#00ffff"
    }
  }
]

sources

Required object with source values.

Data source specifications.

"sources": {
  "mapbox-streets": {
    "type": "vector",
    "url": "mapbox://mapbox.mapbox-streets-v6"
  }
}

version

Required enum.

Style specification version number. Must be 8.

"version": 8

bearing

Optional number. Units in degrees. Defaults to 0.

Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

"bearing": 29

center

Optional array of numbers.

Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

"center": [
  -73.9749,
  40.7736
]

fog

Optional fog.

A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features.

glyphs

Optional string.

A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include {fontstack} and {range} tokens. This property is required if any layer uses the text-field layout property. The URL must be absolute, containing the scheme, authority and path components.

"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"

light

Optional light.

The global light source.

"light": {
  "anchor": "viewport",
  "color": "white",
  "intensity": 0.4
}

metadata

Optional.

Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.

name

Optional string.

A human-readable name for the style.

"name": "Bright"

pitch

Optional number. Units in degrees. Defaults to 0.

Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

"pitch": 50

sprite

Optional string.

A base URL for retrieving the sprite image and metadata. The extensions .png, .json and scale factor @2x.png will be automatically appended. This property is required if any layer uses the background-pattern, fill-pattern, line-pattern, fill-extrusion-pattern, or icon-image properties. The URL must be absolute, containing the scheme, authority and path components.

"sprite": "mapbox://sprites/mapbox/bright-v8"

terrain

Optional terrain.

A global modifier that elevates layers and markers based on a DEM data source.

transition

Optional transition.

A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's transition property.

"transition": {
  "duration": 300,
  "delay": 0
}

zoom

Optional number.

Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

"zoom": 12.5