Draw the ALPR layer's markers through the renderer's ports

The ALPR badges were Cesium entities whose billboards the layer changed in
place: the canvas overlay swapped a badge to a faint pick target at its
anchor, selection swapped the image, and unresolved floors clamped to the
ground. They are now one icon set from the draw port, updated in place
through upsert, so selection and the overlay swap change the same
billboard without a rebuild or a blink. Badges keep their scale by
distance, ground clamping and depth-test settings.

Marker state lives in the app (markerState.js): a plain carrier per camera,
registered as the camera's context entity, and a marker set that batches
changes and sends only the icons that draw differently. Clicks on native
badges come from the dispatcher's draw hit. Projection, the on-screen
count, height samples (excluding the layer's own set), the screen-centre
ellipsoid pick and the camera reach the renderer through the query,
camera and frame ports. A resync of the overlay now hands back only the
cameras that leave it, so kept ones are not written twice.

index.js, overlay.js and presentation.js leave the Cesium allow-list; the
layer's entry is Cesium-free, and a caller's own viewer loads the
unbound factories.

Differences the contract does not let us avoid:
- Double-clicking a badge no longer starts the viewer's entity follow,
  since draw items are not entities.
- The terrain fallback for anchors is no longer skipped while the globe
  is hidden: the globe port has no visibility getter.
- Without depth support the query port answers no heights, terrain
  included, so anchors wait for a cached floor there.
- On a viewer with no renderer bound, the surface counts as settled
  when anchors are refined.
This commit is contained in:
Sameh Khamis committed 2026-11-06 23:28:43 -08:00
1 parent faded8a418
commit 2592289612
11 files changed
+722 -537

No files matched your search

-3
View File
@@ -40,9 +40,6 @@
"src/input/dispatcher.js",
"src/input/sensorPick.js",
"src/layers/airQuality/index.js",
"src/layers/alpr/index.js",
"src/layers/alpr/overlay.js",
"src/layers/alpr/presentation.js",
"src/layers/cctv/cards.js",
"src/layers/cctv/geometry.js",
"src/layers/cctv/geometryQueue.js",