chooseTier関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The width to hold for a layer when the globe's disc has radius radiusPx device pixels: the smallest shipped width that gives
TEXELS_PER_RADIUS_PIXEL texels per pixel, else the largest, never more than cap, never less than the smallest.
インポート
import { chooseTier } from "@johnmorrisdotca/chikyu-earth/realistic";
定義
function chooseTier(layer: Layer, radiusPx: number, cap?: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
layer | Layer | Which picture. |
radiusPx | number | The disc's radius in device pixels. |
cap (省略可) | number | The most pixels across to ask for; |
戻り値
number
One of the widths in TIERS for that layer.
例
import { chooseTier } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(chooseTier("day", 200), chooseTier("day", 900), chooseTier("day", 900, 2048));1024 4096 2048出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。