Skip to main content

validateShape

Whether a shape could be finished as it stands, and if not, why.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { validateShape } from "@mapcairn/core";

function validateShape(shape: DrawShape): DrawIssue | null;

Parameters​

  • shape (DrawShape)

Returns​

DrawIssue | null: null when the shape is valid. A line needs two different positions, a polygon three that are not on one line and whose edges do not cross or touch, and a circle a radius above zero and within MAX_CIRCLE_RADIUS_METRES. Lines may cross themselves.

See also​

Source: packages/core/src/draw/shape.ts:108