ChizuLocalDrawOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a drawing of a local map shows beyond the shapes. Every part is optional.
インポート
import type { ChizuLocalDrawOptions } from "@johnmorrisdotca/chizu/draw";
定義
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;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
box (省略可) | MapBox | undefined | The window to show, in the canvas's units (as |
language (省略可) | ChizuLanguage | undefined | |
label (省略可) | string | undefined | What a screen reader hears of the drawing, instead of "Map of {name}". |
style (省略可) | boolean | undefined | Put |
styles (省略可) | Readonly<Record<string, ChizuLocalStyle>> | undefined | The look of a shape, by its |
tones (省略可) | Readonly<Record<string, string>> | undefined | A tone for each shape, by id, as |
labels (省略可) | boolean | readonly string[] | undefined | Print the names: all that fit, or just these ids. |
callouts (省略可) | readonly string[] | Omit<CalloutRequest, "box"> | undefined | Numbered circles with leader lines to these ids (shapes, pictures), placed by |
interactive (省略可) | boolean | undefined | Give every shape and picture its |
markers (省略可) | boolean | undefined | Draw the pictures. Default true. |
scaleBar (省略可) | boolean | undefined | A scale bar in metres. Default true. |
credits (省略可) | readonly string[] | undefined | More credit lines, after the map's own. |
naturalEarth (省略可) | 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. |
例
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"));
// truetrue出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。