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

overlaysSvgfunction

The overlays as SVG: one group, cz-overlays, the areas first, then the lines, then the marks, each repeated at the whole-width shifts round a world map that reach the window. Points that are not numbers are left out; a latitude past a pole is held to it.

Import it

import { overlaysSvg } from "@johnmorrisdotca/chizu";

Definition

function overlaysSvg(map: ChizuMap, overlays: readonly ChizuOverlay[], box: MapBox): string

Parameters

NameTypeDescription
mapChizuMap

The map they are drawn on.

overlaysreadonly ChizuOverlay[]

The overlays, in the order they are drawn within their kind.

boxMapBox

The window shown: the copies round a world map reach it, and a mark's label is sized to it.

Returns

string

The group, empty when there is nothing to draw.

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { overlaysSvg, wholeMapBox } from "@johnmorrisdotca/chizu";

const svg = overlaysSvg(WORLD, [{ kind: "mark", at: [0, 0], label: "0, 0" }], wholeMapBox(WORLD));
console.log(svg.includes('class="cz-overlay-mark"'));
// true
true

What it prints (run when this page was built)

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