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
引数
| 名前 | 型 | 説明 |
|---|---|---|
centre | GeoPoint | The home centre. |
size | number | 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 ]
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。