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

gridTilesInViewfunction

The tiles of one level of a source's own grid that are in view. Only the columns and rows under the box are tested, so a fine matrix (hundreds of columns) is not walked. A tile that misses the Earth is left out.

Import it

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

Definition

function gridTilesInView(level: MapGridLevel, extent: MapGrid["extent"], camera: TileCamera, sun?: readonly [number, number, number]): VisibleTile[]

Parameters

NameTypeDescription
levelMapGridLevel

A level of the source's grid.

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

The Earth's extent, from the same grid.

cameraTileCamera

The camera.

sun (optional)readonly [number, number, number] | undefined

The Sun's direction as the camera sees it, for each tile's ndl; left out, ndl is 1.

Returns

VisibleTile[]

The tiles in view, the nearest to the middle of the box first.

Examples

import { gibsGrid } from "@johnmorrisdotca/chikyu-earth/door";
import { gridTilesInView } from "@johnmorrisdotca/chikyu-earth/realistic";

const grid = gibsGrid("250m");
console.log(gridTilesInView(grid.levels[6]!, grid.extent, { lon: 0, lat: 0, width: 800, height: 600, panX: 0, panY: 0, radius: 8000 }).length > 0);
true

What it prints (run when this page was built)

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