本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 地球上の目印

MarkerInput型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A place on the Earth. Chikyu ships none: the page brings its own.

インポート

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

定義

interface MarkerInput {
    id: string;
    lon: number;
    lat: number;
    label?: string;
    description?: string;
    color?: string;
    icon?: MarkerIcon;
    size?: number;
    group?: string;
    priority?: number;
    data?: unknown;
}

メンバー

名前型説明
idstring

Your own unique name for it.

lonnumber

Degrees east and north.

latnumber
label (省略可)string | undefined

Shown beside the dot when there is room; also its name for a screen reader.

description (省略可)string | undefined

What a screen reader says instead of the label (a sentence).

color (省略可)string | undefined

Any CSS colour. Default the accent.

icon (省略可)MarkerIcon | undefined
size (省略可)number | undefined

Diameter in CSS pixels, 4 to 32. Default 8.

group (省略可)string | undefined

A name for a set of markers (cities, stadiums) that can be shown or hidden together.

priority (省略可)number | undefined

Higher keeps its label when labels crowd. Default 0.

data (省略可)unknown

Yours: given back in every event.

例

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

const tokyo: MarkerInput = { id: "tokyo", lon: 139.69, lat: 35.69, label: "Tokyo", group: "Cities", priority: 5, data: { population: 14_000_000 } };
console.log(tokyo.label);
Tokyo

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.11.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。