Skip to main content

layer (layers)

a stylelayersProperties lists all available layers in this style. The type of layer is given bytypeAttribute specified, must bebackgroundcirclelinefillsymbolrasterfill-extrusionheatmaphillshadeone of them.

Apart frombackgroundExcept for layers of type , each layer must reference a source. Layers get data from a data source, optionally filter features, and then define styles for those features.

Below in the style filelayersExample:

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

Layer properties

id

Required attribute.string

The unique name of the layer.

type

Required attribute.enum"background""circle""line""fill""symbol""raster""fill-extrusion""heatmap""hillshade"one of them.

"background": Map background layer

"circle":point layer

"line": line layer

"fill": polygon layer

"symbol": symbol layer

"raster": raster layer

"fill-extrusion": 3D extrusion layer

"heatmap": Heat map layer

"hillshade": Hillshade layer

filter

Optional attribute.expression

An expression that specifies the source attribute condition. Show only features that match the filter criteria. filterLevel expressions in are evaluated only at the integer level.filterExpression not supported["feature-state",…]。symbolic levelfilterExpressions only support["pitch"]and["distance-from-center"]expression.

layout

Optional attribute.layout

Layout properties of the layer.

maxzoom

Optional attribute.number。Value range:0~24。

The maximum level of the layer. At map level equal to or greater thanmaxzoom, the layer will be hidden.

minzoom

Optional attribute.number。Value range:0~24。

The smallest level of this layer. At map level less thanminzoom, the layer will be hidden.

paint

Optional attribute.Paint

Default drawing properties for this layer.

source

Optional attribute.string

of the data source to use for this layerID。 Apart frombackgroundExcept for the type, this property is required for all other layers.

source-layer

Optional attribute.string

Only when the data source is a vector tile map, it needs to be defined as the layer name.

Layer subproperties

Layers have two sub-properties: layout and drawing properties.

  • Layout properties layeredlayoutproperty. They are applied early in the rendering process and define how data for that layer is passed toGPU。 Changes to layout properties require an asynchronous "layout" step.
  • Paint properties layeredpaintproperty. Applied later in the rendering process, changes to draw properties are simple and synchronous.

background layer (background)

backgroundStyle layers cover the entire map. Use a background style layer to configure a color or pattern to appear underneath all other map content. If the background layer is transparent or omitted from the style, any portion of the map view that does not display other style layers is transparent.

background-color

Paintproperty. Optional attributes,colortype, default value"#000000",andbackground-patternProperty conflict. supportinterpolateexpression. Indicates the color of the drawn background.Transitionable。

background-opacity

Paintproperty. Optional attributes,numberType, value range:0~1,default value1。supportinterpolateAn expression that represents the opacity of the drawn background.Transitionable。

background-pattern

Paintproperty. Optional attributes,resolvedImagetype. Represents the value used to draw the image backgroundsprite The name of the image in . For seamless patterns, the image width and height must be2exponential times(2,4,8,… , 512)。Note that zoom-related expressions will only be evaluated at integer zoom levels.

visibility

Layoutproperty. Optional attributes,enumtype,"visible", "none"One of the default values"visible"。Indicates whether to display the layer,"visible": Layer display,"none": The layer is hidden.

Point layer (circle)

The circle style layer renders one or more filled circles on the map. You can use circle layers to configure the visual appearance of point or point collection features in vector tiles. The radius of the circle rendered by the circle layer is measured in screen units.

circle-blur

Paintproperty. Optional attributes,number。default value:0。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable

Make the circle blurry. The value is1When blurring a circle, only the center point is fully opaque.

circle-color

Paintproperty. Optional attributes,color。default value:"#000000"。supportfeature-stateandinterpolateexpression.Transitionable

Set the fill color of the circle.

circle-opacity

Paintproperty. Optional attributes,number。Value range:0~1,default value:1。supportfeature-stateandinterpolateexpression.Transitionable

Sets the opacity of the circle when drawn.

circle-pitch-alignment

Paintproperty. Optional attributes,enum"map", "viewport"one of them. default value:"viewport"

Used to set the direction of the circle when the map is tilted.

"map": The circle is aligned with the plane of the map.

"viewport": The circle is aligned with the plane of the view.

circle-pitch-scale

Paintproperty. Optional attributes,enum"map", "viewport"one of them. default value:"map"

Controls how the circle scales when the map is tilted.

"map": Circles are scaled based on their apparent distance from the camera.

"viewport": Circles are not scaled.

circle-radius

Paintproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:5。supportfeature-stateandinterpolateexpression.Transitionable

Set the circle radius.

circle-sort-key

Layoutproperty. Optional attributes,number

Sorts the properties in ascending order based on this value. Features with higher sort keys will appear above features with lower sort keys.

