Function: resolveTileLevel()
ts
function resolveTileLevel(seaLevel, elevation): number;Resolves the signed terrain level of a tile relative to sea level — a caller-friendly index independent from the absolute band count:
0= the band currently sitting at the waterline.-1= one band below the waterline (shallows); deeper bands go-2, -3, ....1= one band above the waterline; peaks climb2, 3, .... On dry or frozen bodies (no sea),seaLevelis-1: the call just returns the absolute band index so every tile stays in[0, N-1].
Parameters
| Parameter | Type | Description |
|---|---|---|
seaLevel | number | Sea level elevation from the simulation (band space). |
elevation | number | Tile elevation — integer band index [0, N-1]. |
Returns
number
Signed integer level.