SDK JS
    Preparing search index...

    Function reconstructPickPosition

    • Reconstruct the geographic position of a picked pixel from its window depth.

      Parameters

      • mvpWorld: Mat4

        The frame's mercator-world → clip matrix (MapLibre's mainMatrix, f64).

      • viewportWidth: number

        Pick-target width in DEVICE pixels (the drawing buffer).

      • viewportHeight: number

        Pick-target height in DEVICE pixels.

      • xDev: number

        Picked X in DEVICE pixels, top-left origin (same value given to pickWithDepth).

      • yDev: number

        Picked Y in DEVICE pixels, top-left origin.

      • depth01: number

        Window-space depth in [0, 1] from the pick pass.

      Returns PickedPosition | null

      The PickedPosition, or null when the matrix is singular or the result is degenerate (w ≈ 0).