本文へ移動

Chizu地図

SVGの地図を描き、地域を表示範囲に収め、番号付きの注記や地理クイズを英語と日本語の名前で作れます。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス · 表示範囲・形・クイズの道具

ChizuCountry型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

One country in the table of every country: its names, and which of the maps has it.

インポート

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

定義

interface ChizuCountry {
    code: string;
    iso3: string;
    name: string;
    nameJa: string;
    nameShortJa?: string;
    reading?: string;
    group: string;
    onWorld: boolean;
    hasDivisions: boolean;
}

メンバー

名前型説明
codestring

ISO 3166-1 alpha-2, or Natural Earth's own three letters where a territory has none. Lower case in a file's name.

iso3string
namestring
nameJastring
nameShortJa (省略可)string | undefined
reading (省略可)string | undefined
groupstring

The continent.

onWorldboolean

Whether the coarse world map draws it (the smallest places are only in the country's own file).

hasDivisionsboolean

Whether it has a map of its own regions: its provinces, states or departments.

例

import { CHIZU_COUNTRIES } from "@johnmorrisdotca/chizu/names";
import type { ChizuCountry } from "@johnmorrisdotca/chizu";

const withRegions: ChizuCountry[] = CHIZU_COUNTRIES.filter((country) => country.hasDivisions);
console.log(withRegions.length, withRegions.map((country) => country.code).slice(0, 5).join(" "));
// 32 AR AT AU BE BR
32 AR AT AU BE BR

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.5.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。