SDK JS
    Preparing search index...

    Function createFirstPersonNav

    FirstPersonNav — walk/drone navigation pinned above ANY rendered surface (terrain, 3D Tiles mesh, I3S mesh, splats, point clouds, BIM), with user-set height (min 2 ft) + speed, walk/fly obstacle modes, and keyboard movement.

    • Create the FirstPersonNav controller for a map (one per map). See the module doc for the interaction model; see FirstPersonNavOptions for tuning; pair it with FirstPersonNavWidget for the ready-made control UI (including the drag-to-map pegman entry).

      Parameters

      Returns FirstPersonNavController

      The controller; see FirstPersonNavController.

      Error if a FirstPersonNav already exists for this map.

      import { createFirstPersonNav } from '@bitruvius/sdk-maplibre';

      const nav = createFirstPersonNav(map, { heightM: 1.8, speedMps: 8, mode: 'walk' });
      nav.enterAt({ lng: -71.0589, lat: 42.3601 }); // pegman drop: WASD moves, drag looks, Esc leaves
      // … later: nav.dispose();