circle-stroke-color

Paintproperty. Optional attributes,color。default value"#000000"。supportfeature-stateandinterpolateexpression.Transitionable

Set the stroke color of the circle.

circle-stroke-opacity

Paintproperty. Optional attributes,number。Value range:0~1,default value:1。supportfeature-stateandinterpolateexpression.Transitionable

Sets the opacity of the circle stroke.

circle-stroke-width

Paintproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:0。supportfeature-stateandinterpolateexpression.Transitionable

Sets the width of the circle stroke. The stroke is placed oncircle-radiusoutside.

circle-translate

Paintproperty. Optional attributes,array。Units are pixels. default value:[0,0]。supportinterpolateexpression.Transitionable.

Set the geometry offset. The value is[x, y],The negative numbers represent left and top respectively.

circle-translate-anchor

Paintproperty. Optional attributes,enum"map", "viewport"one of them. default value:"map"。Need to enablecircle-translate

controlcircle-translateframe of reference.

"map": The circle is translated relative to the map.

"viewport": The circle is translated relative to the view.

visibility

Layoutproperty. Optional attributes,enum"visible", "none"one of them. default value"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.

Line layer (line)

The line layer style presents one or more polylines on the map and can be configured using the line layer.polylineormultipolyline The visual appearance of the feature.

line-blue

Paintproperty. Optional attributes,numberType, value range:≥0,Units are pixels, default value0。supportfeature-stateandinterpolateexpression._Transitionable。_Indicates that blur is applied to lines.

line-cap

Layoutproperty. Optional attributes,enumtype. yes"butt", "round", "square"One of the default values"butt""butt": A hat with square ends that is drawn to the exact endpoint of the line. "round": Fillet cap A cap with a rounded end drawn beyond the endpoint of a line with a radius of one-half the width of the line and centered on the endpoint of the line. "square": A cap with square ends drawn at a distance of half the width of the line beyond its endpoint.

line-color

Paintproperty. Optional attributes,colortype, default value"#000000",andline-patternconflict. supportfeature-stateandinterpolateexpression._Transitionable。_Indicates the color that will be used to draw the line.

line-dasharray

Paintproperty. Optional attributes,arrayType, value range:≥0,The unit is line width, andline-patternconflict.Transitionable。 Specifies the length of alternating dashes and gaps that form the dashed pattern. The length is later scaled by line width, to convert dash length to pixels, multiply its length by the width of the current line. Note that specifiedlineMetrics: trueofGeoJSONThe source does not render dashed lines at the expected scale. Also note that zoom-related expressions will only be evaluated at integer zoom levels.

line-gap-width

Paintproperty. Optional attributes,numberType, value range:≥0,Units are pixels, default value0。supportfeature-stateandinterpolateexpression.Transitionable。 means drawing the wireframe outside the actual path of the line,ValueRepresents the width of the internal gap.

line-gradient

Paintproperty. Optional attributes,colortype, withline-patternconflict. need"geojson"Format data sources that supportinterpolateexpression. Defines the gradient used to color line features. Can only be used to enable"lineMetrics": trueofGeoJSONsource.

line-join

Layoutproperty. Optional attributes,enumtype, yes"bevel", "round", "miter"One of the default values"miter"。Shows road segments when connecting. "bevel": A connection with square ends drawn beyond the endpoint of the line at a distance of half the width of the line. "round": A connection with rounded ends that is drawn beyond and centered on the line endpoint at a radius of one-half the line width. "miter"": There is a sharp connection point that intersects the outside of the path endpoint.

line-miter-limit

Layoutproperty. Optional attributes,numbertype, default value2,Requireline-joinfor"miter"。Supports inserting expressions for automatically converting miter connections to bevel connections.

line-offset

Paintproperty. Optional attributes,numberType in pixels,default value0。supportfeature-stateandinterpolateexpression.Transitionable。 Represents the offset of the line. For linear features, positive values ​​offset the line to the right relative to the direction of the line, and negative values ​​offset it to the left. For polygon features, positive values ​​indicate concavity and negative values ​​indicate convexity.

line-opacity

Paintproperty. Optional attributes,numberType, value range:0~1,default value1。supportfeature-stateandinterpolateexpression._Transitionable。_Indicates the opacity of the line when drawn.

line-pattern

Paintproperty. Optional attributes,resolvedImagetype.Transitionable。 Represents the line used to draw image linesspriteThe name of the image in . For seamless patterns, the image width must be2exponential times(2,4,8,… , 512)。 Note that zoom-related expressions will only be evaluated at integer zoom levels.

line-round-limit

Layoutproperty. Optional attributes,numbertype, default value1.05。needline-joinfor"round",supportinterpolateexpression. Indicates the automatic conversion of circular connections with shallow angles into mitered connections.

