Skip to main content

DrawShape

One drawn shape. A circle keeps its centre as its only vertex and its radius in metres; every other kind is its vertices in order, and a polygon closes itself from the last vertex back to the first.

This is an interface exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { DrawShape } from "@mapcairn/core";

interface DrawShape

Properties​

done​

readonly done: boolean;

False while the shape is still being drawn. At most one shape is unfinished.

id​

readonly id: string;

Stable for the life of the shape, for example shape-3.

kind​

readonly kind: DrawKind;

Whether the shape is a point, line, polygon or circle.

label​

readonly label: string;

A name for lists and announcements, for example "Polygon 2".

radiusMetres​

readonly radiusMetres?: number;

A circle's radius in metres. Absent until the second tap of a circle.

vertices​

readonly vertices: readonly LatLng[];

The shape's positions, in order.

See also​

Source: packages/core/src/draw/types.ts:13