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

mapOutlinesfunction

The outlines of every region of a map, in the map's order, with a point on each one's land.

Import it

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

Definition

function mapOutlines(map: Pick<ChizuMap, "regions" | "insets">): MapOutline[]

Parameters

NameTypeDescription
mapPick<ChizuMap, "regions" | "insets">

The native map or map fields required by this signature; coordinates and region codes belong to its canvas.

Returns

MapOutline[]

The outlines of every region of a map, in the map's order, with a point on each one's land.

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { mapOutlines } from "@johnmorrisdotca/chizu";

const outlines = mapOutlines(WORLD);
console.log(outlines.length === WORLD.regions.length, mapOutlines(WORLD) === outlines);
// true true
true true

What it prints (run when this page was built)

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