line-sort-key

Layoutproperty. Optional attributes,numberType by which features are sorted in ascending order. Features with higher sort keys will appear above features with lower sort keys.

line-translate

Paintproperty. Optional attributes,arrayType, unit is pixel, default value[0,0]。supportinterpolateexpression.Transitionable。 Represents the geometric offset, the value is[x, y],The negative numbers represent left and top respectively.

line-translate-anchor

Paintproperty. Optional attributes,enumtype, yes"map", "viewport"One of the default values"map",Need to enableline-translate"map": The line translates relative to the map,"viewport": The line translates relative to the view.

line-width

Paintproperty. Optional attributes,numberType, value range:≥0,Units are pixels, default value1。supportfeature-stateandinterpolateexpression,_Transitionable。_Indicates line width.

visibility

Layoutproperty. Optional attributes,enumtype, yes"visible", "none"One of the default values"visible"。 Indicates whether to display this layer,"visible": Layer display,"none": The layer is hidden.

Polygon layer (fill)

Fill style layers render one or more fills on the map(optional stroke)face elements. You can use fill layers to configure the visual appearance of polygon or multipolygon features.

fill-antialias

Paintproperty. Optional attributes,booleantype, default valuetrue。Indicates whether the padding should be anti-aliased.

fill-color

Paintproperty. Optional attributes,colortype, default value"#000000"。andfill-patternconflict, supportfeature-stateandinterpolateexpression.Transitionable。 Represents the color of the filling part of the layer. This color can be usedalphaThe component is specified asrgba,If enabled, color opacity does not affect1pxThe opacity of the stroke.

fill-opacity

Paintproperty. Optional attribute, included in0~1ofnumber。supportfeature-stateandinterpolateexpression.Transitionable。 Represents the opacity of the entire fill layer, as opposed to the fill color. If a stroke is used, this value will affect the surrounding fill.1pxof strokes.

fill-outline-color

Paintproperty. Optional attributes,colortype, withfill-patternconflict, needfill-antialiasfortrue。supportfeature-stateandinterpolateexpression.Transitionable。 Represents the outline color of the fill, or if not specified, matches the value of the fill color.

fill-pattren

Paintproperty. Optional attributes,resolvedImagetype.Transitionable。 Represents the name of the image used to draw the background of the image in the sprite sheet. For seamless patterns, the image width and height must be2exponential times(2,4,8,… , 512)。Note that zoom-related expressions will only be evaluated at integer zoom levels.

fill-sort-key

Layoutproperty. Optional attributes,numberType by which features are sorted in ascending order, with features with higher sort keys appearing above features with lower sort keys.

fill-translate

Paintproperty. Optional attributes,arrayType, unit is pixels. default value[0,0],supportinterpolateexpression.Transitionable。 Represents the geometric offset, the value is[x, y],The negative numbers represent left and top respectively.

fill-translate-anchor

Paintproperty. Optional attributes,enumtype, yes"map", "viewport"One of the default values"map"。Need to enablefill-translate"map": The fill is converted relative to the map,"viewport": The padding is transformed relative to the view.

visibility

Layoutproperty. Optional attributes,enumtype. yes"visible", "none"One of the default values"visible"。Indicates whether to display the layer,"visible": Layer display,"none": The layer is hidden.

Symbol layer (symbol)

Symbol layers are used to render icons and text labels at points or lines on the map. You can use symbol album layers to configure the visual appearance of feature labels in vector tiles.

icon-allow-overlap

Layoutproperty. Optional attributes,boolean。default valuefalse。 Need to enableicon-image

if fortrue,The icon will be visible even if it collides with other previously drawn symbols.

icon-anchor

Layoutproperty. Optional attributes,enum"center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"one of them. default value"center"。 Need to enableicon-image

Part icon near anchor point.

"center": The center of the icon is closest to the anchor point.

"left": The left side of the icon is closest to the anchor point.

"right": The right side of the icon is closest to the anchor point.

"top": The top of the icon is closest to the anchor point.

"bottom": The bottom of the icon is closest to the anchor point.

"top-left": The upper left corner of the icon is closest to the anchor point.

"top-right": The upper right corner of the icon is closest to the anchor point.

"bottom-left": The lower left corner of the icon is closest to the anchor point.

"bottom-right": The lower right corner of the icon is closest to the anchor point.

icon-color

Paint property. Optional attributes,color。default value:"#000000"。Need to enable icon-image。support feature-state and interpolate expression.Transitionable.

The color of the icon. Can only be used withSDF iconsused together.

icon-halo-blur

Paintproperty. Optional attributes,number。Value range:≥ 0,Units are pixels. default value:0。Need to enable icon-image。support feature-state and interpolate expression.Transitionable

