OptionalalignmentAlignment for styles of type "Circle", "Rect", "Image" and "Text". Possible values are: "map" and "viewport". "map" aligns to the plane of the map and "viewport" aligns to the plane of the viewport/screen. Default alignment for Text based on point geometries is "viewport" while "map" is the default for line geometries.
Optional ExperimentalaltitudeAltitude of the Feature center in meters.
Describes the vertical distance from the global ground plane (0m) to the Feature.
Supported values:
Notes:
OptionalanchorSets the anchor point for styles of type "Circle", "Rect", "Image" and "Text" used with Line or Polygon geometry.
Possible values for Line geometry are "Coordinate" and "Line".
Possible values for Polygon geometry are "Center" and "Centroid".
OptionalcheckEnable or disable the space check for point styles on line geometries. Only applies to "Circle", "Rect", "Image" and "Text" styles with anchor set to "Line". If check checkLineSpace is enabled the respective style is only displayed if there is enough space on the line, otherwise it is not displayed.
OptionalcollideEnable or disable collision detection. Works for styles of type "Circle", "Rect", "Image" and "Text". If the collision detection is enabled for multiple Styles within the same StyleGroup, the respective Styles are handled as a single Object ("CollisionGroup") where the combined bounding-box is determined automatically.
OptionalcollisionEnables collision detection and combines all styles of a StyleGroup with the same "CollisionGroup" into a single logical object for collision detection.
OptionaldepthThe depth of the style in pixels. The depth defines the length of the edges of a "Box" parallel to the Z axis. The unit of depth is defined in pixels and only required by styles of type "Box".
OptionalemissiveSets the emissive color of the feature, giving it a glow effect.
This property is only applicable for Styles of type "Polygon", "Box", "Sphere" or "Model";
Color for a detailed list of possible supported formats.
OptionalextrudeExtrude a Polygon or MultiPolygon geometry in meters. This attribute is validate for styles of type "Polygon" only.
OptionalextrudeThe base of the Extrude in meters. The extrudeBase is defined from the ground to the bottom of the extruded Polygon in meters. The extrudeBase must be less or equal then extrude. This attribute applies only to styles of type "Polygon".
OptionalfillSets the color to fill the shape. This attribute is valid for Circle, Rect, Text and Polygon.
Color for a detailed list of possible supported formats.
OptionalfillControls the intensity of the fill color under directional lighting.
fillIntensity determines how much the feature's fill color is affected by the directional lighting in the scene.
A higher value increases the intensity of the fill color, making it more vibrant under strong lighting,
while a lower value reduces the effect, resulting in a more muted color.
This property is only applicable for Styles of type "Polygon", "Box" or "Sphere";
The value should range from 0 to 1, where 0 means no color intensity and 1 represents full intensity.
OptionalfilterSets the condition(s) to determine whether a feature should be rendered with the respective style.
The filter expression is evaluated to determine if the respective style should be applied to a feature.
It must resolve to a boolean value where true means the style applies and false means it does not.
This property is only used when LayerStyle.assign is not defined; otherwise, filter is ignored.
// Render features where the "type" property is equal to "park"
filter: ['==', ['get', 'type'], 'park']
// Render features where the "population" property is greater than 1000
filter: ['>', ['get', 'population'], 1000]
// Render features where the "type" property is "park" and "population" is less than 500
filter: ['all', ['==', ['get', 'type'], 'park'], ['<', ['get', 'population'], 500]]
OptionalfontCSS font string for texts. It is only valid for Text.
OptionalfromDefine the starting position of a segment of the entire line in %. A Segment allows to display and style parts of the entire line individually. The value must be between 0 and 1. The Default is 0.
OptionalheightHeight of the style in pixels. It is only required by Rect and Image. The maximum supported height for "Image" is 64 pixels. The unit of height is defined in pixels. For styles of type "Rect" the height can also be defined in meters by using a string: "${width}m".
OptionallightSpecifies the name of the light group to use for illuminating specific features on a layer. This property must reference a key corresponding to a light group defined in LayerStyle.lights. A light group consists of lighting sources such as ambient or directional lights that affect the appearance of features.
If light is not defined, the default light group "defaultLight" will be used to illuminate the layer's features.
LayerStyle.lights for defining and referencing available light groups.
OptionallineEnable oder Disable line wrapping for styles of type "Text". The line wrapping for text on (Multi)Linestring geometry with anchor set to "Line" is disabled by default, otherwise it's 14 characters.
OptionaloffsetOffset a line to the left or right side in pixel or meter. A positive values offsets to the right side, a negative value offsets to the left. The side is defined relative to the direction of the line geometry. The default unit is pixels. To define the offset in meters a string that contains the offset value and ends with "m" must be used. Applies to Line style only.
OptionaloffsetOffset the shape in pixels on x-axis. It is valid for Circle, Rect, Text, Image, Box and Sphere. A positive value offsets to the right, a negative value to the left. The default unit is pixels.
OptionaloffsetOffset the shape in pixels on y-axis. It is valid for Circle, Rect, Text, Image, Box and Sphere. A positive value offsetY offsets downwards, a negative value upwards. The default unit is pixels.
OptionaloffsetOffset the shape in pixels on z-axis. It is valid for Circle, Rect, Text, Image, Box and Sphere. A positive value offsets up, a negative value down. The default unit is pixels.
OptionalopacityDefines the opacity of the style. The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). It is valid for all style types.
OptionalpriorityIn case of label collision, Text with a higher priority (lower value) will be drawn before lower priorities (higher value). If the collision detection is enabled for multiple Styles within the same StyleGroup, the highest priority (lowest value) is used.
OptionalradiusThe Radius of the Circle and Sphere. It is required by styles of type "Circle" and "Sphere". The default unit is pixels. To define the radius of a Circle in meters a string can be used: "${width}m". The radius of "Sphere" must be defined in pixels.
OptionalrepeatMinimum distance in pixels between repeated style-groups on line geometries. Applies per tile only.
OptionalrotationRotate the shape of the style to the angle in degrees. This attribute is validate for Rect and Image.
Optional ExperimentalscaleScales the size of a style based on the feature's altitude. If it's enabled (true), features closer to the camera will be drawn larger than those farther away. When off (false), the size of the style is always the same size, regardless of its actual altitude, as if it were placed on the ground (altitude 0). This attribute applies to styles of type "Rect", "Image", "Text", "Circle", "Line", "Box", or "Sphere" whose size (width, radius, strokeWidth) that are using "map" alignment only. If the size attribute is defined in meters, scaleByAltitude is enabled by default, for pixels it is disabled.
OptionalshininessSets the shininess of the feature, determining how glossy its surface appears. A higher value makes the polygon surface more reflective.
This property is only applicable for Styles of type "Polygon", "Box", "Sphere" or "Model";
shininess value controls the size and intensity of the specular highlight, which is colored by the specular property.shininess property enhances the effect of the specular color. If specular is not set, shininess has no visible effect.shininess value typically ranges from 0 to 128.OptionalspecularSets the specular color of the feature, affecting how it reflects light.
This property is only applicable for Styles of type "Polygon", "Box", "Sphere" or "Model";
specular property determines the color of the light reflection, while the shininess value controls the intensity and size of the reflection.specular is set and shininess is not explicitly set, the default shininess value will be used to control the reflection's appearance.Color for a detailed list of possible supported formats.
OptionalsrcSpecifies the URL of an image. It can be either absolute or relative path. It is only required by "Image".
OptionalstrokeSets the stroke color of the shape. This attribute is valid for Circle, Rect, Line, Text and Polygon.
Color for a detailed list of possible supported formats.
OptionalstrokeThe strokeDasharray attribute controls the pattern of dashes and gaps used to stroke paths.
It's an array of
OptionalstrokeThis controls the shape of the ends of lines. there are three possible values for strokeLinecap:
If "strokeLinecap" is used in combination with "altitude", only "butt" is supported for "strokeLinecap".
OptionalstrokeThe joint where the two segments in a line meet is controlled by the strokeLinejoin attribute, There are three possible values for this attribute:
If "strokeLinejoin" is used in combination with "altitude", the use of "round" is not supported.
OptionalstrokeSets the width of the stroke. This attribute is valid for Circle, Rect, Line, Text and Polygon. The unit of strokeWidth is defined in pixels. For Polygons that are using extrude, the maximum possible strokeWidth is 1.0 pixel. For Styles of type Line the strokeWidth can also be defined in meters by using a string: "${width}m".
OptionaltextText is either a string or a function that generates the string that should be displayed. It is valid for Text style only.
Optionaltext"textRef" Reference to an attribute of an feature that's value should be displayed as text. If both "text" and "textRef" are set, "text" prevails. It is only required by Text.
OptionaltoDefine the end position of a segment of the entire line in %. A Segment allows to display and style parts of the entire line individually. The value must be between 0 and 1. The Default is 1.
Indicates type of the shape to render. Its value must be one of the following: "Circle", "Rect", "Text", "Image", "Line", "Polygon", "VerticalLine", "Box" or "Sphere",
OptionalwidthWidth of the style in pixels. It is only required by Rect, Image and Box. The maximum supported width for "Image" is 64 pixels. The unit of width is defined in pixels. For styles of type "Rect" the width can also be defined in meters by using a string: "${width}m".
Indicates the drawing order within a layer. Styles with larger zIndex value are rendered above those with smaller values. The zIndex is defined relative to the "zLayer" property. If "zLayer" is defined all zIndex values are relative to the "zLayer" value.
OptionalzIndicates drawing order across multiple layers. Styles using zLayer with a high value are rendered on top of zLayers with a low value. If no zLayer is defined, it will fall back to the LayerStyle.zLayer or depend on the display layer order. If no zLayer is defined, it will fall back to the LayerStyle.zLayer or depend on the display layer order. The first (lowest) layer has a zLayer value of 1.
The Style object defines how certain features should be rendered. A style object must always contain the attributes "zIndex" and "type" as well as the mandatory attributes of the corresponding "type":
Example