gampleman / elm-mapbox / Mapbox.Layer

Layers specify what is actually rendered on the map and are rendered in order.

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.

There are two kinds of properties: Layout and Paint properties.

Layout properties 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. Changes to a paint property are cheap and happen synchronously.

Skip to:

Working with layers


type Layer

Represents a layer.


type alias SourceId =
String

All layers (except background layers) need a source

encode : Layer -> Json.Encode.Value

Turns a layer into JSON

Layer Types

background : String -> List (LayerAttr Background) -> Layer

The background color or pattern of the map.

fill : String -> SourceId -> List (LayerAttr Fill) -> Layer

A filled polygon with an optional stroked border.

symbol : String -> SourceId -> List (LayerAttr Symbol) -> Layer

An icon or a text label.

line : String -> SourceId -> List (LayerAttr Line) -> Layer

A stroked line.

raster : String -> SourceId -> List (LayerAttr Raster) -> Layer

Raster map textures such as satellite imagery.

circle : String -> SourceId -> List (LayerAttr Circle) -> Layer

A filled circle.

fillExtrusion : String -> SourceId -> List (LayerAttr FillExtrusion) -> Layer

An extruded (3D) polygon.

heatmap : String -> SourceId -> List (LayerAttr Heatmap) -> Layer

A heatmap.

hillshade : String -> SourceId -> List (LayerAttr Hillshade) -> Layer

Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.


type Background


type Fill


type Symbol


type Line


type Raster


type Circle


type FillExtrusion


type Heatmap


type Hillshade

General Attributes


type LayerAttr tipe

metadata : Json.Encode.Value -> LayerAttr all

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

sourceLayer : String -> LayerAttr all

Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.

minzoom : Basics.Float -> LayerAttr all

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. A number between 0 and 24 inclusive.

maxzoom : Basics.Float -> LayerAttr all

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden. A number between 0 and 24 inclusive.

filter : Mapbox.Expression.Expression any Basics.Bool -> LayerAttr all

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

visible : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr any

Whether this layer is displayed.

Fill Attributes

fillAntialias : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Fill

Whether or not the fill should be antialiased. Paint property. Defaults to true.

fillColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Fill

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. Paint property. Defaults to #000000. Disabled by fillPattern.

fillOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Fill

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

Should be between 0 and 1 inclusive. Defaults to 1.

fillOutlineColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Fill

The outline color of the fill. Matches the value of fillColor if unspecified. Paint property. Disabled by fillPattern. Requires fillAntialias to be true.

fillPattern : Mapbox.Expression.Expression any String -> LayerAttr Fill

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. Paint property.

fillTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Fill

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property. Units in pixels. Defaults to 0,0.

fillTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Fill

Controls the frame of reference for fillTranslate. Paint property. Defaults to map. Requires fillTranslate.

Line Attributes

lineBlur : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Line

Blur applied to the line, in pixels. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 0.

lineCap : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { butt : Internal.Supported, rounded : Internal.Supported, square : Internal.Supported } -> LayerAttr Line

The display of line endings. Layout property. Defaults to butt.

lineColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Line

The color with which the line will be drawn. Paint property. Defaults to #000000. Disabled by linePattern.

lineDasharray : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Line

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. Paint property.

Should be greater than or equal to 0. Units in line widths. Disabled by linePattern.

lineGapWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Line

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

Should be greater than or equal to 0. Units in pixels. Defaults to 0.

lineGradient : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Line

Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify "lineMetrics": true. Paint property. Disabled by lineDasharray. Disabled by linePattern. Requires source to be geojson.

lineJoin : Mapbox.Expression.Expression any { bevel : Internal.Supported, rounded : Internal.Supported, miter : Internal.Supported } -> LayerAttr Line

The display of lines when joining. Layout property. Defaults to miter.

lineMiterLimit : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Line

Used to automatically convert miter joins to bevel joins for sharp angles. Layout property. Defaults to 2. Requires lineJoin to be miter.

lineOffset : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Line

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. Paint property. Units in pixels. Defaults to 0.

lineOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Line

