Alignment 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.
The altitude of the style in meters. The altitude defines the distance in the vertical direction between the ground plane at 0 meters and the geometry/style. If altitude is set to true, the altitude from the feature's geometry coordinates will be used automatically. If a number is set for altitude, the altitude of the feature's geometry is ignored and the value of "altitude" is used instead. The height must be defined in meters. This attribute is valid for styles of type "Rect", "Image", "Text", "Circle", "Line", "Box" or "Sphere".
Sets 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".
Enable 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.
Enable 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.
Enables collision detection and combines all styles of a StyleGroup with the same "CollisionGroup" into a single logical object for collision detection.
The 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".
Sets 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"
;
Extrude a Polygon or MultiPolygon geometry in meters. This attribute is validate for styles of type "Polygon" only.
The 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".
Sets the color to fill the shape. This attribute is valid for Circle, Rect, Text and Polygon.
Controls 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.
Sets 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.
CSS font string for texts. It is only valid for Text.
Define 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.
Height 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".
Specifies 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.
Enable 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.
Offset 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.
Offset 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.
Offset 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.
Offset 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.
Defines 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.
In 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.
The 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.
Minimum distance in pixels between repeated style-groups on line geometries. Applies per tile only.
Rotate the shape of the style to the angle in degrees. This attribute is validate for Rect and Image.
Scales 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.
Sets 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.Sets 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.Specifies the URL of an image. It can be either absolute or relative path. It is only required by "Image".
Sets the stroke color of the shape. This attribute is valid for Circle, Rect, Line, Text and Polygon.
The strokeDasharray attribute controls the pattern of dashes and gaps used to stroke paths.
It's an array of
This 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".
The 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.
Sets 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".
Text is either a string or a function that generates the string that should be displayed. It is valid for Text style only.
"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.
Define 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",
Width 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.
Indicates 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.
Generated using TypeDoc
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 of Circle: {zIndex: 0, type: "Circle", radius: 16, fill: "#FFFF00"} // example of Rect: {zIndex: 0, type: "Rect", fill: "#4C9EEF", stroke: "#0156BB", width: 20, height: 20} // example of Text: {zIndex:1, type: "Text", fill: "#FFFFFF", text: "HERE", font: "normal 12px Arial"} // example of Image: {zIndex: 0, type: "Image", src: "./xyz.png", width: 20, height: 20} // example of Line: {zIndex: 0, type: "Line", opacity: 0.5, stroke: "#BE6B65", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 16} // example of Polygon: {zIndex: 0, type: "Polygon", opacity: 0.5, stroke: "#BE6B65", fill: "#FFFFFF"} // example of Box: {zIndex: 0, type: "Box", width: 16, height: 16, depth: 16, stroke: "#BE6B65", fill: "#FFFFFF"} // example of Sphere: {zIndex: 0, type: "Sphere", radius: 16, fill: "#FFFFFF"}