The halo gradually fades outward.

icon-halo-color

Paintproperty. Optional attributes,color。default value:"rgba(0, 0, 0, 0)"。Need to enableicon-image。supportfeature-stateandinterpolateexpression.Transitionable

The color of the icon halo. Icon glow can only be used withSDF iconsused together.

icon-halo-width

Paintproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value 0。Need to enableicon-image。supportfeature-stateandinterpolateexpression.Transitionable

The distance from the halo to the icon outline.

icon-ignore-placement

Layoutproperty. Optional attributes,boolean。default value false。 Need to enable icon-image

if fortrue,Other symbols can be visible even if they collide with the icon.

icon-image

Layoutproperty. Optional attributes,resolvedImage

The name of the image used to draw the image background in sprite sheets.

icon-keep-upright

Layout property. Optional attributes,boolean。default value false。Need to enable icon-imageicon-rotation-alignmentfor"map"symbol-placementfor"line"or"line-center"

if fortrue,Icons may be flipped to prevent them from appearing upside down.

icon-offset

Layout property. Optional attributes,array。default value:[0,0]。Need to enable icon-image。 support interpolate expression.

The offset distance of the icon from its anchor point. Positive values ​​represent right and bottom, negative values ​​represent left and top. Multiply each component byicon-sizevalue to get the final offset in pixels. when withicon-rotatezWhen combined, the offset will be as if the direction of rotation was up.

icon-opacity

Paintproperty. Optional attributes,number。Value range:0~1,default value1。Need to enableicon-image。supportfeature-stateandinterpolateexpression.Transitionable.

Used to set the opacity of the icon when drawing.

icon-optional

Layout property. Optional attributes,boolean。default value:false。 Need to enable icon-imagetext-field

if fortrue,When the icon collides with other symbols but the text does not, the text will not show the corresponding icon.

icon-padding

Layout property. Optional attributes,number。Value range:≥0,Units are pixels. default value:2。Need to enableicon-image。support interpolate expression.

The size of the additional area around the icon bounding box used to detect symbol collisions.

icon-pitch-alignment

Layoutproperty. Optional attributes,enum"map", "viewport", "auto"one of them. default value:"auto"。Need to enable icon-image

Used to set the direction of the icon when the map is tilted.

"map": The icon is aligned with the plane of the map.

"viewport": The icon is aligned with the plane of the view.

"auto": automatic matching icon-rotation-alignment value.

icon-rotate

Layout property. Optional attributes,number。The unit is degrees. default value:0。Need to enable icon-image。supportinterpolate expression.

Used to set the angle of clockwise rotation of the icon.

icon-rotation-alignment

Layoutproperty. Optional attributes,enum"map", "viewport", "auto"one of them. default value:"auto"。Need to enable icon-image

combine symbol-placement ,Determines how the icon is rotated.

"map":when symbol-placement set to point , align the icon east-west. when symbol-placement set to line or line-center , change the icon’s x The axis is aligned with the straight line.

"viewport": generate its x Axis and View x axis-aligned icons regardless of symbol-placement value.

"auto": whensymbol-placementset topoint, this is equivalent toviewport。 whensymbol-placementset to line or line-center , this is equivalent to "map"

icon-size

Layout property. Optional attributes,number。Value range:≥0,Units are the original icon size of the feature. default value:1。Need to enable icon-image 。support interpolate expression.

Scales the original size of the icon according to the provided factor. The new pixel size of the image will be the original pixel size multiplied by the icon size. 1to original size; 3is three times the size of the image.

icon-text-fit

Layoutproperty. Optional attributes,enum"none", "width", "height", "both"one of them. default value"none"。Need to enableicon-imagetext-field

Used to scale the icon to fit the associated text.

"none": Icons are displayed in their native aspect ratio.

"width": icon inxThe axis is scaled to fit the width of the text.

"height": icon inyScale on-axis to fit the height of the text.

"both": icon inxandyOn-axis scaling.

icon-text-fit-padding

Layoutproperty. Optional attributes,array。Units are pixels. default value:[0,0,0,0]。 Need to enableicon-imagetext-field、icon-text-fitfor"both"or"width"or"height"。supportinterpolateexpression.

The size of the additional area added to the dimension is determined by the icon text size, in clockwise order:Up, right, down, left.

icon-translate

Paintproperty. Optional attributes,array。Default value pixels. default value:[0,0]。Need to enableicon-image。supportinterpolateexpression.Transitionable.

Used to set the distance the icon’s anchor point moves from its original position. Positive values ​​represent right and bottom, negative values ​​represent left and top.

icon-translate-anchor

Paintproperty. Optional attributes,enum"map", "viewport"one of them. default value:"map"。Need to enableicon-imageicon-translate

