Draw the installations layer through the renderer ports

The site dots, outlines and selected footprint fill are now draw-port sets
(points, draped lines, clamped shapes) instead of Cesium entities. The
selected site's dot is drawn by a set of its own, so selecting a site
redraws no other dot. Selection is registered through plain carrier
objects in the context store, as the local GeoJSON layer does, and the
tracked card reads the site's label and position from the carrier's entity
record.

A double-click on a site dot now follows it through camera.follow (gated on
the stock double-click follow), centred on the surface under the dot when
its height is loaded; one on an outline or fill zooms to it. Hiding the
layer stops a follow it started. The layer no longer lowers the shared
camera change sensitivity: its own camera-port listener carries its
threshold.

The follow offset fitting moves to src/geo/frames.js and is shared with
the local GeoJSON layer. rendering.js leaves the Cesium allow-list
(33 -> 32); the layer's entry joins DRAW_FROM_CALLER.
This commit is contained in:
Sameh Khamis committed 2026-11-08 12:13:29 -08:00
1 parent a59f9b10b2
commit 1bff078097
21 files changed
+864 -337

No files matched your search

+2 -3
View File
@@ -2215,7 +2215,8 @@
"src/render/color.js",
"src/layers/installations/policy.js",
"src/layers/installations/rendering.js",
"src/layers/installations/markerState.js",
"src/geo/sphere.js",
"src/data/followed.js",
"src/layers/installations/selection.js",
"src/layers/installations/source.js",
"src/layers/installations/state.js",
@@ -3520,7 +3521,6 @@
"src/layers/installations/model.js",
"src/layers/installations/policy.js",
"src/layers/installations/rendering.js",
"src/layers/installations/markerState.js",
"src/layers/installations/selection.js",
"src/layers/installations/source.js",
"src/layers/installations/state.js",
@@ -4485,7 +4485,6 @@
"src/layers/installations/model.js",
"src/layers/installations/policy.js",
"src/layers/installations/rendering.js",
"src/layers/installations/markerState.js",
"src/layers/installations/selection.js",
"src/layers/installations/source.js",
"src/layers/installations/state.js",
+31 -14
View File
@@ -40,9 +40,29 @@ try {
page.on('console', (m) => {
if (m.type() === 'error') result.errors.push(m.text());
});
await page.evaluateOnNewDocument(() =>
sessionStorage.setItem('gev:first-run-mission-session:v1', 'dismissed'),
);
await page.evaluateOnNewDocument(() => {
sessionStorage.setItem('gev:first-run-mission-session:v1', 'dismissed');
// The site dots the layer draws, read from its draw-port point set: each
// row is a drawn dot whose pick id is the draw port's `{set, id, meta}`;
// `meta` is the site's carrier, kept while the site's geometry is.
window.__qaInstallationDots = () => {
const out = [];
const visit = (node) => {
if (!node || typeof node.get !== 'function') return;
if (typeof node.length !== 'number') return;
for (let index = 0; index < node.length; index += 1) {
const child = node.get(index);
const id = child?.id;
if (id && typeof id === 'object' && typeof id.set === 'string') {
if (/^military-installations:\d+:dots$/.test(id.set))
out.push({ id: id.id, meta: id.meta, primitive: child });
} else visit(child);
}
};
visit(window.__godsEyeView.viewer.scene.primitives);
return out;
};
});
await page.goto(
args.find((a) => /^https?:/.test(a)),
{ waitUntil: 'domcontentloaded' },
@@ -156,14 +176,15 @@ try {
.catch(() => {});
const snapshot = await page.evaluate(() => {
const g = window.__godsEyeView;
const ds = g.viewer.dataSources.getByName('military-installations')[0];
const points = ds.entities.values.filter((e) => e.point);
const points = window.__qaInstallationDots();
const stable = points.every(
(e) =>
!window.installationEntityRefs.has(e.id) ||
window.installationEntityRefs.get(e.id) === e,
window.installationEntityRefs.get(e.id) === e.meta,
);
window.installationEntityRefs = new Map(
points.map((e) => [e.id, e.meta]),
);
window.installationEntityRefs = new Map(points.map((e) => [e.id, e]));
return {
...g.dataManager.layers
.get('military-installations')
@@ -186,7 +207,7 @@ try {
new Set(row.ids).size !== row.ids.length
)
result.failures.push(
`${name}/${height}: unstable or duplicate site entities`,
`${name}/${height}: unstable or duplicate site markers`,
);
if (name.endsWith('return')) {
const first = result.views.find(
@@ -244,10 +265,7 @@ try {
0.6,
);
await page.waitForFunction(
() =>
window.__godsEyeView.viewer.dataSources
.getByName('military-installations')[0]
.entities.values.some((e) => e.point),
() => window.__qaInstallationDots().length > 0,
{ timeout: 5000 },
);
await page.evaluate(() => {
@@ -268,8 +286,7 @@ try {
await sleep(1000);
await page.evaluate(async () => {
const g = window.__godsEyeView;
const ds = g.viewer.dataSources.getByName('military-installations')[0];
const id = ds.entities.values.find((e) => e.point).id;
const id = window.__qaInstallationDots()[0].id;
window.installationSubjectId = id;
await g.dataManager.layers
.get('military-awareness')
+38 -30
View File
@@ -177,18 +177,13 @@ export async function checkInstallationSelection(
await import('/src/data/contextStore.js');
const { getOverlayPaintRect, getWorldOverlayDiagnostics } =
await import('/src/overlays/worldOverlay.js');
const knownFills = new Set();
const fillEntities = () => {
const list = [];
for (let i = 0; i < g.viewer.dataSources.length; i++)
for (const e of g.viewer.dataSources.get(i).entities.values)
if (e.id.startsWith(`${record.id}:selected-fill:`)) list.push(e);
for (const e of list) knownFills.add(e);
return list;
};
// Geometry-instance ids prove the ground primitive actually built, not just an entity declaration.
const primitives = () => {
let count = 0;
// The selected site's fill parts, as the ground primitives built for
// the layer's fill set hold them: each instance's id is the
// draw port's pick id `{set, id}`. Only built, shown instances count,
// so this proves the ground primitive actually built, not just an
// item declaration.
const fillParts = () => {
const parts = [];
const walk = (collection) => {
if (collection?._collectionsArray) {
for (const child of collection._collectionsArray) walk(child);
@@ -196,31 +191,44 @@ export async function checkInstallationSelection(
}
for (let i = 0; i < (collection?.length || 0); i++) {
const p = collection.get(i);
if (
p.ready &&
typeof p.getGeometryInstanceAttributes === 'function'
) {
for (const e of knownFills) {
const ids = p?._primitive?._primitive?._instanceIds;
if (p?.ready && Array.isArray(ids))
for (const id of ids) {
if (
!/^military-installations:\d+:fills$/.test(id?.set) ||
!String(id.id).startsWith(`${record.id}:selected-fill:`)
)
continue;
try {
const a = p.getGeometryInstanceAttributes(e);
if (a && (!a.show || a.show[0])) count++;
const a = p.getGeometryInstanceAttributes(id);
if (a && (!a.show || a.show[0]))
parts.push({
id: id.id,
classification: p.classificationType,
});
} catch {}
}
}
if (typeof p.get === 'function' || p._collectionsArray) walk(p);
if (typeof p?.get === 'function' || p?._collectionsArray)
walk(p);
}
};
// The draw port adds its ground primitives under the scene's
// primitives, in its set's collection.
walk(g.viewer.scene.groundPrimitives);
return count;
walk(g.viewer.scene.primitives);
return parts;
};
window.__polishFillProbe = () => {
const parts = fillParts();
return {
// Distinct fill parts drawn, and the built instances drawing them
// (a ground swap can draw a part twice while it lasts).
entities: new Set(parts.map((part) => part.id)).size,
primitives: parts.length,
classification: parts.map((part) => part.classification),
selected: getSelectedEntityContext()?.id || null,
};
};
window.__polishFillProbe = () => ({
entities: fillEntities().length,
primitives: primitives(),
classification: fillEntities().map((e) =>
e.polygon.classificationType.getValue(),
),
selected: getSelectedEntityContext()?.id || null,
});
window.__stopPolishSelection =
g.viewer.scene.postRender.addEventListener(() => {
window.__polishSelectionFrames.push({