map.screenToLatLng
screenToLatLng(screenX: number, screenY: number): GeoPositionConvert screen pixel coordinates to a geographic position.
Steps (planar):
- Convert pixel → NDC.
- Unproject a ray from the camera.
- Intersect the ray with the map plane (z=0 in cloudScene local space).
- Apply inverse cloudScene transform to get cloudScene-local coords.
- Convert to lat/lng via
worldToLatLng.
Steps (spherical): 1-2 as above. 3. Intersect the ray with the globe sphere (radius = EARTH_RADIUS, scale=1). 4-5 as above.
Returns null when map is disabled, scene/camera are not wired, or the
ray misses the map surface.
screenX | number | |
screenY | number |
Returns: GeoPosition