Skip to Content
APIShapesInterface: PolygonConfig

Interface: PolygonConfig

Configuration of a filled area — a geofence, a zone, a highlighted region of a floor.

Example

map.addPolygon({ coordinates: [ { lat: -33.4175, lng: -70.6068 }, { lat: -33.4175, lng: -70.6062 }, { lat: -33.418, lng: -70.6062 }, { lat: -33.418, lng: -70.6068 }, ], floorId: "level-1", fillColor: "#2e7d32", })

Extends

Properties

allFloors?

optional allFloors?: boolean;

Show the shape on every floor and outdoors, instead of following the floorId rule.

Default Value

false

Inherited from

ShapeBaseConfig.allFloors


coordinates

coordinates: LatLng[];

The outline of the area, in order. At least three distinct positions; the ring is closed automatically, so repeating the first position at the end is optional.

Throws

Error if there are fewer than three positions or any is out of bounds.


fillColor?

optional fillColor?: string;

Fill color in any valid CSS color format.

Default Value

MAPVX_BRAND_COLOR


fillOpacity?

optional fillOpacity?: number;

Fill opacity, between 0 and 1. Values outside this range are clamped.

Default Value

0.14

floorId?

optional floorId?: string;

Identifier for the floor the shape is drawn on. A shape with a floor is shown only while that floor is displayed; a shape without one is shown while no floor is displayed, and in outdoor contexts. Markers, circles and shapes all answer this through one predicate, so the rule is literally the same for all three.

Inherited from

ShapeBaseConfig.floorId


holes?

optional holes?: LatLng[][];

Areas cut out of the polygon, each described like coordinates.


id?

optional id?: string;

Unique identifier for the shape. If not provided, a hexadecimal key will be generated automatically. Polylines and polygons share one id space.

Inherited from

ShapeBaseConfig.id


renderOrder?

optional renderOrder?: CircleRenderOrder;

Where the shape renders relative to other map layers.

See

ShapeRenderOrder for the available placements.

Default Value

"aboveBasemap"

Inherited from

ShapeBaseConfig.renderOrder


strokeColor?

optional strokeColor?: string;

Outline color in any valid CSS color format.

Default Value

MAPVX_BRAND_COLOR


strokeOpacity?

optional strokeOpacity?: number;

Outline opacity, between 0 and 1. Values outside this range are clamped.

Default Value

0.65

strokeWidth?

optional strokeWidth?: number;

Outline width in pixels. 0 draws no outline.

Default Value

2
Last updated on