ChizuLocalDrawOptionstype
What a drawing of a local map shows beyond the shapes. Every part is optional.
Import it
import type { ChizuLocalDrawOptions } from "@johnmorrisdotca/chizu/draw";
Definition
type ChizuLocalDrawOptions = {
box?: MapBox;
language?: ChizuLanguage;
label?: string;
style?: boolean;
styles?: Readonly<Record<string, ChizuLocalStyle>>;
tones?: Readonly<Record<string, string>>;
labels?: boolean | readonly string[];
callouts?: readonly string[] | Omit<CalloutRequest, "box">;
interactive?: boolean;
markers?: boolean;
scaleBar?: boolean;
credits?: readonly string[];
naturalEarth?: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
box (optional) | MapBox | undefined | The window to show, in the canvas's units (as |
language (optional) | ChizuLanguage | undefined | |
label (optional) | string | undefined | What a screen reader hears of the drawing, instead of "Map of {name}". |
style (optional) | boolean | undefined | Put |
styles (optional) | Readonly<Record<string, ChizuLocalStyle>> | undefined | The look of a shape, by its |
tones (optional) | Readonly<Record<string, string>> | undefined | A tone for each shape, by id, as |
labels (optional) | boolean | readonly string[] | undefined | Print the names: all that fit, or just these ids. |
callouts (optional) | readonly string[] | Omit<CalloutRequest, "box"> | undefined | Numbered circles with leader lines to these ids (shapes, pictures), placed by |
interactive (optional) | boolean | undefined | Give every shape and picture its |
markers (optional) | boolean | undefined | Draw the pictures. Default true. |
scaleBar (optional) | boolean | undefined | A scale bar in metres. Default true. |
credits (optional) | readonly string[] | undefined | More credit lines, after the map's own. |
naturalEarth (optional) | boolean | undefined | Begin the credit with chizu's own: the outlines are Natural Earth's (public domain). Say so when the drawing goes beside or over one of its maps. Default false. |
Examples
import { drawLocal, type ChizuLocalDrawOptions } from "@johnmorrisdotca/chizu/draw";
import { localMap } from "@johnmorrisdotca/chizu";
const options: ChizuLocalDrawOptions = { style: true, scaleBar: true, credits: ["Shapes made up for this example"] };
console.log(drawLocal(localMap({ centre: [139.7, 35.7], widthMetres: 500 }), options).includes("Shapes made up"));
// truetrueWhat it prints (run when this page was built)