Layers

A style’s layers property lists all of the layers available in that style. The type of layer is specified by the "type" property, and must be one of background, fill, line, symbol, raster, circle, fill-extrusion.

Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.

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

Layer Properties

id

Required String.

Unique layer name.

type

Optional Enum. One of fill, line, symbol, circle, fill-extrusion, raster, background.

Rendering type of this layer.

fill

A filled polygon with an optional stroked border.

line

A stroked line.

symbol

An icon or a text label.

circle

A filled circle.

fill-extrusion

An extruded (3D) polygon.

raster

Raster map textures such as satellite imagery.

background

The background color or pattern of the map.

metadata

Optional

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

source

Optional String.

Name of a source description to be used for this layer.

source-layer

Optional String.

Layer to use from a vector tile source. Required if the source supports multiple layers.

minzoom

Optional Number.

The minimum zoom level on which the layer gets parsed and appears on.

maxzoom

Optional Number.

The maximum zoom level on which the layer gets parsed and appears on.

filter

Optional Expression.

A expression specifying conditions on source features. Only features that match the filter are displayed.

["to-number", value, fallback: value, fallback: value, ...]: number

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.41.0

>= 23.0

collator

>= 0.45.0

>= Not yet supported

other filter

>= 0.10.0

>= 17.1

>= 2.4.0

other filter has/!has

>= 0.19.0

>= 17.1

>= 2.4.0

layout

layout properties for the layer

paint

Optional paint properties for the layer

Layers have two sub-properties that determine how data from that layer is rendered: layout and paint properties.

Layout properties appear in the layer’s "layout" object. They are applied early in the rendering process and define how data for that layer is passed to the GPU. For efficiency, a layer can share layout properties with another layer via the "ref" layer property, and should do so where possible. This will decrease processing time and allow the two layers will share GPU memory and other resources associated with the layer.

Paint properties are applied later in the rendering process. A layer that shares layout properties with another layer can have independent paint properties. Paint properties appear in the layer’s "paint" object.

background

Layout Properties

visibility

Optional Enum. One of visible, none, Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

Paint Properties

background-color

Optional Color. Defaults to #000000. Disabled by background-pattern.

The color with which the background will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

background-pattern

Optional String.

Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512).

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

background-opacity

Optional Number. Defaults to 1.

The opacity at which the background will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

fill

Layout Properties

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

Paint Properties

fill-antialias

Optional Boolean. Defaults to true.

Whether or not the fill should be anti-aliased.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

fill-opacity

Optional Number. Defaults to 1.

The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1 px stroke around the fill, if the stroke is used.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.21.0

>= 17.1

>= 2.4.0

fill-color

Optional Color. Defaults to #000000. Disabled by fill-pattern.

The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color’s opacity will not affect the opacity of the 1px stroke, if it is used.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.19.0

>= 17.1

>= 2.4.0

fill-outline-color

Optional Color. Disabled by fill-pattern. Requires fill-antialias = true.

The outline color of the fill. Matches the value of fill-color if unspecified.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.19.0

>= 17.1

>= 2.4.0

fill-translate

Optional Array. Units in pixels. Defaults to 0.0.

The geometry’s offset. Values are [x, y] where negatives indicate left and up, respectively.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

fill-translate-anchor

Optional Enum. One of map, viewport. Defaults to map. Requires fill-translate.

Controls the translation reference point.

map

The fill is translated relative to the map.

viewport

The fill is translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

fill-pattern

Optional String.

Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512).

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

>= 17.1

Not yet supported

line

Layout Properties

line-cap

Optional Enum. One of butt, round, square. Defaults to butt.

The display of line endings.

butt

A cap with a squared-off end which is drawn to the exact endpoint of the line.

round

A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line’s width and centered on the endpoint of the line.

square

A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line’s width.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

line-join

Optional Enum. One of bevel, round, miter. Defaults to miter.

The display of lines when joining.

bevel

A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line’s width.

round

A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line’s width and centered on the endpoint of the line.

miter

A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

line-miter-limit

Optional Number. Defaults to 2. Requires line-join = miter.

Used to automatically convert miter joins to bevel joins for sharp angles.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

data-driven styling

Not yet supported

Not yet supported

>= 2.4.0

