Draw submarine cables through the renderer's draw and camera ports

Cable lines, landing pins, polygon fills, reference stems and reference
points are now five draw sets per layer (submarine-cables:N:lines and so
on) instead of GeoJSON data sources and entities. Clicks resolve through
the draw hit; flights and the sweep's eye go through the camera port.
The layer keeps the styling the GeoJSON loader gave it: cable colours,
widths and alphas, simplestyle stroke, fill and marker properties, fills
that keep the source's alpha, raised polygons at their heights, the
default pin image, and features without a reference drawn but neither
picked nor culled. Lines are densified along rhumb lines at the
renderer's own granularity, so the draped geodesic arcs land on the same
vertices the rhumb-line polylines did.

Supporting pieces:
- geo/rhumb, geo/horizon and geo/geodesic port the default renderer's
  rhumb line, ellipsoidal occluder and Vincenty inverse; the stub
  renderer now uses the shared horizon test and Vincenty inverse
  instead of its own copies. render/color gains cssColor, which reads
  CSS colours as the renderer does (hex, rgb, hsl; not named colours).
- The Cesium draw port changes a line in place when only whether it
  shows changes (draped, on its ground primitive, waiting for it to be
  ready rather than restarting its build) or where an undraped line
  runs; anything else still rebuilds. Icon sets honour their blend.

Ingestion, interaction, overlay, policy, rendering, state and surface no
longer import Cesium and leave the allow-list. Pins are culled at the
horizon each frame by the draw port instead of on the sweep, and
marker-symbol glyphs are not drawn inside pins.
This commit is contained in:
Sameh Khamis committed 2026-11-06 22:10:53 -08:00
1 parent f24b66d80d
commit e74c7c1f44
29 files changed
+2260 -2064

No files matched your search

+24 -22
View File
@@ -1,4 +1,3 @@
import * as Cesium from 'cesium';
import {
createCableReferenceSweepGate,
createCableOverlayPublisher,
@@ -30,17 +29,30 @@ export function createState({ sweepClock, overlayHost }) {
state._loadGeneration = 0;
state._cableDataSource = null;
/**
* The layer's draw sets, made at init: cable and landing lines (draped),
* pins (landing points), fills (polygons), stems and reference points.
*/
state._landingDataSource = null;
state._sets = null;
state._referenceDataSource = null;
/** Set ids this layer made, for matching picks. */
state._setIds = new Set();
/** What each drawn item is, by set id then item id (picks fly to it). */
state._picks = new Map();
/** Drawn surface items, culled by their feature's reference each sweep. */
state._surfaceItems = [];
/**
* Fetched cable/landing JSON kept across disable/enable. A disable RELEASES
* the three data sources (see releaseDataSources) instead of hiding them,
* so a re-enable has to rebuild the entities; the network/parse half of
* that rebuild is the expensive part users would notice, so it is cached.
* Fetched cable/landing JSON kept across disable/enable. A disable CLEARS
* the draw sets (see releaseDrawing) instead of hiding them, so a
* re-enable has to rebuild the items; the network/parse half of that
* rebuild is the expensive part users would notice, so it is cached.
*/
state._cachedCableJson = null;
@@ -49,8 +61,6 @@ export function createState({ sweepClock, overlayHost }) {
state._referenceRecords = [];
state._surfaceRecords = [];
state._clickSubscription = null;
state._preRenderRemover = null;
@@ -59,15 +69,9 @@ export function createState({ sweepClock, overlayHost }) {
state._mapStackListener = null;
/** Active ground-line classification; refined from live scene state at init. */
/** What ground lines drape on; refined from live scene state at init. */
state._classificationType = Cesium.ClassificationType.BOTH;
/** True once both marker collections blend translucent (or the shape probe failed). */
state._markerBlendDone = false;
state._markerBlendInvariantWarned = false;
state._clampTo = 'both';
state._referenceLabelCount = 0;
@@ -96,10 +100,8 @@ export function createState({ sweepClock, overlayHost }) {
state._lastPublishedCount = -1;
state.cableColor = Cesium.Color.fromCssColorString(BASE_CABLE_COLOR);
state.cableColor = BASE_CABLE_COLOR;
state.cableOutline = Cesium.Color.BLACK.withAlpha(0.45);
state.landingColor = Cesium.Color.fromCssColorString(BASE_LANDING_COLOR);
state.landingColor = BASE_LANDING_COLOR;
return state;
}