countryShapefunction
One country by its ISO alpha-2 code, for a "my country" sheet: its main land and the islands near it (a far territory such as French Guiana is left out), the continent it is in and the countries it touches.
Import it
import { countryShape } from "@johnmorrisdotca/chikyu-earth/sheets";
Definition
function countryShape(alpha2: string): CountryShape | undefined
Parameters
| Name | Type | Description |
|---|---|---|
alpha2 | string | The two-letter code, such as |
Returns
CountryShape | undefined
The shape, or undefined when the package has no outline for the code.
Examples
import { countryShape } from "@johnmorrisdotca/chikyu-earth/sheets";
const france = countryShape("FR");
console.log(france?.continent, france?.neighbours.length);europe 6What it prints (run when this page was built)