line-round-limit

Optional Number. Defaults to 1.05. Requires line-join = round.

Used to automatically convert round joins to miter joins for shallow angles.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

Paint Properties

line-opacity

Optional Number. Defaults to 1.

The opacity at which the line will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.29.0

>= 17.1

>= 2.4.0

line-color

Optional Color. Defaults to #000000. Disabled by line-pattern.

The color with which the line will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.23.0

>= 17.1

>= 2.4.0

line-translate

Optional Array. Units in pixels. Defaults to 0.0.

The geometry’s offset. Values are [x, y] where negatives indicate left and up, respectively.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

line-translate-anchor

Optional Enum. One of map, viewport. Defaults to map. Requires line-translate.

Controls the translation reference point.

map

The line is translated relative to the map.

viewport

The line is translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

line-width

Optional Number. Units in pixels. Defaults to 1.

Stroke thickness.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

line-gap-width

Optional Number. Units in pixels. Defaults to 0.

Draws a line casing outside of a line’s actual path. Value indicates the width of the inner gap.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

18.0

data-driven styling

>= 0.29.0

22.2

Not yet supported

line-offset

Optional Number. Units in pixels. Defaults to 0.

The line’s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.12.1

>= 17.1

Not yet supported

data-driven styling

>= 0.29.0

>= 17.1

Not yet supported

line-blur

Optional Number. Units in pixels. Defaults to 0.

Blur applied to the line, in pixels.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.29.0

Not yet supported

Not yet supported

line-dasharray

Optional Array. Units in line widths. Disabled by line-pattern.

Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

line-pattern

Optional String.

Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, …, 512).

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

>= 17.1

Not yet supported

symbol

Layout Properties

symbol-placement

Optional Enum. One of point, line. Defaults to point.

Label placement relative to its geometry.

point

The label is placed at the point where the geometry is located.

line

The label is placed along the line of the geometry. Can only be used on LineString and Polygon geometries.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.10.0

data-driven styling

Not yet supported

>= 17.1

>= 2.10.0

symbol-spacing

Optional Number. Units in pixels. Defaults to 250. Requires symbol-placement = line.

Distance between two symbol anchors.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

symbol-avoid-edges

Optional Boolean. Defaults to false.

If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don’t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.

In GeoTools the option is ignored and effectively always “on” when translating to SLD, to support server side rendering

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-allow-overlap

Optional Boolean. Defaults to false. Requires icon-image.

If true, the icon will be visible even if it collides with other previously drawn symbols.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-ignore-placement

Optional Boolean. Defaults to false. Requires icon-image.

If true, other symbols can be visible even if they collide with the icon.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-optional

Optional Boolean. Defaults to false. <Requires icon-image, text-field.

If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-rotation-alignment

Optional Enum. One of map, viewport, auto. Defaults to auto. Requires icon-image.

In combination with symbol-placement, determines the rotation behavior of icons.

map

When symbol-placement is set to point, aligns icons east-west. When symbol-placement is set to line, aligns icon x-axes with the line.

viewport

Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of symbol-placement.

auto

When symbol-placement is set to point, this is equivalent to viewport. When symbol-placement is set to line, this is equivalent to map.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

auto value

>= 0.25.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-size

Optional Number. Defaults to 1. Requires icon-image. Scale factor for icon. 1 is original size, 3 triples the size.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

data-driven styling

>= 0.35.0

Not yet supported

>= 2.4.0

icon-text-fit

Optional Enum. One of none, width, height, both. Defaults to none. Requires icon-image, text-field.

Scales the icon to fit around the associated text.

none

The icon is displayed at its intrinsic aspect ratio.

width

The icon is scaled in the x-dimension to fit the width of the text.

height

The icon is scaled in the y-dimension to fit the height of the text.

both

The icon is scaled in both x- and y-dimensions.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.21.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-text-fit-padding

Optional :ref:`types-array`. *Units in pixels. Defaults to 0,0,0,0. Requires icon-image, text-field, icon-text-fit = one of both, width, height.

Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.21.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-image

Optional String.

Name of image in sprite to use for drawing an image background. A string with {tokens} replaced, referencing the data property to pull from.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

icon-rotate

Optional Number. Units in degrees. Defaults to 0. Requires icon-image.

