Keep cable pick info and the prewarm flag off Cesium objects

Submarine cables wrote each pick's info both to a per-load WeakMap and to a
__gevTeleGeography expando, always together; one cablePicks store replaces
both and resolves the same objects. The voice view-target prewarm marks its
viewer in a WeakSet instead of a __gevViewTargetPrewarmInstalled property.
This commit is contained in:
Sameh Khamis committed 2026-11-03 10:01:12 -08:00
1 parent 04a70d59e9
commit 7ebc73393a
9 files changed
+31 -23

No files matched your search

-1
View File
@@ -142,7 +142,6 @@ export function createIngestion({ state, parts, source }) {
const cableEntities = state._cableDataSource.entities.values;
const landingEntities = state._landingDataSource.entities.values;
state._pickByEntity = new WeakMap();
state._referenceRecords = [];
state._surfaceRecords = [];
+4 -6
View File
@@ -1,10 +1,10 @@
import * as Cesium from 'cesium';
import { isPointerFree } from '../../data/inputOwnership.js';
import { cablePicks } from './pickState.js';
export function createInteraction({ state, screenSpaceEventHandlerFactory }) {
function registerPickEntity(entity, info) {
entity.__gevTeleGeography = info;
state._pickByEntity.set(entity, info);
cablePicks.write(entity).info = info;
}
function beginInteraction(viewer) {
@@ -25,9 +25,8 @@ export function createInteraction({ state, screenSpaceEventHandlerFactory }) {
if (!picked) return null;
const primitive = picked.primitive;
if (primitive) {
const primitiveInfo = state._pickByEntity.get(primitive);
const primitiveInfo = cablePicks.read(primitive)?.info;
if (primitiveInfo) return primitiveInfo;
if (primitive.__gevTeleGeography) return primitive.__gevTeleGeography;
if (
primitive.id &&
typeof primitive.id === 'object' &&
@@ -39,9 +38,8 @@ export function createInteraction({ state, screenSpaceEventHandlerFactory }) {
const entity = picked.id;
if (entity) {
const entityInfo = state._pickByEntity.get(entity);
const entityInfo = cablePicks.read(entity)?.info;
if (entityInfo) return entityInfo;
if (entity.__gevTeleGeography) return entity.__gevTeleGeography;
if (entity.id && typeof entity.id === 'object' && entity.id.reference) {
return entity.id;
}
-1
View File
@@ -133,7 +133,6 @@ export function createLifecycle({ state, parts, source, mapStackEventTarget }) {
state._referenceDataSource = null;
state._referenceRecords = [];
state._surfaceRecords = [];
state._pickByEntity = new WeakMap();
state._referenceLabelCount = 0;
state._publishScratch.length = 0;
state._markerBlendDone = false;
+7
View File
@@ -0,0 +1,7 @@
import { createEntityStore } from '../../data/entityRecords.js';
/**
* The reference a picked cable, landing point or reference marker flies to:
* `info` is `{ label, kind, featureId, reference: { lon, lat } }`.
*/
export const cablePicks = createEntityStore();
+2 -3
View File
@@ -10,6 +10,7 @@ import {
selectCableReferenceLabelWinners,
cableReferencePriority,
} from './overlay.js';
import { cablePicks } from './pickState.js';
export function createRendering({ state }) {
function resetPublishSignature() {
@@ -40,7 +41,6 @@ export function createRendering({ state }) {
state._referenceDataSource = null;
state._referenceRecords = [];
state._surfaceRecords = [];
state._pickByEntity = new WeakMap();
state._referenceLabelCount = 0;
state._publishScratch.length = 0;
// The blend pass targets the collections being dropped; the rebuilt
@@ -180,8 +180,7 @@ export function createRendering({ state }) {
},
});
entity.__gevTeleGeography = info;
state._pickByEntity.set(entity, info);
cablePicks.write(entity).info = info;
const record = {
id: entity.id,
entity,
-2
View File
@@ -69,8 +69,6 @@ export function createState({ sweepClock, overlayHost }) {
state._markerBlendInvariantWarned = false;
state._pickByEntity = new WeakMap();
state._referenceLabelCount = 0;
state._referenceSweepGate = createCableReferenceSweepGate({