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 · /cities

loadKuniCitiesfunction

Kuni's cities, each once, ready for drawChizu's cities: the tiers asked for (capitals, 1m, 100k, 15k), or CHIZU_CITY_TIERS. Each tier is loaded only when it is asked for, and kept by kuni once loaded.

Import it

import { loadKuniCities } from "@johnmorrisdotca/chizu/cities";

Definition

function loadKuniCities(...tiers: readonly CityTier[]): Promise<readonly ChizuCity[]>

Parameters

NameTypeDescription
...tiersreadonly CityTier[]

The kuni tiers to load; default CHIZU_CITY_TIERS.

Returns

Promise<readonly ChizuCity[]>

The cities, in the shape the city layer reads.

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { drawChizu } from "@johnmorrisdotca/chizu/draw";
import { loadKuniCities } from "@johnmorrisdotca/chizu/cities";

const svg = drawChizu(WORLD, { cities: await loadKuniCities(), language: "ja", style: true });
console.log(svg.includes('class="cz-cities"'));
// true

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