Rotates the icon clockwise.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.21.0

>= 17.1

>= 2.4.0

icon-padding

Optional Number. Units in pixels. Defaults to 2. Requires icon-image.

Size of the additional area around the icon bounding box used for detecting symbol collisions.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-keep-upright

Optional Boolean. Defaults to false. Requires icon-image, icon-rotation-alignment = map, symbol-placement = line.

If true, the icon may be flipped to prevent it from being rendered upside-down.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-offset

Optional Array. Defaults to 0,0. Requires icon-image.

Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. When combined with icon-rotate the offset will be as if the rotated direction was up.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= Not yet supported

Not yet supported

data-driven styling

>= 0.29.0

>= Not yet supported

Not yet supported

text-pitch-alignment

Optional Enum One of map, viewport, auto. Defaults to auto. Requires text-field.

Orientation of text when map is pitched.

map

The text is aligned to the plane of the map.

viewport

The text is aligned to the plane of the viewport.

auto

Automatically matches the value of text-rotation-alignment.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

auto value

>= 0.25.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-rotation-alignment

Optional Enum. One of map, viewport, auto. Defaults to auto. Requires text-field.

In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text.

map

When symbol-placement is set to point, aligns text east-west. When symbol-placement is set to line, aligns text x-axes with the line.

viewport

Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of symbol-placement.

auto

When symbol-placement is set to point, this is equivalent to viewport. When symbol-placement is set to line, this is equivalent to map.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

auto value

>= 0.25.0

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-field

Optional String.

Value to use for a text label. Feature properties are specified using tokens like {field_name}. (Token replacement is only supported for literal text-field values–not for property functions.)

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.33.0

>= 17.1

>= 2.4.0

text-font

Optional Array. Defaults to Open Sans Regular, Arial Unicode MS Regular. Requires text-field.

Font stack to use for displaying text.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

Not yet supported

>= 2.4.0

text-size

Optional Number. Units in pixels. Defaults to 16. Requires text-field.

Font size.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.35.0

>= 17.1

>= 2.4.0

text-max-width

Optional Number. Units in pixels. Defaults to 10. Requires text-field.

The maximum line width for text wrapping.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

data-driven styling

Not yet supported

Not yet supported

>= 2.4.0

text-line-height

Optional Number. Units in ems. Defaults to 1.2. Requires text-field.

Text leading value for multi-line text.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-letter-spacing

Optional Number. Units in ems. Defaults to 0. Requires text-field.

Text tracking amount.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-justify

Optional Enum. One of left, center, right. Defaults to center. Requires text-field.

Text justification options.

left

The text is aligned to the left.

center

The text is centered.

right

The text is aligned to the right.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-anchor

Optional Enum. One of center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center. Requires text-field.

Part of the text placed closest to the anchor.

center

The center of the text is placed closest to the anchor.

left

The left side of the text is placed closest to the anchor.

right

The right side of the text is placed closest to the anchor.

top

The top of the text is placed closest to the anchor.

bottom

The bottom of the text is placed closest to the anchor.

top-left

The top left corner of the text is placed closest to the anchor.

top-right

The top right corner of the text is placed closest to the anchor.

bottom-left

The bottom left corner of the text is placed closest to the anchor.

bottom-right

The bottom right corner of the text is placed closest to the anchor.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

23.0

>= 2.4.0

data-driven styling

>= 0.35.0

>= 22.2

>= 2.4.0

text-max-angle

Optional Number. Units in degrees. Defaults to 45. Requires text-field, symbol-placement = line.

Maximum angle change between adjacent characters.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.10.0

data-driven styling

Not yet supported

Not yet supported

>= 2.10.0

text-rotate

Optional Number. Units in degrees. Defaults to 0. Requires text-field.

Rotates the text clockwise.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.10.0

data-driven styling

>= 0.35.0

Not yet supported

>= 2.10.0

text-padding

Optional Number. Units in pixels. Defaults to 2. Requires text-field.

Size of the additional area around the text bounding box used for detecting symbol collisions.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-keep-upright

Optional Boolean. Defaults to true. Requires text-field, text-rotation-alignment = true, symbol-placement = true.

