Root Properties

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": "sprites/streets-v8",
    "glyphs": "{fontstack}/{range}.pbf",
    "sources": {...},
    "layers": [...]
}

bearing

Optional Number. Units in degrees. Defaults to 0.

Default bearing, in degrees clockwise from true north. The style bearing will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

"bearing": 29

Note

unsupported

center

Optional Array.

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
]

Note

unsupported

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.

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

layers

Required Array.

Layers will be drawn in the order of this array.

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

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.

Note

unsupported.

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

sources

Required Sources.

Data source specifications.

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

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.

"sprite" : "/geoserver/styles/mark"

transition

Required Transition.

A global transition definition to use as a default across properties.

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

version

Required Enum.

Style specification version number. Must be 8.

"version": 8

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

Note

This Mapbox Style Specification document was started from the BSD github.com/mapbox/mapbox-gl-js repository.

The specification is reproduced here with details on the GeoTools MBStyle implementation. Where appropriate examples have been changed to reference GeoWebCache.

Documentation BSD license:

Copyright (c) 2016, Mapbox

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of Mapbox GL JS nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.