controlicon-translateframe of reference.

"map": The icon is translated relative to the map.

"viewport": The icon is translated relative to the view.

symbol-avoid-edges

Layoutproperty. Optional attributes,boolean。default value:false

if fortrue,Symbols will not cross tile edges to avoid collisions with each other. Recommended for use on a layer that does not have enough fill vector tiles to prevent collisions, or for a point symbol layer that places it after a line symbol layer. When using a client that supports global conflict detection, this property does not need to be enabled to preventtileBorder cut label.

symbol-placement

Layoutproperty. Optional attributes,enum"point", "line", "line-center"one of them. default value:"point"

The label is placed relative to its geometry.

"point": The label is placed where the geometry is.

"line": Labels are placed along the straight lines of the geometry. Can only be used forLineStringandPolygonGeometry.

"line-center": The label is placed in the straight center of the geometry. Can only be used forLineStringandPolygonGeometry. Note that a single feature in a vector tile may contain multiple line geometries.

symbol-sort-key

Layoutproperty. Optional attributes,number

Sorts the properties in ascending order based on this value. Features with lower sort keys are plotted and put first. whenicon-allow-overlaportext-allow-overlapforfalse, features with lower sort keys will have priority when placed. whenicon-allow-overlaportext-allow-overlapset totrue, features with a higher sort key overlap features with a lower sort key.

symbol-spacing

Layoutproperty. Optional attributes,number。Value range:≥1,Units are pixels. default value:250。 Need to enablesymbol-placementfor"line"。supportinterpolateexpression.

Used to set the distance between two symbol anchors.

symbol-z-order

Layoutproperty. Optional attributes,enum"auto", "viewport-y", "source"one of them. default value"auto"

Determines whether overlapping symbols in the same layer are rendered in the order they appear in the data source, or in the order they appear relative to the viewyThe axis position is presented. To control the order and priority of symbols, you can usesymbol-sort-key

"auto": If set, presssymbol-sort-keySort symbols. Otherwise, ificon-allow-overlaportext-allow-overlapset totrueoricon-ignore-placementortext-ignore-placementset tofalse,Then according to the symbol relative to the viewySort them by location.

"viewport-y": ificon-allow-overlaportext-allow-overlapset totrueoricon-ignore-placementortext-ignore-placementset tofalse,Then according to the symbol relative to the viewySort them by location.

"source": If set, presssymbol-sort-keySort symbols. Otherwise, no sorting is applied; Symbols are presented in the same order as the source data.

text-allow-overlap

Layoutproperty. Optional attributes,boolean。default value:false。Need to enabletext-field

if fortrue,The text will be visible even if it conflicts with other previously drawn symbols.

text-anchor

Layoutproperty. Optional attributes,enum"center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"one of them. default value"center"。Need to enabletext-field。Disabletext-variable-anchor

The portion of text placed closest to the anchor point.

"center": The center of the text is closest to the anchor point.

"left": The left side of the text is closest to the anchor point.

"right": The right side of the text is closest to the anchor point.

"top": The top of the text is closest to the anchor point.

"bottom": The bottom of the text is closest to the anchor point.

"top-left": The top left corner of the text is closest to the anchor point.

"top-right": The top right corner of the text is closest to the anchor point.

"bottom-left": The lower left corner of the text is closest to the anchor point.

"bottom-right": The upper and lower right corners of the text are closest to the anchor point.

text-color

Paintproperty. Optional attributes,color。default value:"#000000"。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable.

The color used to draw text.

text-field

Layoutproperty. Optional attributes,formatted。default value:""。

Value to use for text labels. If a plain string is provided, it will be treated as a string with the default/Format string inheriting format options. Formatted text is not supportedSDFimage.

text-font

Layoutproperty. Optional attributes,array。default value:["Open Sans Regular","Arial Unicode MS Regular"]。Need to enabletext-field

The font type used to display text.

text-halo-blur

Paintproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:0。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable

Used to set the distance at which the halo fades outward.

text-halo-color

Paintproperty. Optional attributes,color。default value:"rgba(0, 0, 0, 0)"。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable

Used to set the color of the text halo so that it can be distinguished from the background.

text-halo-width

Paintproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:0。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable

Used to set the distance from the halo to the font outline. Maximum text halo width is font size1/4。

text-ignore-placement

Layoutproperty. Optional attributes,boolean。default valuefalse。Need to enabletext-field

if fortrue,Other symbols can be visible even if they collide with text.

text-justify

Layoutproperty. Optional attributes,enum"auto", "left", "center", "right"one of them. default value:"center"。Need to enabletext-field

Used to set text alignment options.

"auto": Text is aligned to the anchor position.

"left": Text is aligned left.

"center": The text is centered.