The opacity at which the line will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

linePattern : Mapbox.Expression.Expression any String -> LayerAttr Line

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. Paint property.

lineRoundLimit : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Line

Used to automatically convert round joins to miter joins for shallow angles. Layout property. Defaults to 1.05. Requires lineJoin to be round.

lineTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Line

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property. Units in pixels. Defaults to 0,0.

lineTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Line

Controls the frame of reference for lineTranslate. Paint property. Defaults to map. Requires lineTranslate.

lineWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Line

Stroke thickness. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 1.

Circle Attributes

circleBlur : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Circle

Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. Paint property. Defaults to 0.

circleColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Circle

The fill color of the circle. Paint property. Defaults to #000000.

circleOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Circle

The opacity at which the circle will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

circlePitchAlignment : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Circle

Orientation of circle when map is pitched. Paint property. Defaults to viewport.

circlePitchScale : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Circle

Controls the scaling behavior of the circle when the map is pitched. Paint property. Defaults to map.

circleRadius : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Circle

Circle radius. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 5.

circleStrokeColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Circle

The stroke color of the circle. Paint property. Defaults to #000000.

circleStrokeOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Circle

The opacity of the circle's stroke. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

circleStrokeWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Circle

The width of the circle's stroke. Strokes are placed outside of the circleRadius. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 0.

circleTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Circle

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property. Units in pixels. Defaults to 0,0.

circleTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Circle

Controls the frame of reference for circleTranslate. Paint property. Defaults to map. Requires circleTranslate.

Heatmap Attributes

heatmapColor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Heatmap

Defines the color of each pixel based on its density value in a heatmap. The value should be an Expression that uses heatmapDensity as input. Defaults to:

  E.heatmapDensity
  |> E.interpolate E.Linear
    [ (0.0, rgba 0 0 255 0)
    , (0.1, rgba 65 105 225 1)
    , (0.3, rgba 0 255 255 1)
    , (0.5, rgba 0 255 0 1)
    , (0.7, rgba 255 255 0 1)
    , (1.0, rgba 255 0 0 1)] Paint property.

heatmapIntensity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Heatmap

Similar to heatmapWeight but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. Paint property.

Should be greater than or equal to 0. Defaults to 1.

heatmapOpacity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Heatmap

The global opacity at which the heatmap layer will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

heatmapRadius : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Heatmap

Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. Paint property.

Should be greater than or equal to 1. Units in pixels. Defaults to 30.

heatmapWeight : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Heatmap

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. Paint property.

Should be greater than or equal to 0. Defaults to 1.

FillExtrusion Attributes

fillExtrusionBase : Mapbox.Expression.Expression any Basics.Float -> LayerAttr FillExtrusion

The height with which to extrude the base of this layer. Must be less than or equal to fillExtrusionHeight. Paint property.

Should be greater than or equal to 0. Units in meters. Defaults to 0. Requires fillExtrusionHeight.

fillExtrusionColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr FillExtrusion

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 fillExtrusionOpacity to set layer opacity. Paint property. Defaults to #000000. Disabled by fillExtrusionPattern.

fillExtrusionHeight : Mapbox.Expression.Expression any Basics.Float -> LayerAttr FillExtrusion

The height with which to extrude this layer. Paint property.

Should be greater than or equal to 0. Units in meters. Defaults to 0.

fillExtrusionOpacity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr FillExtrusion

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. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

fillExtrusionPattern : Mapbox.Expression.Expression any String -> LayerAttr FillExtrusion

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. Paint property.

fillExtrusionTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr FillExtrusion

The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. Paint property. Units in pixels. Defaults to 0,0.

fillExtrusionTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr FillExtrusion

Controls the frame of reference for fillExtrusionTranslate. Paint property. Defaults to map. Requires fillExtrusionTranslate.

fillExtrusionVerticalGradient : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr FillExtrusion

Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down. Paint property. Defaults to true.

Symbol Attributes

iconAllowOverlap : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, the icon will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to false. Requires iconImage.

