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 realistic Earth's pure parts

readBodyLabelfunction

What the family's attributes mean: body-label (painted, etched, outline or burned; present with another value, or none, it is painted; absent, no label), body-label-strength (0 to 1, 0.5), body-label-repeat (once, both or around; once), body-label-latitude (degrees; 0), body-label-facing (present: always facing the reader), body-label-font and body-label-fallback-font.

Import it

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

Definition

function readBodyLabel(get: (name: string) => string | null): BodyLabelSettings | null

Parameters

NameTypeDescription
get(name: string) => string | null

Reads an attribute by name, null for one that is not there.

Returns

BodyLabelSettings | null

The settings, or null for no label.

Examples

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

const attributes: Record<string, string> = { "body-label": "etched", "body-label-strength": "0.8", "body-label-repeat": "both" };
console.log(readBodyLabel((name) => attributes[name] ?? null));
{
  look: 'etched',
  strength: 0.8,
  repeat: 'both',
  latitude: 0,
  facing: false
}

What it prints (run when this page was built)

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