aboutsummaryrefslogtreecommitdiffstats
path: root/src/Mapbox/Layer.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mapbox/Layer.elm')
-rw-r--r--src/Mapbox/Layer.elm412
1 files changed, 183 insertions, 229 deletions
diff --git a/src/Mapbox/Layer.elm b/src/Mapbox/Layer.elm
index 375a9d6..1eb4509 100644
--- a/src/Mapbox/Layer.elm
+++ b/src/Mapbox/Layer.elm
@@ -1,148 +1,19 @@
-module Mapbox.Layer
- exposing
- ( Background
- , Circle
- , Fill
- , FillExtrusion
- , Heatmap
- , Hillshade
- , Layer
- , LayerAttr
- , Line
- , Raster
- , SourceId
- , Symbol
- , background
- , backgroundColor
- , backgroundOpacity
- , backgroundPattern
- , circle
- , circleBlur
- , circleColor
- , circleOpacity
- , circlePitchAlignment
- , circlePitchScale
- , circleRadius
- , circleStrokeColor
- , circleStrokeOpacity
- , circleStrokeWidth
- , circleTranslate
- , circleTranslateAnchor
- , encode
- , fill
- , fillAntialias
- , fillColor
- , fillExtrusion
- , fillExtrusionBase
- , fillExtrusionColor
- , fillExtrusionHeight
- , fillExtrusionOpacity
- , fillExtrusionPattern
- , fillExtrusionTranslate
- , fillExtrusionTranslateAnchor
- , fillExtrusionVerticalGradient
- , fillOpacity
- , fillOutlineColor
- , fillPattern
- , fillTranslate
- , fillTranslateAnchor
- , filter
- , heatmap
- , heatmapColor
- , heatmapIntensity
- , heatmapOpacity
- , heatmapRadius
- , heatmapWeight
- , hillshade
- , hillshadeAccentColor
- , hillshadeExaggeration
- , hillshadeHighlightColor
- , hillshadeIlluminationAnchor
- , hillshadeIlluminationDirection
- , hillshadeShadowColor
- , iconAllowOverlap
- , iconAnchor
- , iconColor
- , iconHaloBlur
- , iconHaloColor
- , iconHaloWidth
- , iconIgnorePlacement
- , iconImage
- , iconKeepUpright
- , iconOffset
- , iconOpacity
- , iconOptional
- , iconPadding
- , iconPitchAlignment
- , iconRotate
- , iconRotationAlignment
- , iconSize
- , iconTextFit
- , iconTextFitPadding
- , iconTranslate
- , iconTranslateAnchor
- , line
- , lineBlur
- , lineCap
- , lineColor
- , lineDasharray
- , lineGapWidth
- , lineGradient
- , lineJoin
- , lineMiterLimit
- , lineOffset
- , lineOpacity
- , linePattern
- , lineRoundLimit
- , lineTranslate
- , lineTranslateAnchor
- , lineWidth
- , maxzoom
- , metadata
- , minzoom
- , raster
- , rasterBrightnessMax
- , rasterBrightnessMin
- , rasterContrast
- , rasterFadeDuration
- , rasterHueRotate
- , rasterOpacity
- , rasterResampling
- , rasterSaturation
- , sourceLayer
- , symbol
- , symbolAvoidEdges
- , symbolPlacement
- , symbolSpacing
- , symbolZOrder
- , textAllowOverlap
- , textAnchor
- , textColor
- , textField
- , textFont
- , textHaloBlur
- , textHaloColor
- , textHaloWidth
- , textIgnorePlacement
- , textJustify
- , textKeepUpright
- , textLetterSpacing
- , textLineHeight
- , textMaxAngle
- , textMaxWidth
- , textOffset
- , textOpacity
- , textOptional
- , textPadding
- , textPitchAlignment
- , textRotate
- , textRotationAlignment
- , textSize
- , textTransform
- , textTranslate
- , textTranslateAnchor
- , visible
- )
+module Mapbox.Layer exposing
+ ( Layer, SourceId, encode
+ , background, fill, symbol, line, raster, circle, fillExtrusion, heatmap, hillshade
+ , Background, Fill, Symbol, Line, Raster, Circle, FillExtrusion, Heatmap, Hillshade
+ , LayerAttr
+ , metadata, sourceLayer, minzoom, maxzoom, filter, visible
+ , fillAntialias, fillColor, fillOpacity, fillOutlineColor, fillPattern, fillTranslate, fillTranslateAnchor
+ , lineBlur, lineCap, lineColor, lineDasharray, lineGapWidth, lineGradient, lineJoin, lineMiterLimit, lineOffset, lineOpacity, linePattern, lineRoundLimit, lineTranslate, lineTranslateAnchor, lineWidth
+ , circleBlur, circleColor, circleOpacity, circlePitchAlignment, circlePitchScale, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, circleTranslate, circleTranslateAnchor
+ , heatmapColor, heatmapIntensity, heatmapOpacity, heatmapRadius, heatmapWeight
+ , fillExtrusionBase, fillExtrusionColor, fillExtrusionHeight, fillExtrusionOpacity, fillExtrusionPattern, fillExtrusionTranslate, fillExtrusionTranslateAnchor, fillExtrusionVerticalGradient
+ , iconAllowOverlap, iconAnchor, iconColor, iconHaloBlur, iconHaloColor, iconHaloWidth, iconIgnorePlacement, iconImage, iconKeepUpright, iconOffset, iconOpacity, iconOptional, iconPadding, iconPitchAlignment, iconRotate, iconRotationAlignment, iconSize, iconTextFit, iconTextFitPadding, iconTranslate, iconTranslateAnchor, symbolAvoidEdges, symbolPlacement, symbolSortKey, symbolSpacing, symbolZOrder, textAllowOverlap, textAnchor, textColor, textField, textFont, textHaloBlur, textHaloColor, textHaloWidth, textIgnorePlacement, textJustify, textKeepUpright, textLetterSpacing, textLineHeight, textMaxAngle, textMaxWidth, textOffset, textOpacity, textOptional, textPadding, textPitchAlignment, textRotate, textRotationAlignment, textSize, textTransform, textTranslate, textTranslateAnchor
+ , rasterBrightnessMax, rasterBrightnessMin, rasterContrast, rasterFadeDuration, rasterHueRotate, rasterOpacity, rasterResampling, rasterSaturation
+ , hillshadeAccentColor, hillshadeExaggeration, hillshadeHighlightColor, hillshadeIlluminationAnchor, hillshadeIlluminationDirection, hillshadeShadowColor
+ , backgroundColor, backgroundOpacity, backgroundPattern
+ )
{-| Layers specify what is actually rendered on the map and are rendered in order.
@@ -155,6 +26,19 @@ Layout properties are applied early in the rendering process and define how data
Paint properties are applied later in the rendering process. Changes to a paint property are cheap and happen synchronously.
+#### Skip to:
+
+ - [Fill Attributes](#fill-attibutes)
+ - [Line Attributes](#line-attibutes)
+ - [Circle Attributes](#circle-attibutes)
+ - [Heatmap Attributes](#heatmap-attibutes)
+ - [FillExtrusion Attributes](#fillextrusion-attibutes)
+ - [Symbol Attributes](#symbol-attibutes)
+ - [Raster Attributes](#raster-attibutes)
+ - [Hillshade Attributes](#hillshade-attibutes)
+ - [Background Attributes](#background-attibutes)
+
+
### Working with layers
@docs Layer, SourceId, encode
@@ -199,7 +83,7 @@ Paint properties are applied later in the rendering process. Changes to a paint
### Symbol Attributes
-@docs iconAllowOverlap, iconAnchor, iconColor, iconHaloBlur, iconHaloColor, iconHaloWidth, iconIgnorePlacement, iconImage, iconKeepUpright, iconOffset, iconOpacity, iconOptional, iconPadding, iconPitchAlignment, iconRotate, iconRotationAlignment, iconSize, iconTextFit, iconTextFitPadding, iconTranslate, iconTranslateAnchor, symbolAvoidEdges, symbolPlacement, symbolSpacing, symbolZOrder, textAllowOverlap, textAnchor, textColor, textField, textFont, textHaloBlur, textHaloColor, textHaloWidth, textIgnorePlacement, textJustify, textKeepUpright, textLetterSpacing, textLineHeight, textMaxAngle, textMaxWidth, textOffset, textOpacity, textOptional, textPadding, textPitchAlignment, textRotate, textRotationAlignment, textSize, textTransform, textTranslate, textTranslateAnchor
+@docs iconAllowOverlap, iconAnchor, iconColor, iconHaloBlur, iconHaloColor, iconHaloWidth, iconIgnorePlacement, iconImage, iconKeepUpright, iconOffset, iconOpacity, iconOptional, iconPadding, iconPitchAlignment, iconRotate, iconRotationAlignment, iconSize, iconTextFit, iconTextFitPadding, iconTranslate, iconTranslateAnchor, symbolAvoidEdges, symbolPlacement, symbolSortKey, symbolSpacing, symbolZOrder, textAllowOverlap, textAnchor, textColor, textField, textFont, textHaloBlur, textHaloColor, textHaloWidth, textIgnorePlacement, textJustify, textKeepUpright, textLetterSpacing, textLineHeight, textMaxAngle, textMaxWidth, textOffset, textOpacity, textOptional, textPadding, textPitchAlignment, textRotate, textRotationAlignment, textSize, textTransform, textTranslate, textTranslateAnchor
### Raster Attributes
@@ -219,8 +103,9 @@ Paint properties are applied later in the rendering process. Changes to a paint
-}
import Array exposing (Array)
+import Internal exposing (Supported)
import Json.Encode as Encode exposing (Value)
-import Mapbox.Expression as Expression exposing (Anchor, Auto, CameraExpression, Color, DataExpression, Expression, FormattedText, LineCap, LineJoin, Position, RasterResampling, SymbolPlacement, SymbolZOrder, TextFit, TextJustify, TextTransform)
+import Mapbox.Expression as Expression exposing (CameraExpression, Color, DataExpression, Expression, FormattedText)
{-| Represents a layer.
@@ -443,13 +328,13 @@ visible vis =
-- Fill
-{-| Controls the frame of reference for `fillTranslate`. Paint property. Defaults to `anchorMap`. Requires `fillTranslate`.
+{-| Controls the frame of reference for `fillTranslate`. Paint property. Defaults to `map`. Requires `fillTranslate`.
- - `anchorMap`: The fill is translated relative to the map.
- - `anchorViewport`: The fill is translated relative to the viewport.
+ - `map`: The fill is translated relative to the map.
+ - `viewport`: The fill is translated relative to the viewport.
-}
-fillTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Fill
+fillTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Fill
fillTranslateAnchor =
Expression.encode >> Paint "fill-translate-anchor"
@@ -515,13 +400,13 @@ lineBlur =
Expression.encode >> Paint "line-blur"
-{-| Controls the frame of reference for `lineTranslate`. Paint property. Defaults to `anchorMap`. Requires `lineTranslate`.
+{-| Controls the frame of reference for `lineTranslate`. Paint property. Defaults to `map`. Requires `lineTranslate`.
- - `anchorMap`: The line is translated relative to the map.
- - `anchorViewport`: The line is translated relative to the viewport.
+ - `map`: The line is translated relative to the map.
+ - `viewport`: The line is translated relative to the viewport.
-}
-lineTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Line
+lineTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Line
lineTranslateAnchor =
Expression.encode >> Paint "line-translate-anchor"
@@ -580,16 +465,26 @@ lineColor =
Expression.encode >> Paint "line-color"
-{-| The display of line endings. Layout property. Defaults to `lineCapButt`.
+{-| The display of line endings. Layout property. Defaults to `butt`.
+
+ - `butt`: A cap with a squared-off end which is drawn to the exact endpoint of the line.
+ - `rounded`: 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.
+
-}
-lineCap : Expression CameraExpression LineCap -> LayerAttr Line
+lineCap : Expression CameraExpression { butt : Supported, rounded : Supported, square : Supported } -> LayerAttr Line
lineCap =
Expression.encode >> Layout "line-cap"
-{-| The display of lines when joining. Layout property. Defaults to `lineJoinMiter`.
+{-| The display of lines when joining. Layout property. Defaults to `miter`.
+
+ - `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.
+ - `rounded`: 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.
+
-}
-lineJoin : Expression any LineJoin -> LayerAttr Line
+lineJoin : Expression any { bevel : Supported, rounded : Supported, miter : Supported } -> LayerAttr Line
lineJoin =
Expression.encode >> Layout "line-join"
@@ -656,35 +551,35 @@ circleRadius =
Expression.encode >> Paint "circle-radius"
-{-| Controls the frame of reference for `circleTranslate`. Paint property. Defaults to `anchorMap`. Requires `circleTranslate`.
+{-| Controls the frame of reference for `circleTranslate`. Paint property. Defaults to `map`. Requires `circleTranslate`.
- - `anchorMap`: The circle is translated relative to the map.
- - `anchorViewport`: The circle is translated relative to the viewport.
+ - `map`: The circle is translated relative to the map.
+ - `viewport`: The circle is translated relative to the viewport.
-}
-circleTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Circle
+circleTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Circle
circleTranslateAnchor =
Expression.encode >> Paint "circle-translate-anchor"
-{-| Controls the scaling behavior of the circle when the map is pitched. Paint property. Defaults to `anchorMap`.
+{-| Controls the scaling behavior of the circle when the map is pitched. Paint property. Defaults to `map`.
- - `anchorMap`: Circles are scaled according to their apparent distance to the camera.
- - `anchorViewport`: Circles are not scaled.
+ - `map`: Circles are scaled according to their apparent distance to the camera.
+ - `viewport`: Circles are not scaled.
-}
-circlePitchScale : Expression CameraExpression (Anchor Never) -> LayerAttr Circle
+circlePitchScale : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Circle
circlePitchScale =
Expression.encode >> Paint "circle-pitch-scale"
-{-| Orientation of circle when map is pitched. Paint property. Defaults to `anchorViewport`.
+{-| Orientation of circle when map is pitched. Paint property. Defaults to `viewport`.
- - `anchorMap`: The circle is aligned to the plane of the map.
- - `anchorViewport`: The circle is aligned to the plane of the viewport.
+ - `map`: The circle is aligned to the plane of the map.
+ - `viewport`: The circle is aligned to the plane of the viewport.
-}
-circlePitchAlignment : Expression CameraExpression (Anchor Never) -> LayerAttr Circle
+circlePitchAlignment : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Circle
circlePitchAlignment =
Expression.encode >> Paint "circle-pitch-alignment"
@@ -808,13 +703,13 @@ heatmapOpacity =
-- FillExtrusion
-{-| Controls the frame of reference for `fillExtrusionTranslate`. Paint property. Defaults to `anchorMap`. Requires `fillExtrusionTranslate`.
+{-| Controls the frame of reference for `fillExtrusionTranslate`. Paint property. Defaults to `map`. Requires `fillExtrusionTranslate`.
- - `anchorMap`: The fill extrusion is translated relative to the map.
- - `anchorViewport`: The fill extrusion is translated relative to the viewport.
+ - `map`: The fill extrusion is translated relative to the map.
+ - `viewport`: The fill extrusion is translated relative to the viewport.
-}
-fillExtrusionTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr FillExtrusion
+fillExtrusionTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr FillExtrusion
fillExtrusionTranslateAnchor =
Expression.encode >> Paint "fill-extrusion-translate-anchor"
@@ -884,31 +779,36 @@ fillExtrusionVerticalGradient =
-- Symbol
-{-| Controls the frame of reference for `iconTranslate`. Paint property. Defaults to `anchorMap`. Requires `iconImage`. Requires `iconTranslate`.
+{-| Controls the frame of reference for `iconTranslate`. Paint property. Defaults to `map`. Requires `iconImage`. Requires `iconTranslate`.
- - `anchorMap`: Icons are translated relative to the map.
- - `anchorViewport`: Icons are translated relative to the viewport.
+ - `map`: Icons are translated relative to the map.
+ - `viewport`: Icons are translated relative to the viewport.
-}
-iconTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Symbol
+iconTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Symbol
iconTranslateAnchor =
Expression.encode >> Paint "icon-translate-anchor"
-{-| Controls the frame of reference for `textTranslate`. Paint property. Defaults to `anchorMap`. Requires `textField`. Requires `textTranslate`.
+{-| Controls the frame of reference for `textTranslate`. Paint property. Defaults to `map`. Requires `textField`. Requires `textTranslate`.
- - `anchorMap`: The text is translated relative to the map.
- - `anchorViewport`: The text is translated relative to the viewport.
+ - `map`: The text is translated relative to the map.
+ - `viewport`: The text is translated relative to the viewport.
-}
-textTranslateAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Symbol
+textTranslateAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Symbol
textTranslateAnchor =
Expression.encode >> Paint "text-translate-anchor"
-{-| Controls the order in which overlapping symbols in the same layer are rendered Layout property. Defaults to `orderViewportY`.
+{-| Controls the order in which overlapping symbols in the same layer are rendered Layout property. Defaults to `auto`.
+
+ - `auto`: If `symbolSortKey` is set, sort based on that. Otherwise sort symbols by their position relative to the viewport.
+ - `viewportY`: Symbols will be sorted by their y-position relative to the viewport.
+ - `source`: Symbols will be rendered in the same order as the source data with no sorting applied.
+
-}
-symbolZOrder : Expression CameraExpression SymbolZOrder -> LayerAttr Symbol
+symbolZOrder : Expression CameraExpression { auto : Supported, viewportY : Supported, source : Supported } -> LayerAttr Symbol
symbolZOrder =
Expression.encode >> Layout "symbol-z-order"
@@ -1019,7 +919,7 @@ iconOptional =
Expression.encode >> Layout "icon-optional"
-{-| 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 `symbolPlacementLine`, or `symbolPlacementLineCenter`.
+{-| 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`.
-}
iconKeepUpright : Expression CameraExpression Bool -> LayerAttr Symbol
iconKeepUpright =
@@ -1040,7 +940,7 @@ symbolAvoidEdges =
Expression.encode >> Layout "symbol-avoid-edges"
-{-| 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 `symbolPlacementLine`, or `symbolPlacementLineCenter`.
+{-| 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`.
-}
textKeepUpright : Expression CameraExpression Bool -> LayerAttr Symbol
textKeepUpright =
@@ -1054,39 +954,44 @@ textAllowOverlap =
Expression.encode >> Layout "text-allow-overlap"
-{-| In combination with `symbolPlacement`, determines the rotation behavior of icons. Layout property. Defaults to `anchorAuto`. Requires `iconImage`.
+{-| In combination with `symbolPlacement`, determines the rotation behavior of icons. Layout property. Defaults to `auto`. Requires `iconImage`.
- - `anchorMap`: When `symbolPlacement` is set to `symbolPlacementPoint`, aligns icons east-west. When `symbolPlacement` is set to `symbolPlacementLine` or `symbolPlacementLineCenter`, aligns icon x-axes with the line.
- - `anchorViewport`: Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
- - `anchorAuto`: When `symbolPlacement` is set to `symbolPlacementPoint`, this is equivalent to `anchorViewport`. When `symbolPlacement` is set to `symbolPlacementLine` or `symbolPlacementLineCenter`, this is equivalent to `anchorMap`.
+ - `map`: When `symbolPlacement` is set to `point`, aligns icons east-west. When `symbolPlacement` is set to `line` or `lineCenter`, 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 `symbolPlacement`.
+ - `auto`: When `symbolPlacement` is set to `point`, this is equivalent to `viewport`. When `symbolPlacement` is set to `line` or `lineCenter`, this is equivalent to `map`.
-}
-iconRotationAlignment : Expression CameraExpression (Anchor Auto) -> LayerAttr Symbol
+iconRotationAlignment : Expression CameraExpression { map : Supported, viewport : Supported, auto : Supported } -> LayerAttr Symbol
iconRotationAlignment =
Expression.encode >> Layout "icon-rotation-alignment"
-{-| In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. Layout property. Defaults to `anchorAuto`. Requires `textField`.
+{-| In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. Layout property. Defaults to `auto`. Requires `textField`.
- - `anchorMap`: When `symbolPlacement` is set to `symbolPlacementPoint`, aligns text east-west. When `symbolPlacement` is set to `symbolPlacementLine` or `symbolPlacementLineCenter`, aligns text x-axes with the line.
- - `anchorViewport`: Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbolPlacement`.
- - `anchorAuto`: When `symbolPlacement` is set to `symbolPlacementPoint`, this is equivalent to `anchorViewport`. When `symbolPlacement` is set to `symbolPlacementLine` or `symbolPlacementLineCenter`, this is equivalent to `anchorMap`.
+ - `map`: When `symbolPlacement` is set to `point`, aligns text east-west. When `symbolPlacement` is set to `line` or `lineCenter`, 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 `symbolPlacement`.
+ - `auto`: When `symbolPlacement` is set to `point`, this is equivalent to `viewport`. When `symbolPlacement` is set to `line` or `lineCenter`, this is equivalent to `map`.
-}
-textRotationAlignment : Expression CameraExpression (Anchor Auto) -> LayerAttr Symbol
+textRotationAlignment : Expression CameraExpression { map : Supported, viewport : Supported, auto : Supported } -> LayerAttr Symbol
textRotationAlignment =
Expression.encode >> Layout "text-rotation-alignment"
-{-| Label placement relative to its geometry. Layout property. Defaults to `symbolPlacementPoint`.
+{-| Label placement relative to its geometry. Layout property. Defaults to `point`.
+
+ - `point`: The label is placed at the point where the geometry is located.
+ - `line`: The label is placed along the line of the geometry. Can only be used on `lineString` and `polygon` geometries.
+ - `lineCenter`: The label is placed at the center of the line of the geometry. Can only be used on `lineString` and `polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries.
+
-}
-symbolPlacement : Expression CameraExpression SymbolPlacement -> LayerAttr Symbol
+symbolPlacement : Expression CameraExpression { point : Supported, line : Supported, lineCenter : Supported } -> LayerAttr Symbol
symbolPlacement =
Expression.encode >> Layout "symbol-placement"
{-| Maximum angle change between adjacent characters. Layout property.
-Units in degrees. Defaults to `45`. Requires `textField`. Requires `symbolPlacement` to be `symbolPlacementLine`, or `symbolPlacementLineCenter`.
+Units in degrees. Defaults to `45`. Requires `textField`. Requires `symbolPlacement` to be `line`, or `lineCenter`.
-}
textMaxAngle : Expression CameraExpression Float -> LayerAttr Symbol
textMaxAngle =
@@ -1115,40 +1020,62 @@ textOffset =
Expression.encode >> Layout "text-offset"
-{-| Orientation of icon when map is pitched. Layout property. Defaults to `anchorAuto`. Requires `iconImage`.
+{-| Orientation of icon when map is pitched. Layout property. Defaults to `auto`. Requires `iconImage`.
- - `anchorMap`: The icon is aligned to the plane of the map.
- - `anchorViewport`: The icon is aligned to the plane of the viewport.
- - `anchorAuto`: Automatically matches the value of `iconRotationAlignment`.
+ - `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 `iconRotationAlignment`.
-}
-iconPitchAlignment : Expression CameraExpression (Anchor Auto) -> LayerAttr Symbol
+iconPitchAlignment : Expression CameraExpression { map : Supported, viewport : Supported, auto : Supported } -> LayerAttr Symbol
iconPitchAlignment =
Expression.encode >> Layout "icon-pitch-alignment"
-{-| Orientation of text when map is pitched. Layout property. Defaults to `anchorAuto`. Requires `textField`.
+{-| Orientation of text when map is pitched. Layout property. Defaults to `auto`. Requires `textField`.
- - `anchorMap`: The text is aligned to the plane of the map.
- - `anchorViewport`: The text is aligned to the plane of the viewport.
- - `anchorAuto`: Automatically matches the value of `textRotationAlignment`.
+ - `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 `textRotationAlignment`.
-}
-textPitchAlignment : Expression CameraExpression (Anchor Auto) -> LayerAttr Symbol
+textPitchAlignment : Expression CameraExpression { map : Supported, viewport : Supported, auto : Supported } -> LayerAttr Symbol
textPitchAlignment =
Expression.encode >> Layout "text-pitch-alignment"
-{-| Part of the icon placed closest to the anchor. Layout property. Defaults to `positionCenter`. Requires `iconImage`.
+{-| Part of the icon placed closest to the anchor. Layout property. Defaults to `center`. Requires `iconImage`.
+
+ - `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.
+ - `topLeft`: The top left corner of the icon is placed closest to the anchor.
+ - `topRight`: The top right corner of the icon is placed closest to the anchor.
+ - `bottomLeft`: The bottom left corner of the icon is placed closest to the anchor.
+ - `bottomRight`: The bottom right corner of the icon is placed closest to the anchor.
+
-}
-iconAnchor : Expression any Position -> LayerAttr Symbol
+iconAnchor : Expression any { center : Supported, left : Supported, right : Supported, top : Supported, bottom : Supported, topLeft : Supported, topRight : Supported, bottomLeft : Supported, bottomRight : Supported } -> LayerAttr Symbol
iconAnchor =
Expression.encode >> Layout "icon-anchor"
-{-| Part of the text placed closest to the anchor. Layout property. Defaults to `positionCenter`. Requires `textField`.
+{-| Part of the text placed closest to the anchor. Layout property. Defaults to `center`. Requires `textField`.
+
+ - `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.
+ - `topLeft`: The top left corner of the text is placed closest to the anchor.
+ - `topRight`: The top right corner of the text is placed closest to the anchor.
+ - `bottomLeft`: The bottom left corner of the text is placed closest to the anchor.
+ - `bottomRight`: The bottom right corner of the text is placed closest to the anchor.
+
-}
-textAnchor : Expression any Position -> LayerAttr Symbol
+textAnchor : Expression any { center : Supported, left : Supported, right : Supported, top : Supported, bottom : Supported, topLeft : Supported, topRight : Supported, bottomLeft : Supported, bottomRight : Supported } -> LayerAttr Symbol
textAnchor =
Expression.encode >> Layout "text-anchor"
@@ -1169,9 +1096,15 @@ textRotate =
Expression.encode >> Layout "text-rotate"
-{-| Scales the icon to fit around the associated text. Layout property. Defaults to `textFitNone`. Requires `iconImage`. Requires `textField`.
+{-| Scales the icon to fit around the associated text. Layout property. Defaults to `none`. Requires `iconImage`. Requires `textField`.
+
+ - `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.
+
-}
-iconTextFit : Expression CameraExpression TextFit -> LayerAttr Symbol
+iconTextFit : Expression CameraExpression { none : Supported, width : Supported, height : Supported, both : Supported } -> LayerAttr Symbol
iconTextFit =
Expression.encode >> Layout "icon-text-fit"
@@ -1188,7 +1121,7 @@ iconSize =
{-| 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 `textFitBoth`, or `textFitWidth`, or `textFitHeight`.
+Units in pixels. Defaults to `0,0,0,0`. Requires `iconImage`. Requires `textField`. Requires `iconTextFit` to be `both`, or `width`, or `height`.
-}
iconTextFitPadding : Expression CameraExpression (Array Float) -> LayerAttr Symbol
iconTextFitPadding =
@@ -1217,16 +1150,33 @@ textPadding =
Expression.encode >> Layout "text-padding"
-{-| Specifies how to capitalize text, similar to the CSS `textTransform` property. Layout property. Defaults to `textTransformNone`. Requires `textField`.
+{-| Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key wehn they overlap. Features with a lower sort key will have priority over other features when doing placement. Layout property.
-}
-textTransform : Expression any TextTransform -> LayerAttr Symbol
+symbolSortKey : Expression CameraExpression Float -> LayerAttr Symbol
+symbolSortKey =
+ Expression.encode >> Layout "symbol-sort-key"
+
+
+{-| Specifies how to capitalize text, similar to the CSS `textTransform` property. Layout property. Defaults to `none`. Requires `textField`.
+
+ - `none`: The text is not altered.
+ - `uppercase`: Forces all letters to be displayed in uppercase.
+ - `lowercase`: Forces all letters to be displayed in lowercase.
+
+-}
+textTransform : Expression any { none : Supported, uppercase : Supported, lowercase : Supported } -> LayerAttr Symbol
textTransform =
Expression.encode >> Layout "text-transform"
-{-| Text justification options. Layout property. Defaults to `textJustifyCenter`. Requires `textField`.
+{-| Text justification options. Layout property. Defaults to `center`. Requires `textField`.
+
+ - `left`: The text is aligned to the left.
+ - `center`: The text is centered.
+ - `right`: The text is aligned to the right.
+
-}
-textJustify : Expression any TextJustify -> LayerAttr Symbol
+textJustify : Expression any { left : Supported, center : Supported, right : Supported } -> LayerAttr Symbol
textJustify =
Expression.encode >> Layout "text-justify"
@@ -1317,7 +1267,7 @@ textOpacity =
Expression.encode >> Paint "text-opacity"
-{-| Value to use for a text label. Layout property. Defaults to ``.
+{-| Value to use for a text label. Layout property. Defaults to `""`.
-}
textField : Expression any FormattedText -> LayerAttr Symbol
textField =
@@ -1397,9 +1347,13 @@ rasterOpacity =
Expression.encode >> Paint "raster-opacity"
-{-| The resampling/interpolation method to use for overscaling, also known as texture magnification filter Paint property. Defaults to `rasterResamplingLinear`.
+{-| The resampling/interpolation method to use for overscaling, also known as texture magnification filter Paint property. Defaults to `linear`.
+
+ - `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
+
-}
-rasterResampling : Expression CameraExpression RasterResampling -> LayerAttr Raster
+rasterResampling : Expression CameraExpression { linear : Supported, nearest : Supported } -> LayerAttr Raster
rasterResampling =
Expression.encode >> Paint "raster-resampling"
@@ -1408,13 +1362,13 @@ rasterResampling =
-- Hillshade
-{-| Direction of light source when map is rotated. Paint property. Defaults to `anchorViewport`.
+{-| Direction of light source when map is rotated. Paint property. Defaults to `viewport`.
- - `anchorMap`: The hillshade illumination is relative to the north direction.
- - `anchorViewport`: The hillshade illumination is relative to the top of the viewport.
+ - `map`: The hillshade illumination is relative to the north direction.
+ - `viewport`: The hillshade illumination is relative to the top of the viewport.
-}
-hillshadeIlluminationAnchor : Expression CameraExpression (Anchor Never) -> LayerAttr Hillshade
+hillshadeIlluminationAnchor : Expression CameraExpression { map : Supported, viewport : Supported } -> LayerAttr Hillshade
hillshadeIlluminationAnchor =
Expression.encode >> Paint "hillshade-illumination-anchor"
@@ -1429,7 +1383,7 @@ hillshadeExaggeration =
Expression.encode >> Paint "hillshade-exaggeration"
-{-| The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshadeIlluminationAnchor` is set to `anchorViewport` and due north if `hillshadeIlluminationAnchor` is set to `anchorMap`. Paint property.
+{-| 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`.