A ShapeStyle describes how a Shape should be styled. A ShapeStyle defines among others the stroke and fill styling of a shape.

Example:

var shapeStyle = {
stroke: {
color: "rgb(100, 170, 220)",
width: 2.5
}
};

Hierarchy

  • ShapeStyle

Properties

drapeTarget?: DrapeTarget

The drape target of this shape.

Indicates if this shape should be draped on terrain, 3D Tiles meshes, not at all.

If draped or drapeTarget is not specified and the shape has zero Z, it will be draped on terrain. If it has non-zero Z, it will not be draped.

If you explicitly drape a 3D shape, its 2D "shadow" is painted on the terrain.

This setting is only relevant for 3D geospatial maps. For 2D maps and 3D cartesian maps, this setting is ignored and DrapeTarget.NOT_DRAPED is used.

draped?: boolean

Whether this shape should be draped on terrain, or not be draped at all.

This property only exists for backwards compatibility. You should use drapeTarget instead. false is equivalent to DrapeTarget.NOT_DRAPED and true is equivalent to DrapeTarget.TERRAIN.

If draped or drapeTarget is not specified and the shape has zero Z, it will be draped on terrain. If it has non-zero Z, it will not be draped.

If you explicitly drape a 3D shape, its 2D "shadow" is painted on the terrain.

This setting is only relevant for 3D geospatial maps. For 2D maps and 3D cartesian maps, this setting is ignored and DrapeTarget.NOT_DRAPED is used.

fill?: FillStyle

An object containing the fill style properties. This property used to be a string specifying the fill color as a CSS color string. The string option is still supported but deprecated.

innerBorder?: BorderStyle

The style object that describes how the inner border of a closed shape is rendered.

lineType?: LineType

The lineType determines how lines between subsequent points will be interpreted. Possible values are SHORTEST_DISTANCE and CONSTANT_BEARING. In case the data is defined in a reference with a GEODETIC coordinate system, lines will be geodetically interpreted (on an ellipsoid). Shapes will be rendered in a cartesian manner in all other cases.

This property is optional; its defaults value is LineType.SHORTEST_DISTANCE

occlusionMode?: OcclusionMode

When this shape should be painted in 3D in relation to other 3D data.

Notes:

  • Mode OcclusionMode.VISIBLE_ONLY shows only the part of the shape that is not obscured by other 3D data. This is the default.
  • Mode OcclusionMode.ALWAYS_VISIBLE shows the entire shape even if behind by other 3D data. The shape will appear in front of other objects.
  • Mode OcclusionMode.OCCLUDED_ONLY shows only the part of the shape that is behind other 3D data. You typically use this to display obscured shapes in combination with another style that uses "VISIBLE" mode.
  • This parameter is only relevant in 3D.
  • This parameter is only applied on non-draped shapes.
  • When using extruded shapes or other non-flat shapes, a combination of "OCCLUDED_ONLY" and "VISIBLE_ONLY" only works with transparent colors.

Default

VISIBLE

Since

2020.0

outerBorder?: BorderStyle

The style object that describes how the outer border of a closed shape is rendered.

The outer border style is limited to 20 pixels.

An object literal containing the stroke style properties. This property used to be a String specifying the stroke color as a CSS color string, while the width was specified using the strokeWidth property. The stroke as a string option, together with the strokeWidth option is still supported but deprecated.
Set this property to null to turn off the stroke. When this property is undefined, a default stroke will be shown. This is to avoid that features on the map would be - unintentionally - invisible.

zOrder?: number

The z-order of this shape. Shapes will be painted from lowest to highest z-order. This property is optional and defaults to 0.