本文へ移動

Chikyu Earth地球

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

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

目次

リファレンス · SVG文字列としての地球儀

projectionView関数

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

What the projection is given for a view: yaw turns longitude, tilt tips latitude, zoom scales and pan moves the disc in CSS pixels.

インポート

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

定義

function projectionView(centre: GeoPoint, size: number, view?: GlobeView): ProjectionView

引数

名前型説明
centreGeoPoint

The home centre.

sizenumber

The width and height of the square the globe is drawn in, in pixels.

view (省略可)GlobeView

The turn, tip, zoom and pan; the home view when left out.

戻り値

ProjectionView

The rotation, scale and translation for d3-geo's orthographic projection.

例

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

console.log(projectionView({ lon: 139.7, lat: 35.7 }, 420, { yaw: 10, tilt: 5, zoom: 2, panX: 0, panY: 0 }));
{
  rotation: [ -129.7, -30.700000000000003 ],
  scale: 418,
  translate: [ 210, 210 ]
}

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

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

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