Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The realistic Earth's pure parts

shapeBoxesfunction

Each coded shape's box in longitude and latitude: [west, south, east, north], with west greater than east for a shape across the 180th meridian (the shorter way round).

Import it

import { shapeBoxes } from "@johnmorrisdotca/chikyu-earth/realistic";

Definition

function shapeBoxes(shapes: BorderShapes): Map<string, [number, number, number, number]>

Parameters

NameTypeDescription
shapesBorderShapes

The shapes; one with no code is left out.

Returns

Map<string, [number, number, number, number]>

The box of each code.

Examples

import { shapeBoxes } from "@johnmorrisdotca/chikyu-earth/realistic";

const fiji = { properties: { code: "FJ" }, geometry: { type: "Polygon", coordinates: [[[177, -18], [-179, -18], [-179, -16], [177, -16], [177, -18]]] } };
console.log(shapeBoxes({ features: [fiji] }).get("FJ"));
[ 177, -18, -179, -16 ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.51.1.