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 data door: hand the package your own maps of the Earth or orbit data as a source with its own licence and credit, and see whose data is on the screen

gridTileAtfunction

The column and row of the tile that holds a point, or undefined when the point is off the Earth or the tile that would hold it misses the Earth. A longitude of 180 is the same meridian as -180, and both fall in column 0. A latitude of -90 falls in the last row that still meets the Earth.

Import it

import { gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";

Definition

function gridTileAt(level: MapGridLevel, lon: number, lat: number, extent: MapGrid["extent"]): { col: number; row: number; } | undefined

Parameters

NameTypeDescription
levelMapGridLevel

The level.

lonnumber

The longitude in degrees.

latnumber

The latitude in degrees.

extent{ west: number; south: number; east: number; north: number; }

The Earth's extent.

Returns

{ col: number; row: number; } | undefined

The tile, or undefined.

Examples

import { gibsGrid, gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";

const level = gibsGrid("250m").levels[3]!;
console.log(gridTileAt(level, 180, 0, gibsGrid("250m").extent));
{ col: 0, row: 2 }

What it prints (run when this page was built)

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