Reference · The realistic Earth's pure parts
NamedCitytype
What the layer needs of a city: kuni's own record has more, and any list with these fields will do.
Import it
import type { NamedCity } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
interface NamedCity {
id: string;
name: {
en: string;
ja?: string;
jaShort?: string;
};
lat: number;
lon: number;
population: number | null;
capital: "national" | "alternate" | "subdivision" | null;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | |
name | { en: string; ja?: string; jaShort?: string; } | |
lat | number | |
lon | number | |
population | number | null | |
capital | "national" | "alternate" | "subdivision" | null |
Examples
import type { NamedCity } from "@johnmorrisdotca/chikyu-earth/realistic";
const osaka: NamedCity = { id: "Q35765", name: { en: "Osaka", ja: "大阪市" }, lat: 34.69, lon: 135.5, population: 2_700_000, capital: null };
console.log(osaka.name.en);OsakaWhat it prints (run when this page was built)