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 · /divisions-geo

loadDivisionsGeofunction

One country's regions as longitude and latitude, loaded on demand (the file for that country only); null for a code with no regions. ./divisions-geo/<code> is the same file as a static import.

Import it

import { loadDivisionsGeo } from "@johnmorrisdotca/chizu/divisions-geo";

Definition

function loadDivisionsGeo(code: string): Promise<ChizuGeoCollection | null>

Parameters

NameTypeDescription
codestring

The country's code, in either case.

Returns

Promise<ChizuGeoCollection | null>

The country's regions, or null when it has none.

Examples

import { loadDivisionsGeo } from "@johnmorrisdotca/chizu/divisions-geo";

const japan = (await loadDivisionsGeo("jp"))!;
const tokyo = japan.features.find((feature) => feature.properties.iso === "JP-13")!;
console.log(japan.features.length, tokyo.properties.code, tokyo.properties.nameJa, await loadDivisionsGeo("xx"));
// 47 13 東京都 null
47 13 東京都 null

What it prints (run when this page was built)

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