iconAnchor : Mapbox.Expression.Expression any { center : Internal.Supported, left : Internal.Supported, right : Internal.Supported, top : Internal.Supported, bottom : Internal.Supported, topLeft : Internal.Supported, topRight : Internal.Supported, bottomLeft : Internal.Supported, bottomRight : Internal.Supported } -> LayerAttr Symbol

Part of the icon placed closest to the anchor. Layout property. Defaults to center. Requires iconImage.

iconColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Symbol

The color of the icon. This can only be used with sdf icons. Paint property. Defaults to #000000. Requires iconImage.

iconHaloBlur : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Fade out the halo towards the outside. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 0. Requires iconImage.

iconHaloColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Symbol

The color of the icon's halo. Icon halos can only be used with SDF icons. Paint property. Defaults to rgba 0 0 0 0. Requires iconImage.

iconHaloWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Distance of halo to the icon outline. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 0. Requires iconImage.

iconIgnorePlacement : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, other symbols can be visible even if they collide with the icon. Layout property. Defaults to false. Requires iconImage.

iconImage : Mapbox.Expression.Expression any String -> LayerAttr Symbol

Name of image in sprite to use for drawing an image background. Layout property.

iconKeepUpright : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, the icon may be flipped to prevent it from being rendered upside-down. Layout property. Defaults to false. Requires iconImage. Requires iconRotationAlignment to be map. Requires symbolPlacement to be line, or lineCenter.

iconOffset : Mapbox.Expression.Expression any (Array Basics.Float) -> LayerAttr Symbol

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 iconSize to obtain the final offset in pixels. When combined with iconRotate the offset will be as if the rotated direction was up. Layout property. Defaults to 0,0. Requires iconImage.

iconOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

The opacity at which the icon will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1. Requires iconImage.

iconOptional : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not. Layout property. Defaults to false. Requires iconImage. Requires textField.

iconPadding : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

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

Should be greater than or equal to 0. Units in pixels. Defaults to 2. Requires iconImage.

iconPitchAlignment : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported, auto : Internal.Supported } -> LayerAttr Symbol

Orientation of icon when map is pitched. Layout property. Defaults to auto. Requires iconImage.

iconRotate : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Rotates the icon clockwise. Layout property. Units in degrees. Defaults to 0. Requires iconImage.

iconRotationAlignment : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported, auto : Internal.Supported } -> LayerAttr Symbol

In combination with symbolPlacement, determines the rotation behavior of icons. Layout property. Defaults to auto. Requires iconImage.

iconSize : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

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 iconSize. 1 is the original size; 3 triples the size of the image. Layout property.

Should be greater than or equal to 0. Units in factor of the original icon size. Defaults to 1. Requires iconImage.

iconTextFit : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { none : Internal.Supported, width : Internal.Supported, height : Internal.Supported, both : Internal.Supported } -> LayerAttr Symbol

Scales the icon to fit around the associated text. Layout property. Defaults to none. Requires iconImage. Requires textField.

iconTextFitPadding : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Symbol

Size of the additional area added to dimensions determined by iconTextFit, in clockwise order: top, right, bottom, left. Layout property. Units in pixels. Defaults to 0,0,0,0. Requires iconImage. Requires textField. Requires iconTextFit to be both, or width, or height.

iconTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Symbol

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. Paint property. Units in pixels. Defaults to 0,0. Requires iconImage.

iconTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Symbol

Controls the frame of reference for iconTranslate. Paint property. Defaults to map. Requires iconImage. Requires iconTranslate.

symbolAvoidEdges : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

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. Layout property. Defaults to false.

symbolPlacement : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { point : Internal.Supported, line : Internal.Supported, lineCenter : Internal.Supported } -> LayerAttr Symbol

Label placement relative to its geometry. Layout property. Defaults to point.

symbolSortKey : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement. Layout property.

symbolSpacing : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

Distance between two symbol anchors. Layout property.

Should be greater than or equal to 1. Units in pixels. Defaults to 250. Requires symbolPlacement to be line.

symbolZOrder : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { auto : Internal.Supported, viewportY : Internal.Supported, source : Internal.Supported } -> LayerAttr Symbol

