リファレンス · データの入口(自分で用意した地球の地図や軌道データを、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)
gridTileAt関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The column and row of the tile that holds a point, or undefined when the point is off the Earth or the tile that would hold it misses the Earth.
A longitude of 180 is the same meridian as -180, and both fall in column 0. A latitude of -90 falls in the last row that still meets the Earth.
インポート
import { gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";
定義
function gridTileAt(level: MapGridLevel, lon: number, lat: number, extent: MapGrid["extent"]): { col: number; row: number; } | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
level | MapGridLevel | The level. |
lon | number | The longitude in degrees. |
lat | number | The latitude in degrees. |
extent | { west: number; south: number; east: number; north: number; } | The Earth's extent. |
戻り値
{ col: number; row: number; } | undefined
The tile, or undefined.
例
import { gibsGrid, gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";
const level = gibsGrid("250m").levels[3]!;
console.log(gridTileAt(level, 180, 0, gibsGrid("250m").extent));{ col: 0, row: 2 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。