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

chooseTierfunction

The width to hold for a layer when the globe's disc has radius radiusPx device pixels: the smallest shipped width that gives TEXELS_PER_RADIUS_PIXEL texels per pixel, else the largest, never more than cap, never less than the smallest.

Import it

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

Definition

function chooseTier(layer: Layer, radiusPx: number, cap?: number): number

Parameters

NameTypeDescription
layerLayer

Which picture.

radiusPxnumber

The disc's radius in device pixels.

cap (optional)number

The most pixels across to ask for; MAX_TEXTURE by default.

Returns

number

One of the widths in TIERS for that layer.

Examples

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

console.log(chooseTier("day", 200), chooseTier("day", 900), chooseTier("day", 900, 2048));
1024 4096 2048

What it prints (run when this page was built)

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