SDK JS
    Preparing search index...

    Function projectLngLatHeightToCss

    • Project a 3D geographic position through a frame matrix to CSS-pixel screen coordinates — the height-aware complement of map.project (which is ground-level only). Pure math, no GL.

      Parameters

      • frameMatrix: Mat4

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

      • cssWidth: number

        Canvas width in CSS pixels.

      • cssHeight: number

        Canvas height in CSS pixels.

      • lng: number

        Longitude in degrees.

      • lat: number

        Latitude in degrees.

      • height: number

        Metres above the rendered ground datum (mercator z=0).

      Returns [number, number] | null

      [x, y] in CSS pixels (top-left origin), or null when behind the camera.