If true, the text may be flipped vertically to prevent it from being rendered upside-down.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-transform

Optional Enum. One of none, uppercase, lowercase. Defaults to none. Requires text-field.

Specifies how to capitalize text, similar to the CSS text-transform property.

none

The text is not altered.

uppercase

Forces all letters to be displayed in uppercase.

lowercase

Forces all letters to be displayed in lowercase.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.4.0

data-driven styling

>= 0.33.0

Not yet supported

>= 2.4.0

text-offset

Optional Array. Units in ems. Defaults to 0,0. Requires icon-image.

Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

22.2

>= 2.4.0

data-driven styling

>= 0.35.0

22.2

>= 2.4.0

text-allow-overlap

Optional Boolean. Defaults to false. Requires text-field.

If true, the text will be visible even if it collides with other previously drawn symbols.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-ignore-placement

Optional Boolean. Defaults to false. Requires text-field

If true, other symbols can be visible even if they collide with the text.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-optional

Optional Boolean. Defaults to false. Requires text-field, icon-image.

If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

Not yet supported

>= 17.1

>= 2.4.0

Paint Properties

icon-opacity

Optional Number. Defaults to 1. <i>Requires </i>icon-image.

The opacity at which the icon will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.33.0

>= 17.1

>= 2.4.0

icon-color

Optional Color. Defaults to #000000. Requires icon-image.

The color of the icon. This can only be used with SDF icons.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

>= 2.10.0

data-driven styling

>= 0.33.0

Not yet supported

>= 2.10.0

icon-halo-color

Optional Color. Defaults to rgba(0, 0, 0, 0). Requires icon-image.

The color of the icon’s halo. Icon halos can only be used with SDF icons.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.33.0

Not yet supported

Not yet supported

icon-halo-width

Optional Number. Units in pixels. Defaults to 0. Requires icon-image.

Distance of halo to the icon outline.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.33.0

Not yet supported

Not yet supported

icon-halo-blur

Optional Number. Units in pixels. Defaults to 0. Requires icon-image.

Fade out the halo towards the outside.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.33.0

Not yet supported

Not yet supported

icon-translate

Optional Array. Units in pixels. Defaults to 0,0. Requires icon-image.

Distance that the icon’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

icon-translate-anchor

Optional Enum One of map, viewport. Defaults to map. Requires icon-image, icon-translate.

Controls the translation reference point.

map

Icons are translated relative to the map.

viewport

Icons are translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-opacity

Optional Number. Defaults to 1. <i>Requires </i>text-field.

The opacity at which the text will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

>= 0.33.0

>= 17.1

Not yet supported

text-color

Optional Color. Defaults to #000000. Requires text-field.

The color with which the text will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.33.0

>= 17.1

>= 2.4.0

text-halo-color

Optional Color. Defaults to rgba(0, 0, 0, 0). Requires text-field.

The color of the text’s halo, which helps it stand out from backgrounds.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.33.0

>= 17.1

>= 2.4.0

text-halo-width

Optional Number. Units in pixels. Defaults to 0. Requires text-field.

Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.33.0

>= 17.1

>= 2.4.0

text-halo-blur

Optional Number. Units in pixels. Defaults to 0. Requires text-field.

The halo’s fade out distance towards the outside.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.33.0

Not yet supported

Not yet supported

text-translate

Optional Array. Units in pixels. Defaults to 0,0. Requires text-field.

Distance that the text’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

text-translate-anchor

Optional Enum One of map, viewport. Defaults to map. Requires text-field, text-translate.

Controls the translation reference point.

map

The text is translated relative to the map.

viewport

The text is translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster

Layout Properties

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

>= 17.1

Not yet supported

Paint Properties

raster-opacity

Optional Number. Defaults to 1.

The opacity at which the image will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

>= 17.1

Not yet supported

raster-hue-rotate

Optional Number. Units in degrees. Defaults to 0.

Rotates hues around the color wheel.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster-brightness-min

Optional Number. Defaults to 0.

Increase or reduce the brightness of the image. The value is the minimum brightness.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster-brightness-max

Optional Number. Defaults to 1.

Increase or reduce the brightness of the image. The value is the maximum brightness.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster-saturation

Optional Number. Defaults to 0.

