Reference · Markers on the globe
MarkerOptionstype
What attachMarkers may be asked: the most labels, how close markers gather, and the default colour.
Import it
import type { MarkerOptions } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
interface MarkerOptions {
maxLabels?: number;
clusterRadius?: number;
color?: string;
}
Members
| Name | Type | Description |
|---|---|---|
maxLabels (optional) | number | undefined | Most labels shown at once (24). |
clusterRadius (optional) | number | undefined | Gather markers closer than this many pixels into a cluster (28); 0 turns clustering off. |
color (optional) | string | undefined | The colour of a marker with none of its own. |
Examples
import { attachMarkers, type MarkerOptions, type OverlayElement } from "@johnmorrisdotca/chikyu-earth/markers";
const options: MarkerOptions = { maxLabels: 12, clusterRadius: 20, color: "#ffcc00" };
const mark = (element: OverlayElement) => attachMarkers(element, options);
console.log(typeof mark);functionWhat it prints (run when this page was built)