Reference · The realistic Earth's pure parts
BorderDatatype
Where the borders' shapes come from. countries gives the countries (chizu's world-geo, Natural Earth 1:110m, when left out); regions gives one country's regions by its code, or null
for a country with none, and draws no regions when left out. Each is a set of shapes in longitude and latitude.
Import it
import type { BorderData } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
interface BorderData {
countries?: () => Promise<BorderShapes>;
regions?: (code: string) => Promise<BorderShapes | null>;
}
Members
| Name | Type | Description |
|---|---|---|
countries (optional) | (() => Promise<BorderShapes>) | undefined | |
regions (optional) | ((code: string) => Promise<BorderShapes | null>) | undefined |
Examples
import type { BorderData } from "@johnmorrisdotca/chikyu-earth/realistic";
const data: BorderData = { regions: async (code) => (code === "JP" ? (await fetch("/regions/jp.json")).json() : null) };
console.log(typeof data.regions);