mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Draw the vessels layer's ships through the renderer's ports
The ships are one icon set from the draw port, held on course with hold motion segments and drawn over depth as before; the layer keeps what it last drew in an icon book and reads focus and pick ownership back from there, matching clicks on the draw hit's set and id. Its frame hook, camera pose, horizon test and screen projection come from the frame, camera and query ports, with the horizon lift in geo/horizon judging the same point the GPU cull does. The icons' draw set is disposed when the layer is destroyed. rendering.js no longer imports Cesium or touches the scene's primitives, picks, render events or camera, and leaves the Cesium allow-list. It still reads the canvas size for the label budget. Callers of the vessels entry load the Cesium adapter's unbound fallbacks.
This commit is contained in:
1 parent
bb85e0fa74
commit
f6422d2247
16 files changed
+394
-190
No files matched your search
@@ -27,15 +27,17 @@ export function createSelection({
|
||||
function bindVesselInteraction(viewer, keyTarget) {
|
||||
state.clickSubscription = inputFor(viewer).onClick((event) => {
|
||||
if (!state.feed.enabled) return;
|
||||
const picked = event.hit;
|
||||
const pickedId = event.id;
|
||||
let record = pickedId ? state.records.byMmsi.get(pickedId) : null;
|
||||
// A vessel icon's pick id is its row id: the MMSI, or an unkeyed row's.
|
||||
// Removing a row destroys its pick id, so an evicted vessel cannot be
|
||||
// picked at all; a live row whose record is gone stays a no-op below.
|
||||
const rawId = picked?.id;
|
||||
// A vessel icon's pick is an item of the layer's icon set, whose id is
|
||||
// its row id: the MMSI, or an unkeyed row's. Removing a row removes its
|
||||
// item, so an evicted vessel cannot be picked at all; a live row whose
|
||||
// record is gone stays a no-op below.
|
||||
const hit = event.drawHit;
|
||||
const ownRecordPick =
|
||||
typeof rawId === 'string' && state.icons?.has(rawId) === true;
|
||||
Boolean(hit) &&
|
||||
hit.set === state.icons?.setId &&
|
||||
state.icons.has(hit.id) === true;
|
||||
|
||||
// An own-layer row without a live map key is a strict no-op (FB-1
|
||||
// residual). Trails carry no layer identity and hug their contacts, so any
|
||||
|
||||
Reference in new issue
Block a user