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 data door: hand the package your own maps of the Earth or orbit data as a source with its own licence and credit, and see whose data is on the screen

EarthMapSourcetype

A source of the Earth's map in tiles for one layer (or every layer of a folder): a TileSource of the family's map shape (the place is a MapPlace, the detail is the pixels across the whole circumference, a tile is an ImageTile) that says which layer it is for. A layer of "*" is every layer of a folder (the place then names the one, in place.layer, and the keys start with its name). The keys a source returns end in level/column/row on the package's pyramid. levels says which levels the source has when that has to be asked (a folder's manifest); left out, levels 3 and 4.

Import it

import type { EarthMapSource } from "@johnmorrisdotca/chikyu-earth/door";

Definition

type EarthMapSource = TileSource<EarthMapPlace, number, ImageTile> & {
    layer: MapLayer | "*";
    levels?(layer: string, signal: AbortSignal): TileLayer | undefined | Promise<TileLayer | undefined>;
    grid?: MapGrid;
    holes?: boolean;
    look?: {
        clear: readonly [
            number,
            number
        ];
        gain?: readonly [
            number,
            number,
            number
        ];
    };
};

Members

NameTypeDescription
kind"tiles"
infoSourceInfo
need(place: EarthMapPlace, detail: number): readonly string[]

The keys of the tiles a place needs at a detail. Pure: no fetching.

load(key: string, signal: AbortSignal): Promise<ImageTile>

Loads one tile. The source may use the network or not; it must stop when the signal aborts.

bytes(tile: ImageTile): number

The tile's size in memory, in bytes, for the budget.

layerMapLayer | "*"
levels (optional)((layer: string, signal: AbortSignal) => TileLayer | undefined | Promise<TileLayer | undefined>) | undefined
grid (optional)MapGrid | undefined

The source's own grid, when it is not the package's pyramid (2^(L+1) columns by 2^L rows). The loader places tiles from this. Left out, the pyramid is unchanged.

holes (optional)boolean | undefined

True when the source's tiles may have transparent pixels (a place it has no data for), so the loader draws them blended and the picture underneath shows through.

look (optional){ clear: readonly [number, number]; gain?: readonly [number, number, number]; } | undefined

How the loader draws this source's tiles, on the graphics card: clear is the luminance (0 to 255) at or below which a pixel is wholly transparent and from which it is wholly opaque, and gain multiplies each colour. Left out, tiles are drawn as they are.

Examples

import type { EarthMapSource } from "@johnmorrisdotca/chikyu-earth/door";

const layers = (sources: readonly EarthMapSource[]): string[] => sources.map((source) => source.layer);
console.log(layers([]));
[]

What it prints (run when this page was built)

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