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 · Satellites: orbital elements in, positions out

FetchElementsOptionstype

What fetchElements can be told. Every one has a safe default.

Import it

import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";

Definition

interface FetchElementsOptions {
    minIntervalMs?: number;
    blockedMs?: number;
    maxBytes?: number;
    maxSets?: number;
    store?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | null;
    fetch?: typeof fetch;
    now?: () => number;
    signal?: AbortSignal;
}

Members

NameTypeDescription
minIntervalMs (optional)number | undefined

The shortest time between two requests to the same address; within it the answer already read is returned (2 hours by default: CelesTrak's elements change every 2 hours and it asks for one download an update).

blockedMs (optional)number | undefined

How long a source that answered anything but 200 (or did not answer) is left alone (1 hour by default).

maxBytes (optional)number | undefined

The most bytes of answer read (20 million by default).

maxSets (optional)number | undefined

The most element sets kept (50,000 by default).

store (optional)Pick<Storage, "getItem" | "setItem" | "removeItem"> | null | undefined

Where answers and refusals are kept between page loads: localStorage by default where there is one; null keeps them for this page only.

fetch (optional)((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined

The fetch function (the browser's by default).

now (optional)(() => number) | undefined

The time, in milliseconds since the Unix epoch (Date.now by default).

signal (optional)AbortSignal | undefined

Examples

import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";

const options: FetchElementsOptions = { minIntervalMs: 3 * 3_600_000 };
console.log(options.minIntervalMs);
10800000

What it prints (run when this page was built)

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