Draw live AIS vessels from a GPU icon set

This commit is contained in:
Sameh Khamis committed 2026-11-03 21:16:19 -08:00
1 parent 816002e3b9
commit e0eb771217
20 files changed
+340 -318

No files matched your search

+5 -8
View File
@@ -19,11 +19,10 @@ const _owners = new Map();
/**
* Resolves a scene.pick() result to a String pick id for the ownership scan.
*
* Layers use heterogeneous pick ids: flights/military/bikeshare/CCTV use
* strings, satellites use numeric NORAD catalog ids, live AIS vessels attach
* the vessel record OBJECT (identity = its `mmsi`), and entity picks surface
* the Cesium Entity (identity = its string `id`). Everything is coerced to a
* String so predicates match against one canonical form.
* Layers use heterogeneous pick ids: flights/military/vessels/bikeshare/CCTV
* use strings, satellites use numeric NORAD catalog ids, and entity picks
* surface the Cesium Entity (identity = its string `id`). Everything is
* coerced to a String so predicates match against one canonical form.
*
* @param {object|null|undefined} picked - Result of `scene.pick()`.
* @returns {string|null} Canonical pick id, or null when the pick carries none.
@@ -33,9 +32,7 @@ export function resolvePickId(picked) {
const unwrap = (id) => {
if (id === null || id === undefined) return undefined;
if (typeof id === 'object') {
// AIS vessel record (id object with .mmsi) or Cesium Entity (.id string)
if (typeof id.mmsi === 'string' || typeof id.mmsi === 'number')
return id.mmsi;
// A Cesium Entity (.id string)
if (typeof id.id === 'string' || typeof id.id === 'number') return id.id;
return undefined;
}