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

tileLevelfunction

The first level to load for a disc: the smallest one whose texels are about a device pixel on the screen, else the finest there is, and none when the whole-Earth picture (baseWidth across) is already that sharp.

Import it

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

Definition

function tileLevel(radiusPx: number, layer: TileLayer, baseWidth: number): number | undefined

Parameters

NameTypeDescription
radiusPxnumber

The disc's radius in device pixels.

layerTileLayer

The levels the set has for this layer.

baseWidthnumber

The width of the picture the tiles are laid over, 4096 for the day map.

Returns

number | undefined

A level in layer, or undefined when no tile is worth loading.

Examples

import { tileLevel, type TileLayer } from "@johnmorrisdotca/chikyu-earth/realistic";

const day: TileLayer = { tileSize: 512, levels: [{ level: 3, width: 8192 }, { level: 4, width: 16384 }] };
console.log(tileLevel(600, day, 4096), tileLevel(1500, day, 4096), tileLevel(9000, day, 4096));
undefined 3 4

What it prints (run when this page was built)

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