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

PlaceLayoutOptionstype

What layoutPlaces may be told: the size of each name as the page draws it (a place with no size gets no name), boxes another layer already uses, and the most names.

Import it

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

Definition

interface PlaceLayoutOptions {
    size?: (place: Place, index: number) => {
        width: number;
        height: number;
    } | null;
    taken?: readonly {
        left: number;
        top: number;
        width: number;
        height: number;
    }[];
    maxLabels?: number;
    sun?: GeoPoint | null;
}

Members

NameTypeDescription
size (optional)((place: Place, index: number) => { width: number; height: number; } | null) | undefined
taken (optional)readonly { left: number; top: number; width: number; height: number; }[] | undefined
maxLabels (optional)number | undefined
sun (optional)GeoPoint | null | undefined

Where the Sun is overhead, for each shape's night; left out (or null), every place is in daylight.

Examples

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

const options: PlaceLayoutOptions = { size: () => ({ width: 60, height: 18 }), maxLabels: 8 };
console.log(options.maxLabels);
8

What it prints (run when this page was built)

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