ChizuCity型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 type { ChizuCity } from "@johnmorrisdotca/chizu/cities";
ほかのエクスポート元: @johnmorrisdotca/chizu
定義
type ChizuCity = {
id: string;
name: {
en: string;
ja?: string;
jaShort?: string;
};
lat: number;
lon: number;
population?: number | null;
capital?: string | null;
country?: string;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | Stable and unique in the list: the drawing's |
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.
|
lat | number | Latitude in degrees, north positive. |
lon | number | Longitude in degrees, east positive. |
population (省略可) | number | null | undefined | The people living there; |
capital (省略可) | string | null | undefined |
|
country (省略可) | string | undefined | Its country's ISO 3166-1 alpha-2 code, |
例
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);
// ParisParis出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。