Increase or reduce the saturation of the image.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster-contrast

Optional Number. Defaults to 0.

Increase or reduce the contrast of the image.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

raster-fade-duration

Optional Number Units in milliseconds. Defaults to 300.

Fade duration when a new tile is added.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

circle

Layout Properties

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

Paint Properties

circle-radius

Optional Number. Units in pixels. Defaults to 5.

Circle radius.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.18.0

>= 17.1

>= 2.4.0

circle-color

Optional Color. Defaults to #000000.

The fill color of the circle.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.18.0

>= 17.1

>= 2.4.0

circle-blur

Optional Number. Defaults to 0.

Amount to blur the circle. 1 blurs the circle such that only the center point is full opacity.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

>= 0.20.0

Not yet supported

Not yet supported

circle-opacity

Optional Number. Defaults to 1.

The opacity at which the circle will be drawn.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

>= 2.10.0

data-driven styling

>= 0.20.0

>= 17.1

>= 2.10.0

circle-translate

Optional Array. Units in pixels. Defaults to 0,0.

The geometry’s offset. Values are [x, y] where negatives indicate left and up, respectively.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

>= 17.1

Not yet supported

data-driven styling

Not yet supported

>= 17.1

Not yet supported

circle-translate-anchor

Optional Enum One of map, viewport. Defaults to map. Requires circle-translate.

Controls the translation reference point.

map

The circle is translated relative to the map.

viewport

The circle is translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.10.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

circle-pitch-scale

Optional Enum One of map, viewport. Defaults to map.

Controls the scaling behavior of the circle when the map is pitched.

map

Circles are scaled according to their apparent distance to the camera.

viewport

Circles are not scaled.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.21.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

circle-stroke-width

Optional Number. Units in pixels. Defaults to 5.

The width of the circle’s stroke. Strokes are placed outside of the circle-radius.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.29.0

>= 17.1

>= 2.10.0

data-driven styling

>= 0.29.0

>= 17.1

>= 2.10.0

circle-stroke-color

Optional Color. Defaults to #000000.

The stroke color of the circle.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.29.0

>= 17.1

>= 2.4.0

data-driven styling

>= 0.29.0

>= 17.1

>= 2.4.0

circle-stroke-opacity

Optional Number. Defaults to 1.

The opacity of the circle’s stroke.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.29.0

>= 17.1

Not yet supported

data-driven styling

>= 0.29.0

>= 17.1

Not yet supported

fill-extrusion

Layout Properties

visibility

Optional Enum. One of visible, none. Defaults to visible.

Whether this layer is displayed.

visible

The layer is shown.

none

The layer is not shown.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

>= 17.1

Not yet supported

Paint Properties

fill-extrusion-opacity

Optional Number. Defaults to 1.

The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

>= 17.1

Not yet supported

fill-extrusion-color

Optional Color. Defaults to #000000. Disabled by fill-extrusion-pattern.

The base color of the extruded fill. The extrusion’s surfaces will be shaded differently based on this color in combination with the root light settings. If this color is specified as rgba with an alpha component, the alpha component will be ignored; use fill-extrusion-opacity to set layer opacity.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

>= 17.1

Not yet supported

fill-extrusion-translate

Optional Array. Units in pixels. Defaults to 0,0.

The geometry’s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

Optional Enum One of map, viewport. Defaults to map. Requires fill-extrusion-translate.

Controls the translation reference point.

map

The fill extrusion is translated relative to the map.

viewport

The fill extrusion is translated relative to the viewport.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

fill-extrusion-pattern

Optional String.

Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512).

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

Not yet supported

Not yet supported

data-driven styling

Not yet supported

Not yet supported

Not yet supported

fill-extrusion-height

Optional Number Units in meters. Defaults to 0.

The height with which to extrude this layer.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

Not yet supported

Not yet supported

data-driven styling

>= 0.27.0

Not yet supported

Not yet supported

fill-extrusion-base

Optional Number Units in meters. Defaults to 0. Requires fill-extrusion-height.

The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height.

Support

Mapbox

GeoTools

OpenLayers

basic functionality

>= 0.27.0

Not yet supported

Not yet supported

data-driven styling

>= 0.27.0

Not yet supported

Not yet supported

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.