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

loadCountryfunction

One country alone, drawn from Natural Earth's 1:50m countries (the small ones from 1:10m); null for a code with no map.

Import it

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

Definition

function loadCountry(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 country map, or null when no built-in map exists for its code.

Examples

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

const japan = (await loadCountry("jp"))!;
console.log(japan.id, japan.kind, japan.regions.length, await loadCountry("xx"));
// country-jp country 1 null
country-jp country 1 null

What it prints (run when this page was built)

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