Files
gods-eye-view/src/data/spriteOrder.js
T
Sameh Khamis e3865f462f Merge origin/main into the renderer-contract branch: the procedural fleet models drawn through the renderer's model sets
Aircraft, military, local ADS-B, vessel, transit and rail models come from
the fleet model set, loaded up front and drawn life size through the draw
port's models sets; no layer touches the viewer or Cesium outside
src/render/cesium/. The models capability gains glTF bytes (gltf), a
per-axis stretch (axisScale), a colour for tinted parts (maskColor) and a
cut below the origin (clip: 'belowOrigin'), with conformance checks.

Main's rail layer and Data Library are ported to the ports; the CCTV
footprint probe keeps the globe-terrain clamp through the query port.
2026-11-13 14:14:42 -08:00

32 lines
1.0 KiB
JavaScript

/** Bottom-to-top order of the sprite layers' icon and dot sets. */
export const SPRITE_LAYER_ORDER = Object.freeze([
'shipwrecks',
'cctv',
'firms',
'wildlife-sightings',
'bikeshare',
'transit',
'transit-motion',
'rail',
'directions',
'ais',
'military',
'flights',
]);
/**
* The draw order (`SetSpec.drawOrder`) a sprite layer's set is made with:
* its place in `SPRITE_LAYER_ORDER`, counted back from -1 for flights, so
* flights draw over every other sprite layer and the rest follow the list,
* whichever layer was turned on first. Every set at the default order, 0
* (selection highlights, route endpoints, the tracked plane and the other
* overlays), stays over all of them, as it did when the sprite sets were
* raised to the bottom of the scene. A key not in the list gets 0.
* @param {string} layerId - Stable sprite-order layer key.
* @returns {number}
*/
export function spriteDrawOrder(layerId) {
const index = SPRITE_LAYER_ORDER.indexOf(layerId);
return index < 0 ? 0 : index - SPRITE_LAYER_ORDER.length;
}