Skip to main content

ScaleBar

A scale bar ready to draw and to read aloud.

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

Signature​

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

interface ScaleBar

Properties​

accessibleLabel​

readonly accessibleLabel: Message<"scale.label">;

Spoken text, for example "Scale: 200 metres", as a message to format.

label​

readonly label: string;

Short visible text, for example "200 m".

unit​

readonly unit: DistanceUnit;

The unit of value.

value​

readonly value: number;

The distance the bar stands for, in unit.

widthPx​

readonly widthPx: number;

Bar width in CSS pixels. Never more than maxWidthPx.

See also​

Source: packages/core/src/scale/scale.ts:33