Controls the order in which overlapping symbols in the same layer are rendered Layout property. Defaults to auto.

textAllowOverlap : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, the text will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to false. Requires textField.

textAnchor : Mapbox.Expression.Expression any { center : Internal.Supported, left : Internal.Supported, right : Internal.Supported, top : Internal.Supported, bottom : Internal.Supported, topLeft : Internal.Supported, topRight : Internal.Supported, bottomLeft : Internal.Supported, bottomRight : Internal.Supported } -> LayerAttr Symbol

Part of the text placed closest to the anchor. Layout property. Defaults to center. Requires textField.

textColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Symbol

The color with which the text will be drawn. Paint property. Defaults to #000000. Requires textField.

textField : Mapbox.Expression.Expression any Mapbox.Expression.FormattedText -> LayerAttr Symbol

Value to use for a text label. Layout property. Defaults to "".

textFont : Mapbox.Expression.Expression any (Array String) -> LayerAttr Symbol

Font stack to use for displaying text. Layout property. Requires textField.

textHaloBlur : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

The halo's fadeout distance towards the outside. Paint property.

Should be greater than or equal to 0. Units in pixels. Defaults to 0. Requires textField.

textHaloColor : Mapbox.Expression.Expression any Mapbox.Expression.Color -> LayerAttr Symbol

The color of the text's halo, which helps it stand out from backgrounds. Paint property. Defaults to rgba 0 0 0 0. Requires textField.

textHaloWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

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

Should be greater than or equal to 0. Units in pixels. Defaults to 0. Requires textField.

textIgnorePlacement : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, other symbols can be visible even if they collide with the text. Layout property. Defaults to false. Requires textField.

textJustify : Mapbox.Expression.Expression any { left : Internal.Supported, center : Internal.Supported, right : Internal.Supported } -> LayerAttr Symbol

Text justification options. Layout property. Defaults to center. Requires textField.

textKeepUpright : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, the text may be flipped vertically to prevent it from being rendered upside-down. Layout property. Defaults to true. Requires textField. Requires textRotationAlignment to be map. Requires symbolPlacement to be line, or lineCenter.

textLetterSpacing : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Text tracking amount. Layout property. Units in ems. Defaults to 0. Requires textField.

textLineHeight : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

Text leading value for multi-line text. Layout property. Units in ems. Defaults to 1.2. Requires textField.

textMaxAngle : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

Maximum angle change between adjacent characters. Layout property. Units in degrees. Defaults to 45. Requires textField. Requires symbolPlacement to be line, or lineCenter.

textMaxWidth : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

The maximum line width for text wrapping. Layout property.

Should be greater than or equal to 0. Units in ems. Defaults to 10. Requires textField.

textOffset : Mapbox.Expression.Expression any (Array Basics.Float) -> LayerAttr Symbol

Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. Layout property. Units in ems. Defaults to 0,0. Requires textField. Disabled by textRadialOffset.

textOpacity : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

The opacity at which the text will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1. Requires textField.

textOptional : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Bool -> LayerAttr Symbol

If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not. Layout property. Defaults to false. Requires textField. Requires iconImage.

textPadding : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

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

Should be greater than or equal to 0. Units in pixels. Defaults to 2. Requires textField.

textPitchAlignment : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported, auto : Internal.Supported } -> LayerAttr Symbol

Orientation of text when map is pitched. Layout property. Defaults to auto. Requires textField.

textRadialOffset : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Symbol

Radial offset of text, in the direction of the symbol's anchor. Useful in combination with textVariableAnchor, which doesn't support the two-dimensional textOffset. Layout property. Units in ems. Defaults to 0. Disabled by textOffset.

textRotate : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Rotates the text clockwise. Layout property. Units in degrees. Defaults to 0. Requires textField.

textRotationAlignment : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported, auto : Internal.Supported } -> LayerAttr Symbol

In combination with symbolPlacement, determines the rotation behavior of the individual glyphs forming the text. Layout property. Defaults to auto. Requires textField.

