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

centreRotationfunction

The rotation that puts centre in the middle of the disc: d3-geo's rotate is the negative of the point.

Import it

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

Definition

function centreRotation(centre: GeoPoint): Rotation

Parameters

NameTypeDescription
centreGeoPoint

The place to centre on.

Returns

Rotation

The [lambda, phi] pair for globe()'s rotation option.

Examples

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

console.log(centreRotation({ lon: 139.7, lat: 35.7 }));
[ -139.7, -35.7 ]

What it prints (run when this page was built)

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