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

readRoutefunction

Read the route attribute: lon,lat,lon,lat. Anything else is no route.

Import it

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

Definition

function readRoute(value: string | null | undefined): { from: GeoPoint; to: GeoPoint; } | null

Parameters

NameTypeDescription
valuestring | null | undefined

The attribute's text, or null.

Returns

{ from: GeoPoint; to: GeoPoint; } | null

The two places, or null.

Examples

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

console.log(readRoute("139.69,35.69,-0.13,51.51")?.from.lat);
console.log(readRoute("no"));
35.69
null

What it prints (run when this page was built)

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