map

map.latLngToScreen

latLngToScreen(lat: number, lng: number): object

Convert lat/lng to screen pixel coordinates { x, y } in the canvas.

Steps:

  1. Convert lat/lng → world position via latLngToWorld.
  2. Apply cloudScene's world transform so position is in scene world space.
  3. Project through the camera using Vector3.project(camera) → NDC.
  4. Convert NDC → pixel: x = (ndc.x + 1) / 2 * width, y = (1 - ndc.y) / 2 * height.

Returns null when map is disabled or scene/camera are not wired.

latnumber
lngnumber

Returns: object