Reference
Markers on the globe
import { … } from "@johnmorrisdotca/chikyu-earth/markers";
Exports
| Name | Kind | What it is |
|---|---|---|
attachMarkers | function | Put markers on a globe, for either look: dots drawn in one pass on a canvas, a few labels as real buttons, crowded places gathered into clusters. |
canvasRatio | function | The pixel ratio for an overlay canvas: the device's, to 2, held to 4096 a side and 6 million pixels (the same budget as the 3D canvas). |
Cluster | type | Several points gathered into one on the screen: where it is drawn and which points are in it. |
clusterPoints | function | Group the points indices (into xs and ys) by the grid cell they fall in. |
GroupInfo | type | One group of markers: its name, how many it holds and whether it is shown. |
LabelItem | type | One label to place: its dot's centre and radius, its box's size and its priority. |
MarkerEventDetail | type | What the chikyu-marker-hover, chikyu-marker-click and chikyu-marker-focus events carry in event.detail. |
MarkerIcon | type | The shapes a marker can be drawn as: dot, ring, square or diamond. |
MarkerInput | type | A place on the Earth. |
MarkerOptions | type | What attachMarkers may be asked: the most labels, how close markers gather, and the default colour. |
Markers | type | The markers on one globe: add, update, remove and find them, show or hide groups, and detach. |
OverlayElement | type | An element markers can be put on: any HTML element with an overlay (both <chikyu-earth> and <chikyu-earth-realistic> have one). |
OverlayHost | type | 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. |
OverlayPose | type | The pose of an element's last drawing, with the size of its box and the CSS transform its picture carries between redraws. |
placeLabels | function | Place up to max labels inside width x height. |
Placement | type | Where one label goes: which item it is and its box's top-left corner. |
Pose | type | The view: the point of the Earth at the middle of the disc, the disc's radius and its centre, in CSS pixels. |
project | function | Project a longitude and latitude (degrees) to the screen. |
projectAll | function | Project many points into flat arrays (reused between calls); z is the cosine used for a point's facing test. |