gridLevelForfunction
The level of a grid whose width is at least detail pixels across a full turn, or the finest level when none is, or undefined when the grid has no level wider than minWidth.
Import it
import { gridLevelFor } from "@johnmorrisdotca/chikyu-earth/door";
Definition
function gridLevelFor(grid: MapGrid, detail: number, minWidth: number): MapGridLevel | undefined
Parameters
| Name | Type | Description |
|---|---|---|
grid | MapGrid | The source's grid. |
detail | number | The pixels across a full turn the view wants. |
minWidth | number | Levels no wider than this are left out (the picture already underneath). |
Returns
MapGridLevel | undefined
The level, or undefined when nothing in the grid is finer than minWidth.
Examples
import { gibsGrid, gridLevelFor } from "@johnmorrisdotca/chikyu-earth/door";
console.log(gridLevelFor(gibsGrid("250m"), 40000, 32768)?.level);6What it prints (run when this page was built)