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
| Name | Type | Description |
|---|---|---|
layer | Layer | Which picture. |
radiusPx | number | The disc's radius in device pixels. |
cap (optional) | number | The most pixels across to ask for; |
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 2048What it prints (run when this page was built)