Reference · Framing, geometry and quiz tools
ChizuLocalMaptype
A map of a small place: a ChizuMap (so every function of the engine takes it) whose canvas is a city or a venue in
a local projection, whose regions are the polygons of the data, and which also holds the lines, points, pictures and
credits that drawLocal draws.
Import it
import type { ChizuLocalMap } from "@johnmorrisdotca/chizu";
Definition
interface ChizuLocalMap extends ChizuMap {
kind: "local";
shapes: ChizuLocalShape[];
markers: ChizuLocalMarker[];
credits: string[];
problems: string[];
}
Members
| Name | Type | Description |
|---|---|---|
kind | "local" | What its regions are: the whole |
shapes | ChizuLocalShape[] | Every shape of the data, in the order given: areas, lines and points. |
markers | ChizuLocalMarker[] | |
credits | string[] | |
problems | string[] | What was left out of the data, and why, one line each. |
id | string |
|
name | string | The map's name in English and Japanese. |
nameJa (optional) | string | undefined | |
regionName | string | What a region is called here, singular and plural, in English: |
regionNamePlural | string | |
viewBox | string | The canvas: |
width | number | |
height | number | |
wraps | boolean | Whether its east edge is its west edge: a map of the earth is a cylinder cut open, and pans round without stopping. |
projection | ChizuProjection | |
insets | ChizuInset[] | The regions drawn in boxes of their own. |
source | string | Where the outlines come from, in a line. |
regions | ChizuRegion[] |
Examples
import { localMap, type ChizuLocalMap } from "@johnmorrisdotca/chizu";
const map: ChizuLocalMap = localMap({ centre: [139.7006, 35.7004], widthMetres: 500 });
console.log(map.kind, map.viewBox, map.projection.kind === "local" && map.projection.metresPerUnit);
// local 0 0 1000 1000 0.5local 0 0 1000 1000 0.5What it prints (run when this page was built)