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;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | Stable and unique within its kind: an airport's lower-case IATA code ( |
kind | "airport" | "harbour" | |
code (省略可) | string | undefined | An airport's IATA code ( |
name | { en: string; ja?: string; } | English, and Japanese where Wikidata has a label; a Japanese page prints the English name where there is none. |
country | string | Its country's ISO 3166-1 alpha-2 code, or Natural Earth's |
lat | number | Latitude in degrees, north positive. |
lon | number | Longitude in degrees, east positive. |
tier | 1 | 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 (省略可) | 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);
// 東京国際空港東京国際空港出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。