Reference · Browser table and SVG
nearestLandfunction
The territory whose counter is nearest a point of the map, within reach map units, or null.
Import it
import { nearestLand } from "@johnmorrisdotca/tenka/ui";
Definition
function nearestLand(x: number, y: number, reach: number, map?: TenkaMapKey): number | null
Parameters
| Name | Type | Description |
|---|---|---|
x | number | The horizontal map-unit coordinate. |
y | number | The vertical map-unit coordinate. |
reach | number | The maximum map-unit distance to consider. |
map (optional) | TenkaMapKey | The native world or Europe map to use. |
Returns
number | null
The nearest territory within reach, or null when none qualifies.
Examples
import { nearestLand } from "@johnmorrisdotca/tenka/ui";
console.log(nearestLand(200,200,100));1What it prints (run when this page was built)