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

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

Exports

NameKindWhat it is
attachMarkersfunctionPut 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.
canvasRatiofunctionThe 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).
ClustertypeSeveral points gathered into one on the screen: where it is drawn and which points are in it.
clusterPointsfunctionGroup the points indices (into xs and ys) by the grid cell they fall in.
GroupInfotypeOne group of markers: its name, how many it holds and whether it is shown.
LabelItemtypeOne label to place: its dot's centre and radius, its box's size and its priority.
MarkerEventDetailtypeWhat the chikyu-marker-hover, chikyu-marker-click and chikyu-marker-focus events carry in event.detail.
MarkerIcontypeThe shapes a marker can be drawn as: dot, ring, square or diamond.
MarkerInputtypeA place on the Earth.
MarkerOptionstypeWhat attachMarkers may be asked: the most labels, how close markers gather, and the default colour.
MarkerstypeThe markers on one globe: add, update, remove and find them, show or hide groups, and detach.
OverlayElementtypeAn element markers can be put on: any HTML element with an overlay (both <chikyu-earth> and <chikyu-earth-realistic> have one).
OverlayHosttypeWhat 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.
OverlayPosetypeThe pose of an element's last drawing, with the size of its box and the CSS transform its picture carries between redraws.
placeLabelsfunctionPlace up to max labels inside width x height.
PlacementtypeWhere one label goes: which item it is and its box's top-left corner.
PosetypeThe view: the point of the Earth at the middle of the disc, the disc's radius and its centre, in CSS pixels.
projectfunctionProject a longitude and latitude (degrees) to the screen.
projectAllfunctionProject many points into flat arrays (reused between calls); z is the cosine used for a point's facing test.

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