Skip to the content

Chizu地図

Draw SVG maps of the world, its 253 countries and the regions of 33 of them, frame them, place numbered callouts and build geography quizzes, with names in English and Japanese today (Spanish, German and Chinese are planned).

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

Contents

Reference · Framing, geometry and quiz tools

ChizuPortPlacedtype

A placed mark: where it is on the canvas, in the copy of the canvas it was drawn in.

Import it

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

Definition

type ChizuPortPlaced = {
    port: ChizuPort;
    x: number;
    y: number;
};

Members

NameTypeDescription
portChizuPort
xnumber
ynumber

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { placePorts, wholeMapBox, type ChizuPortPlaced } from "@johnmorrisdotca/chizu";

const kobe = { id: "kobe", kind: "harbour", name: { en: "Kobe" }, country: "JP", lat: 34.68, lon: 135.2, tier: 1 } as const;
const placed: ChizuPortPlaced[] = placePorts(WORLD, [kobe], wholeMapBox(WORLD), [0]);
console.log(placed[0]?.port.id, placed.length);
// kobe 1
kobe 1

What it prints (run when this page was built)

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