gridTilesInView関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The tiles of one level of a source's own grid that are in view. Only the columns and rows under the box are tested, so a fine matrix (hundreds of columns) is not walked. A tile that misses the Earth is left out.
インポート
import { gridTilesInView } from "@johnmorrisdotca/chikyu-earth/realistic";
定義
function gridTilesInView(level: MapGridLevel, extent: MapGrid["extent"], camera: TileCamera, sun?: readonly [number, number, number]): VisibleTile[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
level | MapGridLevel | A level of the source's grid. |
extent | { west: number; south: number; east: number; north: number; } | The Earth's extent, from the same grid. |
camera | TileCamera | The camera. |
sun (省略可) | readonly [number, number, number] | undefined | The Sun's direction as the camera sees it, for each tile's |
戻り値
VisibleTile[]
The tiles in view, the nearest to the middle of the box first.
例
import { gibsGrid } from "@johnmorrisdotca/chikyu-earth/door";
import { gridTilesInView } from "@johnmorrisdotca/chikyu-earth/realistic";
const grid = gibsGrid("250m");
console.log(gridTilesInView(grid.levels[6]!, grid.extent, { lon: 0, lat: 0, width: 800, height: 600, panX: 0, panY: 0, radius: 8000 }).length > 0);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。