SDK JS
    Preparing search index...

    The pure state machine behind one pegman drag: hit-testing against the map's canvas container while the ghost moves, and the terminal outcomes — a drop OVER the map unprojects the container-relative pixel and enters first person there at PEGMAN_ENTRY_PITCH (the map's current bearing is kept by omission); a drop anywhere else, an Escape press, or a pointer cancel ends the drag silently. Every terminal call is one-shot: once the session is done, further calls are no-ops.

    The DOM-owning widget feeds this from pointer events; keeping the logic here makes the drop wiring and the cancel paths unit-testable without a browser.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get done(): boolean

      Whether the session has reached a terminal state (dropped or cancelled).

      Returns boolean

    Methods

    • Terminal cancel (Escape, pointer cancel, or teardown): nothing is entered.

      Returns void

    • Terminal drop. Over the map: unproject the container-relative pixel and enter first person there (pitch PEGMAN_ENTRY_PITCH, bearing kept). Anywhere else: cancel silently.

      Parameters

      • clientX: number

        Pointer clientX at release.

      • clientY: number

        Pointer clientY at release.

      Returns boolean

      Whether the drop landed on the map (first person was entered).

    • Hit-test the current pointer position against the map's canvas container.

      Parameters

      • clientX: number

        Pointer clientX.

      • clientY: number

        Pointer clientY.

      Returns boolean

      Whether the pointer is over the map (highlight the ghost).