Layers
A style's layers
property lists all 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, heatmap, hillshade, sky.
Except for layers of the background or sky types, each layer must 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.
Here is an example layers
object which could be included in a style:
"layers": [
{
"id": "water",
"source": "mapbox-streets",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#00ffff"
}
}
]
Layer properties
id
Unique layer name.
type
"fill"
, "line"
, "symbol"
, "circle"
, "heatmap"
, "fill-extrusion"
, "raster"
, "hillshade"
, "background"
, "sky"
. 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.
"heatmap"
:A heatmap.
"fill-extrusion"
:An extruded (3D) polygon.
"raster"
:Raster map textures such as satellite imagery.
"hillshade"
:Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
"background"
:The background color or pattern of the map.
"sky"
:A spherical dome around the map that is always rendered behind all other layers.
filter
An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The ["feature-state", ...]
expression is not supported in filter expressions. The ["pitch"]
and ["distance-from-center"]
expressions are supported only for filter expressions on the symbol layer.
layout
Layout properties for the layer.
maxzoom
0
and 24
inclusive. The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
metadata
Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.
minzoom
0
and 24
inclusive. The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.
paint
Default paint properties for this layer.
source
Name of a source description to be used for this layer. Required for all layer types except background
.
source-layer
Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
Layer sub-properties
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. Changes to a layout property require an asynchronous "layout" step.Paint properties are applied later in the rendering process. Paint properties appear in the layer's
"paint"
object. Changes to a paint property are cheap and happen synchronously.
background
The background
style layer covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the background layer is transparent or omitted from the style, any part of the map view that does not show another style layer is transparent.
The Vintage map style uses a custom SVG background-pattern
to achieve a textured vintage look.
background-color
"#000000"
. Disabled by background-pattern. Supports interpolate
expressions. Transitionable. The color with which the background will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
background-opacity
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. The opacity at which the background will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
background-pattern
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). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
fill
A fill
style layer renders one or more filled (and optionally stroked) polygons on a map. You can use a fill layer to configure the visual appearance of polygon or multipolygon features.
This map of Washington, D.C. uses the fill-opacity
paint property to render a semi-transparent polygon generated by the Isochrone API, showing how far a person can walk from the center of the city in ten minutes.
fill-antialias
Whether or not the fill should be antialiased.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
fill-color
"#000000"
. Disabled by fill-pattern. Supports feature-state
and interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.19.0 | >= 5.0.0 | >= 3.5.0 |
fill-opacity
0
and 1
inclusive. Defaults to 1
. Supports feature-state
and interpolate
expressions. Transitionable. The opacity of the entire fill layer. In contrast to the fill-color
, this value will also affect the 1px stroke around the fill, if the stroke is used.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.21.0 | >= 5.0.0 | >= 3.5.0 |
fill-outline-color
true
. Supports feature-state
and interpolate
expressions. Transitionable. The outline color of the fill. Matches the value of fill-color
if unspecified.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.19.0 | >= 5.0.0 | >= 3.5.0 |
fill-pattern
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). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.49.0 | >= 6.5.0 | >= 4.4.0 |
fill-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 1.2.0 | >= 9.1.0 | >= 5.8.0 |
data-driven styling | >= 1.2.0 | >= 9.1.0 | >= 5.8.0 |
fill-translate
[0,0]
. Supports interpolate
expressions. Transitionable. The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
fill-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires fill-translate. Controls the frame of reference for fill-translate
.
"map"
:The fill is translated relative to the map.
"viewport"
:The fill is translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
line
A line
style layer renders one or more stroked polylines on the map. You can use a line layer to configure the visual appearance of polyline or multipolyline features.
This map of a Strava user's hike through Grand Teton National Park uses the line-color
and line-width
paint properties to style the strong red line of the user's route.
line-blur
0
. Units in pixels. Defaults to 0
. Supports feature-state
and interpolate
expressions. Transitionable. Blur applied to the line, in pixels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
line-cap
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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 2.3.0 | Not yet supported | Not yet supported |
line-color
"#000000"
. Disabled by line-pattern. Supports feature-state
and interpolate
expressions. Transitionable. The color with which the line will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.23.0 | >= 5.0.0 | >= 3.5.0 |
line-dasharray
0
. 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. Note that GeoJSON sources with lineMetrics: true
specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 2.3.0 | Not yet supported | Not yet supported |
line-gap-width
0
. Units in pixels. Defaults to 0
. Supports feature-state
and interpolate
expressions. Transitionable. Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
line-gradient
"geojson"
. Supports interpolate
expressions. Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify "lineMetrics": true
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.45.0 | >= 6.5.0 | >= 4.4.0 |
data-driven styling | Not yet supported | Not yet supported | Not yet supported |
line-join
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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.40.0 | >= 5.2.0 | >= 3.7.0 |
line-miter-limit
2
. Requires line-join to be "miter"
. Supports interpolate
expressions. Used to automatically convert miter joins to bevel joins for sharp angles.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
line-offset
0
. Supports feature-state
and interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.12.1 | >= 3.0.0 | >= 3.1.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
line-opacity
0
and 1
inclusive. Defaults to 1
. Supports feature-state
and interpolate
expressions. Transitionable. The opacity at which the line will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
line-pattern
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). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.49.0 | >= 6.5.0 | >= 4.4.0 |
line-round-limit
1.05
. Requires line-join to be "round"
. Supports interpolate
expressions. Used to automatically convert round joins to miter joins for shallow angles.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
line-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 1.2.0 | >= 9.1.0 | >= 5.8.0 |
data-driven styling | >= 1.2.0 | >= 9.1.0 | >= 5.8.0 |
line-translate
[0,0]
. Supports interpolate
expressions. Transitionable. The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
line-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires line-translate. Controls the frame of reference for line-translate
.
"map"
:The line is translated relative to the map.
"viewport"
:The line is translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
line-trim-offset
00
and 11
inclusive. Defaults to [0,0]
. Requires source to be "geojson"
. The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.9.0 | >= 10.5.0 | >= 10.5.0 |
line-width
0
. Units in pixels. Defaults to 1
. Supports feature-state
and interpolate
expressions. Transitionable. Stroke thickness.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
symbol
A symbol
style layer renders icon and text labels at points or along lines on a map. You can use a symbol layer to configure the visual appearance of labels for features in vector tiles.
This map of Denver area businesses uses the icon-image
layout property to use a custom image as an icon in a symbol layer.
icon-allow-overlap
If true, the icon will be visible even if it collides with other previously drawn symbols.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-anchor
"center"
, "left"
, "right"
, "top"
, "bottom"
, "top-left"
, "top-right"
, "bottom-left"
, "bottom-right"
. Defaults to "center"
. Requires icon-image. Part of the icon placed closest to the anchor.
"center"
:The center of the icon is placed closest to the anchor.
"left"
:The left side of the icon is placed closest to the anchor.
"right"
:The right side of the icon is placed closest to the anchor.
"top"
:The top of the icon is placed closest to the anchor.
"bottom"
:The bottom of the icon is placed closest to the anchor.
"top-left"
:The top left corner of the icon is placed closest to the anchor.
"top-right"
:The top right corner of the icon is placed closest to the anchor.
"bottom-left"
:The bottom left corner of the icon is placed closest to the anchor.
"bottom-right"
:The bottom right corner of the icon is placed closest to the anchor.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.40.0 | >= 5.2.0 | >= 3.7.0 |
data-driven styling | >= 0.40.0 | >= 5.2.0 | >= 3.7.0 |
icon-color
"#000000"
. Requires icon-image. Supports feature-state
and interpolate
expressions. Transitionable. The color of the icon. This can only be used with SDF icons.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
icon-halo-blur
0
. Units in pixels. Defaults to 0
. Requires icon-image. Supports feature-state
and interpolate
expressions. Transitionable. Fade out the halo towards the outside.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
icon-halo-color
"rgba(0, 0, 0, 0)"
. Requires icon-image. Supports feature-state
and interpolate
expressions. Transitionable. The color of the icon's halo. Icon halos can only be used with SDF icons.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
icon-halo-width
0
. Units in pixels. Defaults to 0
. Requires icon-image. Supports feature-state
and interpolate
expressions. Transitionable. Distance of halo to the icon outline.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
icon-ignore-placement
If true, other symbols can be visible even if they collide with the icon.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-image
Name of image in sprite to use for drawing an image background.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.35.0 | >= 5.1.0 | >= 3.6.0 |
icon-keep-upright
false
. Requires icon-image. Requires icon-rotation-alignment to be "map"
. Requires symbol-placement to be "line"
, or "line-center"
. If true, the icon may be flipped to prevent it from being rendered upside-down.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-offset
[0,0]
. Requires icon-image. Supports interpolate
expressions. Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size
to obtain the final offset in pixels. When combined with icon-rotate
the offset will be as if the rotated direction was up.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
icon-opacity
0
and 1
inclusive. Defaults to 1
. Requires icon-image. Supports feature-state
and interpolate
expressions. Transitionable. The opacity at which the icon will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
icon-optional
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-padding
0
. Units in pixels. Defaults to 2
. Requires icon-image. Supports interpolate
expressions. Size of the additional area around the icon bounding box used for detecting symbol collisions.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-pitch-alignment
"map"
, "viewport"
, "auto"
. Defaults to "auto"
. Requires icon-image. Orientation of icon when map is pitched.
"map"
:The icon is aligned to the plane of the map.
"viewport"
:The icon is aligned to the plane of the viewport.
"auto"
:Automatically matches the value of
icon-rotation-alignment
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 |
icon-rotate
0
. Requires icon-image. Supports interpolate
expressions. Rotates the icon clockwise.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.21.0 | >= 5.0.0 | >= 3.5.0 |
icon-rotation-alignment
"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 topoint
, aligns icons east-west. Whensymbol-placement
is set toline
orline-center
, 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 topoint
, this is equivalent toviewport
. Whensymbol-placement
is set toline
orline-center
, this is equivalent tomap
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
| >= 0.25.0 | >= 4.2.0 | >= 3.4.0 |
icon-size
0
. Units in factor of the original icon size. Defaults to 1
. Requires icon-image. Supports interpolate
expressions. Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size
. 1 is the original size; 3 triples the size of the image.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.35.0 | >= 5.1.0 | >= 3.6.0 |
icon-text-fit
"none"
, "width"
, "height"
, "both"
. Defaults to "none"
. Requires icon-image. Requires 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.21.0 | >= 4.2.0 | >= 3.4.0 |
stretchable icons | >= 1.6.0 | >= 9.2.0 | >= 5.8.0 |
icon-text-fit-padding
[0,0,0,0]
. Requires icon-image. Requires text-field. Requires icon-text-fit to be "both"
, or "width"
, or "height"
. Supports interpolate
expressions. Size of the additional area added to dimensions determined by icon-text-fit
, in clockwise order: top, right, bottom, left.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.21.0 | >= 4.2.0 | >= 3.4.0 |
icon-translate
[0,0]
. Requires icon-image. Supports interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
icon-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires icon-image. Requires icon-translate. Controls the frame of reference for icon-translate
.
"map"
:Icons are translated relative to the map.
"viewport"
:Icons are translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
symbol-avoid-edges
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. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
symbol-placement
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
andPolygon
geometries."line-center"
:The label is placed at the center of the line of the geometry. Can only be used on
LineString
andPolygon
geometries. Note that a single feature in a vector tile may contain multiple line geometries.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
| >= 0.47.0 | >= 6.4.0 | >= 4.3.0 |
symbol-sort-key
Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap
or text-allow-overlap
is false
, features with a lower sort key will have priority during placement. When icon-allow-overlap
or text-allow-overlap
is set to true
, features with a higher sort key will overlap over features with a lower sort key.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.53.0 | >= 7.4.0 | >= 4.11.0 |
data-driven styling | >= 0.53.0 | >= 7.4.0 | >= 4.11.0 |
symbol-spacing
1
. Units in pixels. Defaults to 250
. Requires symbol-placement to be "line"
. Supports interpolate
expressions. Distance between two symbol anchors.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
symbol-z-order
Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use symbol-sort-key
.
"auto"
:Sorts symbols by
symbol-sort-key
if set. Otherwise, sorts symbols by their y-position relative to the viewport ificon-allow-overlap
ortext-allow-overlap
is set totrue
oricon-ignore-placement
ortext-ignore-placement
isfalse
."viewport-y"
:Sorts symbols by their y-position relative to the viewport if
icon-allow-overlap
ortext-allow-overlap
is set totrue
oricon-ignore-placement
ortext-ignore-placement
isfalse
."source"
:Sorts symbols by
symbol-sort-key
if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.49.0 | >= 6.6.0 | >= 4.5.0 |
text-allow-overlap
If true, the text will be visible even if it collides with other previously drawn symbols.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-anchor
"center"
, "left"
, "right"
, "top"
, "bottom"
, "top-left"
, "top-right"
, "bottom-left"
, "bottom-right"
. Defaults to "center"
. Requires text-field. Disabled by text-variable-anchor. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 |
text-color
"#000000"
. Requires text-field. Supports feature-state
and interpolate
expressions. Transitionable. The color with which the text will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-field
Value to use for a text label. If a plain string
is provided, it will be treated as a formatted
with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-font
["Open Sans Regular","Arial Unicode MS Regular"]
. Requires text-field. Font stack to use for displaying text.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
text-halo-blur
0
. Units in pixels. Defaults to 0
. Requires text-field. Supports feature-state
and interpolate
expressions. Transitionable. The halo's fadeout distance towards the outside.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-halo-color
"rgba(0, 0, 0, 0)"
. Requires text-field. Supports feature-state
and interpolate
expressions. Transitionable. The color of the text's halo, which helps it stand out from backgrounds.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-halo-width
0
. Units in pixels. Defaults to 0
. Requires text-field. Supports feature-state
and interpolate
expressions. Transitionable. Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-ignore-placement
If true, other symbols can be visible even if they collide with the text.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-justify
"auto"
, "left"
, "center"
, "right"
. Defaults to "center"
. Requires text-field. Text justification options.
"auto"
:The text is aligned towards the anchor position.
"left"
:The text is aligned to the left.
"center"
:The text is centered.
"right"
:The text is aligned to the right.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 |
auto | >= 0.54.0 | >= 7.4.0 | >= 4.10.0 |
text-keep-upright
true
. Requires text-field. Requires text-rotation-alignment to be "map"
. Requires symbol-placement to be "line"
, or "line-center"
. If true, the text may be flipped vertically to prevent it from being rendered upside-down.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-letter-spacing
0
. Requires text-field. Supports interpolate
expressions. Text tracking amount.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.40.0 | >= 5.2.0 | >= 3.7.0 |
text-line-height
1.2
. Requires text-field. Supports interpolate
expressions. Text leading value for multi-line text.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 2.3.0 | >= 10.0.0 | >= 10.0.0 |
text-max-angle
45
. Requires text-field. Requires symbol-placement to be "line"
, or "line-center"
. Supports interpolate
expressions. Maximum angle change between adjacent characters.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-max-width
0
. Units in ems. Defaults to 10
. Requires text-field. Requires symbol-placement to be "point"
. Supports interpolate
expressions. The maximum line width for text wrapping.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.40.0 | >= 5.2.0 | >= 3.7.0 |
text-offset
[0,0]
. Requires text-field. Disabled by text-radial-offset. Supports interpolate
expressions. Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.35.0 | >= 5.1.0 | >= 3.6.0 |
text-opacity
0
and 1
inclusive. Defaults to 1
. Requires text-field. Supports feature-state
and interpolate
expressions. Transitionable. The opacity at which the text will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-optional
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-padding
0
. Units in pixels. Defaults to 2
. Requires text-field. Supports interpolate
expressions. Size of the additional area around the text bounding box used for detecting symbol collisions.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-pitch-alignment
"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
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.21.0 | >= 4.2.0 | >= 3.4.0 |
| >= 0.25.0 | >= 4.2.0 | >= 3.4.0 |
text-radial-offset
0
. Requires text-field. Supports interpolate
expressions. Radial offset of text, in the direction of the symbol's anchor. Useful in combination with text-variable-anchor
, which defaults to using the two-dimensional text-offset
if present.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.54.0 | >= 7.4.0 | >= 4.10.0 |
data-driven styling | >= 0.54.0 | >= 7.4.0 | >= 4.10.0 |
text-rotate
0
. Requires text-field. Supports interpolate
expressions. Rotates the text clockwise.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.35.0 | >= 5.1.0 | >= 3.6.0 |
text-rotation-alignment
"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 topoint
, aligns text east-west. Whensymbol-placement
is set toline
orline-center
, 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 topoint
, this is equivalent toviewport
. Whensymbol-placement
is set toline
orline-center
, this is equivalent tomap
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
| >= 0.25.0 | >= 4.2.0 | >= 3.4.0 |
text-size
0
. Units in pixels. Defaults to 16
. Requires text-field. Supports interpolate
expressions. Font size.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.35.0 | >= 5.1.0 | >= 3.6.0 |
text-transform
"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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.33.0 | >= 5.0.0 | >= 3.5.0 |
text-translate
[0,0]
. Requires text-field. Supports interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires text-field. Requires text-translate. Controls the frame of reference for text-translate
.
"map"
:The text is translated relative to the map.
"viewport"
:The text is translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
text-variable-anchor
"center"
, "left"
, "right"
, "top"
, "bottom"
, "top-left"
, "top-right"
, "bottom-left"
, "bottom-right"
. Requires text-field. Requires symbol-placement to be "point"
. To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor
locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use text-justify: auto
to choose justification based on anchor position. To apply an offset, use the text-radial-offset
or the two-dimensional text-offset
.
"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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.54.0 | >= 7.4.0 | >= 4.10.0 |
text-writing-mode
The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.
"horizontal"
:If a text's language supports horizontal writing mode, symbols would be laid out horizontally.
"vertical"
:If a text's language supports vertical writing mode, symbols would be laid out vertically.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 1.3.0 | >= 8.3.0 | >= 5.3.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster
A raster
style layer renders raster tiles on a map. You can use a raster layer to configure the color parameters of raster tiles.
This interactive SWIR imagery map by Maxar uses the visibility
layout property to show or hide raster layers with shortwave infrared satellite imagery of California wildfires.
raster-brightness-max
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. Increase or reduce the brightness of the image. The value is the maximum brightness.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-brightness-min
0
and 1
inclusive. Defaults to 0
. Supports interpolate
expressions. Transitionable. Increase or reduce the brightness of the image. The value is the minimum brightness.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-contrast
-1
and 1
inclusive. Defaults to 0
. Supports interpolate
expressions. Transitionable. Increase or reduce the contrast of the image.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-fade-duration
0
. Units in milliseconds. Defaults to 300
. Supports interpolate
expressions. Fade duration when a new tile is added.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-hue-rotate
0
. Supports interpolate
expressions. Transitionable. Rotates hues around the color wheel.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-opacity
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. The opacity at which the image will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
raster-resampling
The resampling/interpolation method to use for overscaling, also known as texture magnification filter
"linear"
:(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled
"nearest"
:Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.47.0 | >= 6.3.0 | >= 4.2.0 |
raster-saturation
-1
and 1
inclusive. Defaults to 0
. Supports interpolate
expressions. Transitionable. Increase or reduce the saturation of the image.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
circle
A circle
style layer renders one or more filled circles on a map. You can use a circle layer to configure the visual appearance of point or point collection features in vector tiles. A circle layer renders circles whose radii are measured in screen units.
This cluster map uses a circle layer with a GeoJSON data source and sets the source's cluster
property to true
to visualize points as clusters.
circle-blur
0
. Supports feature-state
and interpolate
expressions. Transitionable. Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.20.0 | >= 5.0.0 | >= 3.5.0 |
circle-color
"#000000"
. Supports feature-state
and interpolate
expressions. Transitionable. The fill color of the circle.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.18.0 | >= 5.0.0 | >= 3.5.0 |
circle-opacity
0
and 1
inclusive. Defaults to 1
. Supports feature-state
and interpolate
expressions. Transitionable. The opacity at which the circle will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.20.0 | >= 5.0.0 | >= 3.5.0 |
circle-pitch-alignment
Orientation of circle when map is pitched.
"map"
:The circle is aligned to the plane of the map.
"viewport"
:The circle is aligned to the plane of the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 |
circle-pitch-scale
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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.21.0 | >= 4.2.0 | >= 3.4.0 |
circle-radius
0
. Units in pixels. Defaults to 5
. Supports feature-state
and interpolate
expressions. Transitionable. Circle radius.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
data-driven styling | >= 0.18.0 | >= 5.0.0 | >= 3.5.0 |
circle-sort-key
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 1.2.0 | >= 9.2.0 | >= 5.9.0 |
data-driven styling | >= 1.2.0 | >= 9.2.0 | >= 5.9.0 |
circle-stroke-color
"#000000"
. Supports feature-state
and interpolate
expressions. Transitionable. The stroke color of the circle.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
circle-stroke-opacity
0
and 1
inclusive. Defaults to 1
. Supports feature-state
and interpolate
expressions. Transitionable. The opacity of the circle's stroke.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
circle-stroke-width
0
. Units in pixels. Defaults to 0
. Supports feature-state
and interpolate
expressions. Transitionable. The width of the circle's stroke. Strokes are placed outside of the circle-radius
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
data-driven styling | >= 0.29.0 | >= 5.0.0 | >= 3.5.0 |
circle-translate
[0,0]
. Supports interpolate
expressions. Transitionable. The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
circle-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires circle-translate. Controls the frame of reference for circle-translate
.
"map"
:The circle is translated relative to the map.
"viewport"
:The circle is translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 |
fill-extrusion
A fill-extrusion
style layer renders one or more filled (and optionally stroked) extruded (3D) polygons on a map. You can use a fill-extrusion layer to configure the extrusion and visual appearance of polygon or multipolygon features.
This map uses an external dataset to provide data-driven values for the fill-extrusion-height
paint property of various country polygons in a fill-extrusion layer.
fill-extrusion-base
0
. Units in meters. Defaults to 0
. Requires fill-extrusion-height. Supports feature-state
and interpolate
expressions. Transitionable. The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
data-driven styling | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-color
"#000000"
. Disabled by fill-extrusion-pattern. Supports feature-state
and interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
data-driven styling | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-height
0
. Units in meters. Defaults to 0
. Supports feature-state
and interpolate
expressions. Transitionable. The height with which to extrude this layer.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
data-driven styling | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-opacity
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. 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.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-pattern
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). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
data-driven styling | >= 0.49.0 | >= 6.5.0 | >= 4.4.0 |
fill-extrusion-translate
[0,0]
. Supports interpolate
expressions. Transitionable. The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-translate-anchor
"map"
, "viewport"
. Defaults to "map"
. Requires fill-extrusion-translate. Controls the frame of reference for fill-extrusion-translate
.
"map"
:The fill extrusion is translated relative to the map.
"viewport"
:The fill extrusion is translated relative to the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
fill-extrusion-vertical-gradient
Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.50.0 | >= 7.0.0 | >= 4.7.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.27.0 | >= 5.1.0 | >= 3.6.0 |
heatmap
A heatmap
style layer renders a range of colors to represent the density of points in an area.
This visualization of earthquake data uses a heatmap layer with carefully defined paint properties to highlight areas where earthquake frequency is high and many points are clustered closely together.
heatmap-color
["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"]
. Supports interpolate
expressions. Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses ["heatmap-density"]
as input.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
data-driven styling | Not yet supported | Not yet supported | Not yet supported |
heatmap-intensity
0
. Defaults to 1
. Supports interpolate
expressions. Transitionable. Similar to heatmap-weight
but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
heatmap-opacity
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. The global opacity at which the heatmap layer will be drawn.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
heatmap-radius
1
. Units in pixels. Defaults to 30
. Supports feature-state
and interpolate
expressions. Transitionable. Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. queryRenderedFeatures
on heatmap layers will return points within this radius.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
data-driven styling | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
heatmap-weight
0
. Defaults to 1
. Supports feature-state
and interpolate
expressions. A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
data-driven styling | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0 |
hillshade
A hillshade
style layer renders digital elevation model (DEM) data on the client-side. The implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
This map of Mount Shasta uses a high value for the hillshade-exaggeration
paint property to apply an intense shading effect.
hillshade-accent-color
"#000000"
. Supports interpolate
expressions. Transitionable. The shading color used to accentuate rugged terrain like sharp cliffs and gorges.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
hillshade-exaggeration
0
and 1
inclusive. Defaults to 0.5
. Supports interpolate
expressions. Transitionable. Intensity of the hillshade
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
hillshade-highlight-color
"#FFFFFF"
. Supports interpolate
expressions. Transitionable. The shading color of areas that faces towards the light source.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
hillshade-illumination-anchor
Direction of light source when map is rotated.
"map"
:The hillshade illumination is relative to the north direction.
"viewport"
:The hillshade illumination is relative to the top of the viewport.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
hillshade-illumination-direction
0
and 359
inclusive. Defaults to 335
. Supports interpolate
expressions. The direction of the light source used to generate the hillshading with 0 as the top of the viewport if hillshade-illumination-anchor
is set to viewport
and due north if hillshade-illumination-anchor
is set to map
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
hillshade-shadow-color
"#000000"
. Supports interpolate
expressions. Transitionable. The shading color of areas that face away from the light source.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 0.43.0 | >= 6.0.0 | >= 4.0.0 |
sky
A sky
style layer renders a stylized spherical dome that encompasses the entire map and is automatically rendered behind all layers. This can be used to fill the area above the horizon with a simulated sky that represents a particular time-of-day, or stylized custom gradients.
A simulated sunrise over the deserts of California using sky-type: 'atmosphere'
paint property.
sky-atmosphere-color
A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-atmosphere-halo-color
A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-atmosphere-sun
00
and 360180
inclusive. Units in degrees. Requires sky-type to be "atmosphere"
. Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-atmosphere-sun-intensity
0
and 100
inclusive. Defaults to 10
. Requires sky-type to be "atmosphere"
. Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-gradient
["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"]
. Requires sky-type to be "gradient"
. Supports interpolate
expressions. Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using sky-radial-progress
. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, sky-gradient-radius
] centered at the position specified by sky-gradient-center
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
data-driven styling | Not yet supported | Not yet supported | Not yet supported |
sky-gradient-center
00
and 360180
inclusive. Units in degrees. Defaults to [0,0]
. Requires sky-type to be "gradient"
. Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-gradient-radius
0
and 180
inclusive. Defaults to 90
. Requires sky-type to be "gradient"
. The angular distance (measured in degrees) from sky-gradient-center
up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from sky-gradient-center
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-opacity
0
and 1
inclusive. Defaults to 1
. Supports interpolate
expressions. Transitionable. The opacity of the entire sky layer.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
sky-type
The type of the sky
"gradient"
:Renders the sky with a gradient that can be configured with
sky-gradient-radius
andsky-gradient
."atmosphere"
:Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through
sky-atmosphere-sun
.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |
visibility
Whether this layer is displayed.
"visible"
:The layer is shown.
"none"
:The layer is not shown.
SDK Support | Mapbox GL JS | Android SDK | iOS SDK |
---|---|---|---|
basic functionality | >= 2.0.0 | >= 10.0.0 | >= 10.0.0 |