Reference · Markers on the globe
MarkerInputtype
A place on the Earth. Chikyu ships none: the page brings its own.
Import it
import type { MarkerInput } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
interface MarkerInput {
id: string;
lon: number;
lat: number;
label?: string;
description?: string;
color?: string;
icon?: MarkerIcon;
size?: number;
group?: string;
priority?: number;
data?: unknown;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | Your own unique name for it. |
lon | number | Degrees east and north. |
lat | number | |
label (optional) | string | undefined | Shown beside the dot when there is room; also its name for a screen reader. |
description (optional) | string | undefined | What a screen reader says instead of the label (a sentence). |
color (optional) | string | undefined | Any CSS colour. Default the accent. |
icon (optional) | MarkerIcon | undefined | |
size (optional) | number | undefined | Diameter in CSS pixels, 4 to 32. Default 8. |
group (optional) | string | undefined | A name for a set of markers (cities, stadiums) that can be shown or hidden together. |
priority (optional) | number | undefined | Higher keeps its label when labels crowd. Default 0. |
data (optional) | unknown | Yours: given back in every event. |
Examples
import type { MarkerInput } from "@johnmorrisdotca/chikyu-earth/markers";
const tokyo: MarkerInput = { id: "tokyo", lon: 139.69, lat: 35.69, label: "Tokyo", group: "Cities", priority: 5, data: { population: 14_000_000 } };
console.log(tokyo.label);TokyoWhat it prints (run when this page was built)