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

codesNearfunction

The codes whose boxes come within angle degrees of a place: the countries whose regions a view may show.

Import it

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

Definition

function codesNear(boxes: ReadonlyMap<string, readonly [number, number, number, number]>, lon: number, lat: number, angle: number): string[]

Parameters

NameTypeDescription
boxesReadonlyMap<string, readonly [number, number, number, number]>

The boxes from shapeBoxes.

lonnumber

The place's longitude, degrees.

latnumber

The place's latitude, degrees.

anglenumber

How far round the sphere the view reaches from the place, degrees (90 for the whole near side).

Returns

string[]

The codes, in the boxes' order.

Examples

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

const boxes = new Map<string, [number, number, number, number]>([["JP", [122, 24, 154, 46]], ["BR", [-74, -34, -34, 5]]]);
console.log(codesNear(boxes, 139.7, 35.7, 10));
[ 'JP' ]

What it prints (run when this page was built)

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