Globe scale measurement
Consumers provide the scale-bar UI. map.sqs.scaleAt supports the globe and returns local spherical metres per horizontal screen pixel with a1/2/5 distance suitable for a bar.
map.setProjection({ type: 'globe' });
await map.sqs.flush();
const scale = await map.sqs.scaleAt({ maxWidth: 100 });
console.log(scale.distance, scale.width, scale.metersPerPixel);
Point uses logical/CSS pixels, default viewport center. MaxWidth must be positive and no greater than viewport width or10000. Projection is globe, unit is m, pixelUnit is css, model is sphere-local and approximate is true. Fields retain the planar meaning; queries do not move the camera, submit writes or emit move. Both poles have finite local horizontal scale. Sky/tangent positions without spherical intersections fail explicitly.
The calculation uses physical spherical rays and local great-circle samples with radius6371008.8m. It is a local approximation, not a guarantee that a whole long bar remains exact across the horizon. Density changes do not alter logical units. Re-query on camera/projection/viewport events. Raw SDK callers use view.scaleAt; native libraries send sqs.scaleAt through sqsm_map_camera_json. C ABI remains unchanged.