"right": Text is aligned to the right.

text-keep-upright

Layoutproperty. Optional attributes,boolean。default value:true。Need to enabletext-fieldtext-rotation-alignmentfor"map"symbol-placementfor"line"or"line-center"

if fortrue,The text can be flipped vertically to prevent it from appearing upside down.

text-letter-spacing

Layoutproperty. Optional attributes,number。The unit isems。default value:0。Need to enabletext-field。supportinterpolateexpression.

Text tracking.

text-line-height

Layoutproperty. Optional attributes,number。The unit isems。default value:1.2。Need to enabletext-field。supportinterpolateexpression.

Used to set the text leading value for multi-line text.

text-max-angle

Layoutproperty. Optional attributes,number。The unit is degrees. default value:45。Need to enabletext-fieldsymbol-placementfor"line"or"line-center"。supportinterpolateexpression.

Used to set the maximum angle change between adjacent characters.

text-max-width

Layoutproperty. Optional attributes,number。Value range:≥0,The unit isems。default value:10。Need to enabletext-fieldsymbol-placementfor"point"。supportinterpolateexpression.

Used to set the maximum line width when text is wrapped.

text-offset

Layoutproperty. Optional attributes,array。The unit isems。default value:[0,0]。Need to enabletext-field。Disabletext-radial-offset。supportinterpolateexpression.

Used to set the offset distance of text from its anchor. Positive values ​​represent right and bottom, negative values ​​represent left and top. If used with text variable anchors, the input value will be treated as an absolute value. alongxAxis andyThe offset of the axis will be automatically applied based on the anchor position.

text-opacity

Paintproperty. Optional attributes,number。Value range:0~1,default value1。Need to enabletext-field。supportfeature-stateandinterpolateexpression.Transitionable

Used to set the opacity of text when drawing.

text-optional

Layoutproperty. Optional attributes,boolean。default valuefalse。Need to enabletext-fieldicon-image

if fortrue,When text collides with other symbols but the icon does not, the icon will not display the corresponding text.

text-padding

Layoutproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:2。Need to enabletext-field。supportinterpolateexpression.

The size of the additional area around the text bounding box used to detect symbol collisions.

text-pitch-alignment

Layoutproperty. Optional attributes,enum"map", "viewport", "auto"one of them. default value:"auto"。Need to enabletext-field

Used to set the direction of text when the map is tilted.

"map": The text is aligned with the plane of the map.

"viewport": The text is aligned with the plane of the view.

"auto": automatic matchingtext-rotation-alignmentvalue.

text-radial-offset

Layoutproperty. Optional attributes,number。The unit isems。default value:0。Need to enabletext-field。supportinterpolateexpression.

Used to set the radial offset of the text in the direction of the symbol anchor point. andtext-variable-anchorUseful in combination, defaults to 2D text offset if present.

text-rotate

Layoutproperty. Optional attributes,number。The unit is degrees. . default value:0。Need to enabletext-field。supportinterpolateexpression.

Used to set the angle of clockwise rotation of text.

text-rotation-alignment

Layoutproperty. Optional attributes,enum"map", "viewport", "auto"one of them. default value: "auto"。Need to enabletext-field

combinesymbol-placement,Determines how the individual symbols that make up the text are rotated.

"map": whensymbol-placementset topoint, align the text east and west. whensymbol-placementset tolineorline-centerwhen, change the text ofxThe axis is aligned with the row.

"viewport": generate itsxAxis and Viewxaxis-aligned sign regardless ofsymbol-placementWhat is the value of .

"auto": whensymbol-placementset topoint, this is equivalent toviewport。 whensymbol-placementset tolineorline-center, this is equivalent tomap

text-size

Layoutproperty. Optional attributes,number。Value range:≥0,Units are pixels. default value:16。Need to enabletext-field。supportinterpolateexpression.

Used to set font size.

text-transform

Layoutproperty. Optional attributes,enum"none", "uppercase", "lowercase"one of them. default value:"none"。Need to enabletext-field

Specifies how to capitalize text, similar toCSS text-transformproperty.

"none": The text remains unchanged.

"uppercase": Forces all letters to appear in uppercase.

"lowercase": Forces all letters to be displayed in lowercase.

text-translate

Paintproperty. Optional attributes,array。Units are pixels. default value[0,0]。Need to enabletext-field。supportinterpolateexpression.Transitionable.

The distance the text anchor point moves from its original position. Positive values ​​represent right and bottom, negative values ​​represent left and top.

text-translate-anchor

Paintproperty. Optional attributes,enum"map", "viewport"one of them. default value"map"。Need to enabletext-fieldtext-translate

controltext-translateframe of reference.

"map": The text is translated based on the map.

"viewport": Text is translated relative to the view.

