Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Overview

Properties

Optional draped

draped: boolean

Whether or not this shape should be draped on top of the terrain.

By default, a shape is draped if it has undefined or zero Z. Otherwise it will not be draped.

You can override the default behaviour by setting this flag true or false. If you explicitly drape a 3D shape, it 2D "shadow" is painted on the terrain.

This setting is only relevant for 3D maps and is ignored for 2D maps.

Optional fill

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.

Optional innerBorder

innerBorder: BorderStyle

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

Optional lineType

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

Optional occlusionMode

occlusionMode: OcclusionMode

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

Notes:

  • Mode VISIBLE_ONLY shows only the part of the shape that is not obscured by other 3D data. This is the default.
  • Mode ALWAYS_VISIBLE shows the entire shape even if behind by other 3D data. The shape will appear in front of other objects.
  • Mode 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

Optional outerBorder

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.

Optional stroke

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.

Optional zOrder

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.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method