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 · The globe as an SVG string

GlobeOptionstype

What globe() may be asked.

Import it

import type { GlobeOptions } from "@johnmorrisdotca/chikyu-earth";

Definition

interface GlobeOptions {
    size?: number;
    rotation?: Rotation;
    centre?: GeoPoint;
    view?: GlobeView;
    style?: StyleName;
    graticule?: boolean;
}

Members

NameTypeDescription
size (optional)number | undefined

Width and height of the square SVG, in pixels. Default 320.

rotation (optional)Rotation | undefined

The turn, as [lambda, phi]. Default [0, 0]: the Greenwich meridian facing you, on the equator.

centre (optional)GeoPoint | undefined

A home centre and shared view state. When view is given it takes precedence over rotation.

view (optional)GlobeView | undefined
style (optional)"line" | "thick" | undefined

"line" (the default) or "thick".

graticule (optional)boolean | undefined

Draw a light graticule under the countries. Default false.

Examples

import { globe, type GlobeOptions } from "@johnmorrisdotca/chikyu-earth";

const options: GlobeOptions = { size: 200, style: "thick", graticule: true, centre: { lon: 10, lat: 30 } };
console.log(globe(options).startsWith("<svg"));
true

What it prints (run when this page was built)

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