textSize : Mapbox.Expression.Expression any Basics.Float -> LayerAttr Symbol

Font size. Layout property.

Should be greater than or equal to 0. Units in pixels. Defaults to 16. Requires textField.

textTransform : Mapbox.Expression.Expression any { none : Internal.Supported, uppercase : Internal.Supported, lowercase : Internal.Supported } -> LayerAttr Symbol

Specifies how to capitalize text, similar to the CSS textTransform property. Layout property. Defaults to none. Requires textField.

textTranslate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array Basics.Float) -> LayerAttr Symbol

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. Paint property. Units in pixels. Defaults to 0,0. Requires textField.

textTranslateAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Symbol

Controls the frame of reference for textTranslate. Paint property. Defaults to map. Requires textField. Requires textTranslate.

textVariableAnchor : Mapbox.Expression.Expression any (Array { center : Internal.Supported, left : Internal.Supported, right : Internal.Supported, top : Internal.Supported, bottom : Internal.Supported, topLeft : Internal.Supported, topRight : Internal.Supported, bottomLeft : Internal.Supported, bottomRight : Internal.Supported }) -> LayerAttr Symbol

To increase the chance of placing high-priority labels on the map, you can provide an array of textAnchor locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use textJustify:Auto to choose justification based on anchor position. To apply an offset, use the textRadialOffset instead of the two-dimensional textOffset. Layout property. Disabled by textAnchor. Disabled by textOffset. Requires symbolPlacement to be point.

Raster Attributes

rasterBrightnessMax : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

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

Should be between 0 and 1 inclusive. Defaults to 1.

rasterBrightnessMin : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

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

Should be between 0 and 1 inclusive. Defaults to 0.

rasterContrast : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

Increase or reduce the contrast of the image. Paint property.

Should be between -1 and 1 inclusive. Defaults to 0.

rasterFadeDuration : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

Fade duration when a new tile is added. Paint property.

Should be greater than or equal to 0. Units in milliseconds. Defaults to 300.

rasterHueRotate : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

Rotates hues around the color wheel. Paint property. Units in degrees. Defaults to 0.

rasterOpacity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

The opacity at which the image will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

rasterResampling : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { linear : Internal.Supported, nearest : Internal.Supported } -> LayerAttr Raster

The resampling/interpolation method to use for overscaling, also known as texture magnification filter Paint property. Defaults to linear.

rasterSaturation : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Raster

Increase or reduce the saturation of the image. Paint property.

Should be between -1 and 1 inclusive. Defaults to 0.

Hillshade Attributes

hillshadeAccentColor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Hillshade

The shading color used to accentuate rugged terrain like sharp cliffs and gorges. Paint property. Defaults to #000000.

hillshadeExaggeration : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Hillshade

Intensity of the hillshade Paint property.

Should be between 0 and 1 inclusive. Defaults to 0.5.

hillshadeHighlightColor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Hillshade

The shading color of areas that faces towards the light source. Paint property. Defaults to #FFFFFF.

hillshadeIlluminationAnchor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression { map : Internal.Supported, viewport : Internal.Supported } -> LayerAttr Hillshade

Direction of light source when map is rotated. Paint property. Defaults to viewport.

hillshadeIlluminationDirection : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Hillshade

The direction of the light source used to generate the hillshading with 0 as the top of the viewport if hillshadeIlluminationAnchor is set to viewport and due north if hillshadeIlluminationAnchor is set to map. Paint property.

Should be between 0 and 359 inclusive. Defaults to 335.

hillshadeShadowColor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Hillshade

The shading color of areas that face away from the light source. Paint property. Defaults to #000000.

Background Attributes

backgroundColor : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> LayerAttr Background

The color with which the background will be drawn. Paint property. Defaults to #000000. Disabled by backgroundPattern.

backgroundOpacity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Basics.Float -> LayerAttr Background

The opacity at which the background will be drawn. Paint property.

Should be between 0 and 1 inclusive. Defaults to 1.

backgroundPattern : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression String -> LayerAttr Background

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. Paint property.