text-variable-anchor

Layoutproperty. Optional attributes,array"center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"one of them. Need to enabletext-fieldtext-translatefor"point"

To increase the chances of placing high priority labels on the map, you can provide an array of text anchor locations:The renderer will try to place a label at each position, before moving to the next label, in order. usetext-justify: autoChoose alignment based on anchor point location. To apply an offset, usetext-radial-offsetor two-dimensionaltext-offset

"center": The center of the text is closest to the anchor point.

"left": The left side of the text is closest to the anchor point.

"right": The right side of the text is closest to the anchor point.

"top": The top of the text is closest to the anchor point.

"bottom": The bottom of the text is closest to the anchor point.

"top-left": The top left corner of the text is closest to the anchor point.

"top-right": The top right corner of the text is closest to the anchor point.

"bottom-left": The lower left corner of the text is closest to the anchor point.

"bottom-right": The lower right corner of the text is closest to the anchor point.

text-writing-mode

Layoutproperty. Optional attributes,array"horizontal", "vertical"one of them. Need to enabletext-field

Properties allow controlling the direction of the symbol. Note that the property value acts as a hint, so if a symbol’s language does not support the provided orientation, it will be laid out in its natural orientation. For example:English dot notation will be rendered horizontally even if the array value contains a single'vertical'enumeration value. For symbols with dot layout, the order of the elements in the array defines the layout priority of the directed variables. For symbols with a line layout, the default text writing mode is['horizontal', 'vertical']or['vertical', 'horizontal'],The order does not affect the layout.

"horizontal": If the language of the text supports horizontal writing mode, symbols are arranged horizontally.

"vertical": If the text language supports vertical writing mode, the symbols are arranged vertically.

visibility

Layoutproperty. Optional attributes,enum"visible", "none"one of them. default value"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.

raster layer (raster)

Raster style layers render raster tiles on the map. You can use raster layers to configure the color parameters of raster tiles.

raster-brightness-max

Paintproperty. Optional attributes,number。Value range:0~1,default value:1。supportinterpolateexpression.Transitionable

Increase or decrease the brightness of the image. This value is the maximum brightness.

raster-brightness-min

Paintproperty. Optional attributes,number。Value range:0~1,default value:0。supportinterpolateexpression.Transitionable

Increase or decrease the brightness of the image. This value is the minimum brightness.

raster-contrast

Paintproperty. Optional attributes,number。Value range:-1~1,default value:0。supportinterpolateexpression.Transitionable

Increase or decrease the contrast of an image.

raster-fade-duration

Paintproperty. Optional attributes,number。Value range:≥0,The unit is milliseconds. default value:300。supportinterpolateexpression.

Fade out duration when a new tile is loaded.

raster-hue-rotate

Paintproperty. Optional attributes,number。The unit is degrees. default value:0。supportinterpolateexpression.Transitionable

Rotate hues around the color wheel.

raster-opacity

Paintproperty. Optional attributes,number。Value range:0~1,default value:1。supportinterpolateexpression.Transitionable

The opacity with which the image is drawn.

raster-resampling

Paintproperty. Optional attributes,enum"linear", "nearest"one of them. default value:"linear"

Resampling/Interpolation methods are used for super-scaling processing, also known as texture amplification filters.

"linear": (Bi)Linear filtering interpolates pixel values ​​using a weighted average of the four closest original source pixels, creating a smooth but blurry appearance when overscaled.

"nearest": Nearest neighbor filtering interpolates pixel values ​​using the closest original source pixel, creating a sharp but pixelated appearance when overscaled.

raster-saturation

Paintproperty. Optional attributes,number。Value range:-1~1,default value:0。supportinterpolateexpression.Transitionable

Increase or decrease the saturation of the image.

visibility

Layoutproperty. Optional attributes,enum"visible", "none"one of them. default value:"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.

3D extrusion layer (fill-extrusion)

fill-extrusionUsed to render one or more fills on the map(Support stroke)extrusion(3D)polygon. You can use this layer to configurepolygonormultipolygonappearance.

fill-extrusion-base

Paintproperty. Optional, the format isnumber。Value range:≥0,The unit is meters. default value0。Need to enablefill-extrusion-height。supportfeature-stateandinterpolateexpression.

The height value of the layer’s base. Must be less than or equal tofill-extrusion-height

fill-extrusion-color

Paintproperty. Optional, the format iscolor。default value"#000000"。If enabledfill-extrusion-pattern,This property is invalid. supportfeature-stateandinterpolateexpression.

The color of the extruded polygon base. The extruded surface will be shaded differently based on this color and light setting. If this color is specified withalphaformalrgba, alphavalue will be ignored; usefill-extrusion-opacitySet layer transparency.

fill-extrusion-height

