Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

Reference · Framing, geometry and quiz tools

ChizuFeatureLayertype

The named features of one map, drawn on that map's canvas: what loadFeatures(mapId) gives, and what drawChizu and mountChizu take as featureLayer.

Import it

import type { ChizuFeatureLayer } from "@johnmorrisdotca/chizu";

Definition

interface ChizuFeatureLayer {
    map: string;
    source: string;
    features: ChizuFeature[];
}

Members

NameTypeDescription
mapstring

The id of the map whose canvas the features are drawn on.

sourcestring

Where the shapes and names come from, in a line.

featuresChizuFeature[]

Examples

import { loadFeatures } from "@johnmorrisdotca/chizu/load";
import type { ChizuFeatureLayer } from "@johnmorrisdotca/chizu";

const layer: ChizuFeatureLayer = (await loadFeatures("world"))!;
console.log(layer.map, layer.features.some((one) => one.name === "Caspian Sea"));
// world true
world true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.