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

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

6614.0 kB minified and gzipped, with everything it imports (measured with esbuild)

Loading a map by name, one country at a time: loadCountry("fr") is France alone, loadDivisions("fr") its départements. Each is a dynamic import of a file of its own, so a bundler makes a chunk for each and a page fetches only the ones it draws.

Exports

NameKindWhat it is
COUNTRY_CODESconstantEvery country that has a map of its own, by code, upper or lower case.
DIVISIONS_CODESconstantEvery country that has a map of its own regions (provinces, states, départements), by code.
FEATURE_MAPSconstantThe ids of every map that has named features of its own: the world, and each country alone or by its regions whose canvas holds a sea, a lake, a river, a landform or a peak big enough to see.
loadCountryfunctionOne country alone, drawn from Natural Earth's 1:50m countries (the small ones from 1:10m); null for a code with no map.
loadDivisionsfunctionThe regions of one country, from Natural Earth's 1:10m states and provinces; null for a country that has none.
loadFeaturesfunctionThe named features of a map (its seas, lakes, rivers, landforms and peaks), drawn on its own canvas, by the map or its id: a file of its own, fetched only when asked for.
loadWorldDetailfunctionThe world drawn finer: the same 173 countries on the same canvas, in the same projection, from Natural Earth's 1:50m outlines rather than its 1:110m ones, about 1.3 MB.

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