本文へ移動

Chizu地図

世界、253の国、33か国の州や県などの地域を、SVGの地図に描けます。表示する範囲を決めたり、番号付きの注記をつけたり、地理クイズを作ったりもできます。名前は今のところ英語と日本語で、スペイン語、ドイツ語、中国語にも対応する予定です。

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

目次

リファレンス · /airports

ChizuPort型

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

One airport or harbour: the fields a map needs, with its names in English and Japanese. A list is ordered by importance (an airport by passengers a year, a harbour by Natural Earth's size), the order marks win a crowded place in.

インポート

import type { ChizuPort } from "@johnmorrisdotca/chizu/airports";

ほかのエクスポート元: @johnmorrisdotca/chizu/harbours, @johnmorrisdotca/chizu

定義

type ChizuPort = {
    id: string;
    kind: "airport" | "harbour";
    code?: string;
    name: {
        en: string;
        ja?: string;
    };
    country: string;
    lat: number;
    lon: number;
    tier: 1 | 2 | 3;
    passengers?: number;
    year?: number;
};

メンバー

名前型説明
idstring

Stable and unique within its kind: an airport's lower-case IATA code (hnd), else its ICAO code; a harbour's name as a slug (yokohama). The drawing's data-port.

kind"airport" | "harbour"
code (省略可)string | undefined

An airport's IATA code (HND), else its ICAO code; none for a harbour.

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

English, and Japanese where Wikidata has a label; a Japanese page prints the English name where there is none.

countrystring

Its country's ISO 3166-1 alpha-2 code, or Natural Earth's SOL (Somaliland) or CYN (Northern Cyprus), which have none.

latnumber

Latitude in degrees, north positive.

lonnumber

Longitude in degrees, east positive.

tier1 | 2 | 3

1 the largest. An airport's tiers end at its 150th, 300th and 600th by passengers; a harbour's at Natural Earth's size 4, 5 and the rest.

passengers (省略可)number | undefined

An airport's passengers a year in year, where Wikidata has it.

year (省略可)number | undefined

例

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

const haneda: ChizuPort = { id: "hnd", kind: "airport", code: "HND", name: { en: "Tokyo International Airport", ja: "東京国際空港" }, country: "JP", lat: 35.5523, lon: 139.7798, tier: 1 };
console.log(haneda.name.ja);
// 東京国際空港
東京国際空港

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

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

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