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 · Map, locator and quiz elements

loadElementMapfunction

Load a built-in map by world, country-<ISO> or divisions-<ISO>. Invalid names return null.

Import it

import { loadElementMap } from "@johnmorrisdotca/chizu/element";

Also exported from: @johnmorrisdotca/chizu/element/define

Definition

function loadElementMap(region: string): Promise<MapData | null>

Parameters

NameTypeDescription
regionstring

The built-in map id, such as world or country-jp.

Returns

Promise<MapData | null>

The loaded native map, or null for an unavailable map id.

Examples

import { loadElementMap } from "@johnmorrisdotca/chizu/element";
console.log((await loadElementMap("country-jp"))?.id, await loadElementMap("invalid"));
// country-jp null
country-jp null

What it prints (run when this page was built)

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