Reference · The realistic Earth's pure parts
parseManifestfunction
Read a tile set's manifest (manifest.json): the tile size and, for each layer, its levels. A manifest with no usable layer gives undefined.
Import it
import { parseManifest } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function parseManifest(json: unknown): { tileSize: number; layers: Record<string, TileLayer>; } | undefined
Parameters
| Name | Type | Description |
|---|---|---|
json | unknown | The parsed JSON. |
Returns
{ tileSize: number; layers: Record<string, TileLayer>; } | undefined
A layer name to its levels, and the tile size; or undefined.
Examples
import { parseManifest } from "@johnmorrisdotca/chikyu-earth/realistic";
const manifest = parseManifest({ tileSize: 512, layers: { day: { levels: [{ level: 3, width: 8192, height: 4096, columns: 16, rows: 8 }] } } });
console.log(manifest?.layers["day"]?.levels);[ { level: 3, width: 8192 } ]What it prints (run when this page was built)