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
| Name | Type | Description |
|---|---|---|
overlayRoot | HTMLElement | |
pose | OverlayPose | 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);functionWhat it prints (run when this page was built)