Paintproperty. Optional, the format isnumber。Value range:≥0,The unit is meters. default value0。supportfeature-stateandinterpolateexpression.

Stretch the height of this layer.

fill-extrusion-opacity

Paintproperty. Optional, the format isnumber。Value range:0~1,default value1。supportinterpolateexpression.

The transparency of the entire stretched layer. This property applies to the entire layer, not individual layersfeatureon, and does not support data-driven styles

fill-extrusion-pattern

Paintproperty. Optional, the format isresolvedImage

The name of the image used to draw the image on the extruded layer in the sprite sheet. For seamless patterns, the image width and height must be2index(2,4,8,… , 512)。 Note that zoom-related expressions will only be evaluated at integer zoom levels.

fill-extrusion-translate

Paintproperty. Optional, the format isarray。Units are pixels. default value[0,0]。supportinterpolateexpression.

The geometric offset of the layer. Its value is[x, y],where negative numbers represent left and top(on a plane)。

fill-extrusion-translate-anchor

Paintproperty. Optional, the format is an enumeration type. yes"map", "viewport"one of them. default value"map"。Need to enablefill-extrusion-translate

fill-extrusion-translateThe reference anchor point for the attribute.

"map": The extruded layer translates relative to the map.

"viewport": The extruded layer translates relative to the view.

fill-extrusion-vertical-gradient

Paintproperty. Optional, the format isboolean。default valuetrue

Whether to apply a vertical gradient to the sides of the extruded layer. in the case oftrue,The shadows will be slightly darker on the sides.

visibility

Layoutproperty. Optional, the format is an enumeration type. yesenum"visible", "none"one of them. default value"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.

Heat map layer (heatmap)

A heat map style layer renders a series of colors to represent the density of points within an area.

heatmap-color

Paintproperty. Optional, the format iscolor。default value["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"]。supportinterpolateexpression.

Defines the color of each pixel in the heat map based on its density value. should be used["heatmap-density"]expression as input.

heatmap-intensity

Paintproperty. Optional, the format isnumber。Value range:≥0,default value1。supportinterpolateexpression.

Similar toheatmap-weight,But controls the intensity of the global heatmap. Mainly used to adjust heatmaps based on zoom level.

heatmap-opacity

Paintproperty. Optional, the format isnumber。Value range:0~1,default value1。supportinterpolateexpression.

Global transparency when drawing heat layers.

heatmap-radius

Paintproperty. Optional, the format isnumber。Value range:≥1,Units are pixels. default value30。supportfeature-stateandinterpolateexpression.

The radius of influence of the heatmap points in pixels. Increasing this value will make the heatmap smoother but less detailed. on the heat map layerqueryRenderedFeaturesPoints within this radius will be returned.

heatmap-weight

Paintproperty. Optional, the format isnumber。Value range:≥0,default value1。supportfeature-stateandinterpolateexpression.

A measure of how much a single point contributes to a heat map. 10It is equivalent to having at the same position10The weight is1point. Especially useful when combined with aggregations.

visibility

Layoutproperty. Optional, the format is an enumeration. yesenum"visible", "none"one of them. default value"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.

Hillshade layer (hillshade)

Hills shading style layer for client-side rendering of digital elevation models(DEM)data.

hillshade-accent-color

Paintproperty. Optional, the format iscolor。default value"#000000"。supportinterpolateexpression.

Shadow colors used to accentuate rugged terrain such as steep cliffs and canyons.

hillshade-exaggeration

Paintproperty. Optional, the format isnumber。Value range:0~1,default value0.5。supportinterpolateexpression.

The intensity of the shadow.

hillshade-highlight-color

Paintproperty. Optional, the format iscolor。default value"#FFFFFF"。supportinterpolateexpression.

The background color of the area facing away from the light source.

hillshade-illumination-anchor

Paintproperty. Optional, the format is an enumeration, yesenum"map", "viewport"one of them. default value"viewport"

The direction of the light source when the map is rotated.

"map": Hillshade lighting relative to the north direction.

"viewport":Hillshade lighting is relative to the top of the view.

hillshade-illumination-direction

Paintproperty. Optional, the format isnumber。Value range:0~359,default value335。supportinterpolateexpression.

ifhillshade-illumination-anchorset toviewport,The direction of the light source is the top of the view, ifhillshade-illumination-anchorset tomap,The direction of the light source is true north.

hillshade-shadow-color

Paintproperty. Optional, the format iscolor。default value"#000000"。supportinterpolateexpression.

The shadow color of areas facing away from the light source.

visibility

Layoutproperty. Optional, the format is an enumeration, yesenum"visible", "none"one of them. default value"visible"

Whether to display this layer.

"visible": Layer display.

"none": The layer is hidden.