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
falseInherited from
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
fillOpacity?
optional fillOpacity?: number;Fill opacity, between 0 and 1. Values outside this range are clamped.
Default Value
0.14floorId?
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
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
renderOrder?
optional renderOrder?: CircleRenderOrder;Where the shape renders relative to other map layers.
See
ShapeRenderOrder for the available placements.
Default Value
"aboveBasemap"Inherited from
strokeColor?
optional strokeColor?: string;Outline color in any valid CSS color format.
Default Value
strokeOpacity?
optional strokeOpacity?: number;Outline opacity, between 0 and 1. Values outside this range are clamped.
Default Value
0.65strokeWidth?
optional strokeWidth?: number;Outline width in pixels. 0 draws no outline.
Default Value
2