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 · Load maps and features

loadDivisionsfunction

The regions of one country, from Natural Earth's 1:10m states and provinces; null for a country that has none.

Import it

import { loadDivisions } from "@johnmorrisdotca/chizu/load";

Definition

function loadDivisions(code: string): Promise<ChizuMap | null>

Parameters

NameTypeDescription
codestring

The native region or country code; null clears a region selection where accepted.

Returns

Promise<ChizuMap | null>

The requested subdivision map, or null when no built-in subdivision map exists for its code.

Examples

import { loadDivisions } from "@johnmorrisdotca/chizu/load";

const japan = (await loadDivisions("jp"))!;
const tokyo = japan.regions.find((region) => region.iso === "JP-13")!;
console.log(japan.regions.length, tokyo.code, tokyo.nameJa, tokyo.reading, tokyo.group);
// 47 13 東京都 とうきょうと Kanto
47 13 東京都 とうきょうと Kanto

What it prints (run when this page was built)

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