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 · Markers on the globe

OverlayHosttype

What an element gives the markers (element.overlay): a box laid over its view, the pose of its last draw, and a way to hear the next ones.

Import it

import type { OverlayHost } from "@johnmorrisdotca/chikyu-earth/markers";

Definition

interface OverlayHost {
    readonly overlayRoot: HTMLElement;
    readonly pose: OverlayPose | null;
    subscribe(listener: (pose: OverlayPose) => void): () => void;
}

Members

NameTypeDescription
overlayRootHTMLElement
poseOverlayPose | null
subscribe(listener: (pose: OverlayPose) => void): () => void

Examples

import type { OverlayHost } from "@johnmorrisdotca/chikyu-earth/markers";

const follow = (host: OverlayHost): (() => void) => host.subscribe((pose) => console.log(pose.radius));
console.log(typeof follow);
function

What it prints (run when this page was built)

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