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

ChizuCitytype

One city as the layer reads it: the fields of kuni's City that a map needs, so a kuni city is one as it is.

Import it

import type { ChizuCity } from "@johnmorrisdotca/chizu/cities";

Also exported from: @johnmorrisdotca/chizu

Definition

type ChizuCity = {
    id: string;
    name: {
        en: string;
        ja?: string;
        jaShort?: string;
    };
    lat: number;
    lon: number;
    population?: number | null;
    capital?: string | null;
    country?: string;
};

Members

NameTypeDescription
idstring

Stable and unique in the list: the drawing's data-city.

name{ en: string; ja?: string; jaShort?: string; }

Its name in English, and in Japanese where it is known; a Japanese page prints the English name where there is none. jaShort is the Japanese name a map labels it by (東京 for 東京都, 大阪 for 大阪市: kuni 1.6.3 gives it); where it is given, the label is it and the full name is the dot's title.

latnumber

Latitude in degrees, north positive.

lonnumber

Longitude in degrees, east positive.

population (optional)number | null | undefined

The people living there; null or absent where it is not known, which puts the city last.

capital (optional)string | null | undefined

national for a country's capital, drawn with a ring; any other value, or none, is a plain dot.

country (optional)string | undefined

Its country's ISO 3166-1 alpha-2 code, JP: a map of one country alone names only that country's cities.

Examples

import type { ChizuCity } from "@johnmorrisdotca/chizu";

const paris: ChizuCity = { id: "Q90", name: { en: "Paris", ja: "パリ" }, lat: 48.857, lon: 2.352, population: 2_145_906, capital: "national" };
console.log(paris.name.en);
// Paris
Paris

What it prints (run when this page was built)

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