Leave first person and restore every map handler/limit.
Disable + release everything. Safe to call repeatedly.
Enter first person at the camera's current ground position.
Enter first person AT a location (e.g. a pegman drop): the camera glides to eye height above the surface there, then the first-person loop owns it.
Optionalentry: FirstPersonEntryThe steepest slope walk mode will currently climb, DEGREES — the climb
allowance resolved against the live speed-scaled probe distance
(atan(climbMax / max(2, speed × lookAhead))). Changes when either the
climb allowance OR the speed changes; the widget shows it beside the
climb slider so the speed coupling is visible instead of silent.
Subscribe to nav events; returns the unsubscriber.
Lock the eye to the surface (true) or release it into free flight
(false) — the fly-mode terrain clamp.
Locked (the default) the eye rides at getHeight above whatever is
rendered under it, gliding up and over relief and rooftops. Unlocked it
HOLDS the altitude it had at the moment of the unlock, so flying at a hill
flies AT it, not over it; the wheel/height input still raises and lowers
the eye (by the same metres it would have added above the surface), and
re-locking drops it back to surface + height where it currently stands.
Walk mode ignores this and always clamps — you cannot walk off the ground.
(This is the nav's own clamp. It is NOT maplibre's
setCenterClampedToGround, which the nav holds off for the whole session:
that flag governs maplibre's per-frame center-elevation follow, which
fights the nav's poses at head-level pitches — see enterAt.)
true to pin to the surface, false for free flight.
Set the walk-mode climb allowance: the surface rise (m) a forward step may gain across the look-ahead probe before it is refused as a wall. Clamped to ≥ 0 (0 = refuse ANY rise). See FirstPersonNavOptions.climbMaxM for why this is a rise and not a slope.
Set the eye height (m above the surface); clamped to ≥ 2 ft.
Switch obstacle behavior (walk = block at walls, fly = climb over).
Set the movement speed (m/s); clamped to > 0.
The controller returned by createFirstPersonNav.
Example