Reference · The realistic Earth's pure parts
NamedShapetype
One country outline the names are made from: a GeoJSON feature in longitude and latitude (a Polygon or MultiPolygon) with its code and its English and Japanese names, as chizu's
world-geo has them. A feature with no name is passed over.
Import it
import type { NamedShape } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
interface NamedShape {
properties?: {
code?: string | null;
name?: string | null;
nameJa?: string | null;
} | null;
geometry: {
type: string;
coordinates: unknown;
} | null;
}
Members
| Name | Type | Description |
|---|---|---|
properties (optional) | { code?: string | null; name?: string | null; nameJa?: string | null; } | null | undefined | |
geometry | { type: string; coordinates: unknown; } | null |
Examples
import type { NamedShape } from "@johnmorrisdotca/chikyu-earth/realistic";
const square: NamedShape = { properties: { code: "A", name: "Square", nameJa: "四角" }, geometry: { type: "Polygon", coordinates: [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]] } };
console.log(square.properties?.name);SquareWhat it prints (run when this page was built)