map

map.groundKmToWorld

groundKmToWorld(km: number, latitudeDeg: number): number

Convert a true ground distance (km) at a given latitude into world/scene units, matching how node positions are placed.

PLANAR: node positions are Mercator meters × mapScale. Web Mercator inflates ground distance by 1/cos(lat); we divide by cos(lat) so a circle of this radius covers the correct ground area on the basemap. With no map active, mapScale is the default-provider scale (1).

SPHERICAL: the globe is a true sphere, so a coverage wedge drapes on the tangent plane with NO Mercator inflation — the conversion is plain arc length. globeRadius scene units span EARTH_RADIUS meters around the globe, so world-units-per-meter = globeRadius / EARTH_RADIUS and there is no cos(lat) term. Using the planar formula on the globe oversizes every wedge by 1/cos(lat).

kmnumber
latitudeDegnumber

Returns: number