phase 6: interaction polish + readability fixes
- fix ships status: registered the HUD row before setStatus (setStatus no-ops on an unregistered row, so the vessel count was silently dropped) - declutter: drop the 6 stacked Fujairah idle labels (InfoBox still IDs them), fade ship + event labels at the global overview (translucencyByDistance) - separate the two co-located event markers so their labels stop colliding - verified live: 97 sats, 6300+ aircraft w/ quota, 12 vessels, scrub-gating (chip flips to SCRUBBED + aircraft hide), Data+Photo basemaps Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6c7b945848
commit
960dcd0e69
@ -22,8 +22,9 @@ export default function create(ctx) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Recon satellite pass correlation [DEMO]',
|
name: 'Recon satellite pass correlation [DEMO]',
|
||||||
lon: 51.4, lat: 32.6, offsetHours: -2,
|
// Offset from the strike site so the two markers/labels don't collide.
|
||||||
blurb: 'Simulated correlation of a recon satellite pass with the site above (approx coords).',
|
lon: 52.0, lat: 32.95, offsetHours: -2,
|
||||||
|
blurb: 'Simulated correlation of a recon satellite pass with the strike site to the southwest (approx coords).',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Tanker incident [DEMO]',
|
name: 'Tanker incident [DEMO]',
|
||||||
@ -62,13 +63,15 @@ export default function create(ctx) {
|
|||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
text: m.name,
|
text: m.name,
|
||||||
font: '12px sans-serif',
|
font: '11px sans-serif',
|
||||||
fillColor: Cesium.Color.WHITE,
|
fillColor: Cesium.Color.WHITE,
|
||||||
outlineColor: Cesium.Color.BLACK,
|
outlineColor: Cesium.Color.BLACK,
|
||||||
outlineWidth: 3,
|
outlineWidth: 3,
|
||||||
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||||
pixelOffset: new Cesium.Cartesian2(0, -14),
|
pixelOffset: new Cesium.Cartesian2(0, -14),
|
||||||
|
// Declutter at the global overview; sharpen when zoomed into the theater.
|
||||||
|
translucencyByDistance: new Cesium.NearFarScalar(2.0e6, 1.0, 8.0e6, 0.0),
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -40,6 +40,9 @@ export default function create(ctx) {
|
|||||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||||
pixelOffset: new Cesium.Cartesian2(0, -14),
|
pixelOffset: new Cesium.Cartesian2(0, -14),
|
||||||
scale: 0.9,
|
scale: 0.9,
|
||||||
|
// Fade labels out at the global overview so the dense strait declutters;
|
||||||
|
// they sharpen as you zoom into the theater.
|
||||||
|
translucencyByDistance: new Cesium.NearFarScalar(1.5e6, 1.0, 6.0e6, 0.0),
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
...extra,
|
...extra,
|
||||||
});
|
});
|
||||||
@ -73,6 +76,19 @@ export default function create(ctx) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- HUD toggle ----
|
||||||
|
// Registered BEFORE the fleet is built so the later ui.setStatus('ships', …)
|
||||||
|
// lands on an existing row (setStatus no-ops if the row isn't registered yet).
|
||||||
|
// The callback controls whichever fleet is on screen: the demo fleet, or the
|
||||||
|
// live-AIS fleet once it takes over (tracked by liveActive) — so it never
|
||||||
|
// resurrects the hidden demo fleet on top of live vessels.
|
||||||
|
let aisDS = null;
|
||||||
|
let liveActive = false;
|
||||||
|
ui.addLayer('ships', 'Ships [DEMO]', true, (on) => {
|
||||||
|
if (liveActive) { if (aisDS) aisDS.show = on; }
|
||||||
|
else { shipsDS.show = on; }
|
||||||
|
});
|
||||||
|
|
||||||
let vessels = 0;
|
let vessels = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -151,7 +167,8 @@ export default function create(ctx) {
|
|||||||
scale: 0.85,
|
scale: 0.85,
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
label: labelGraphic({ text: `IDLE ${i + 1} [DEMO]`, scale: 0.75 }),
|
// No label — six identical anchored tankers would just stack. The
|
||||||
|
// vessel is still identified via its InfoBox on click.
|
||||||
description: describe('Various', 'Tanker at anchor', '0.0 kn',
|
description: describe('Various', 'Tanker at anchor', '0.0 kn',
|
||||||
'Idle at Fujairah anchorage ("floating parking lot").'),
|
'Idle at Fujairah anchorage ("floating parking lot").'),
|
||||||
});
|
});
|
||||||
@ -164,17 +181,6 @@ export default function create(ctx) {
|
|||||||
ui.setStatus('ships', 'demo fleet error', 'err');
|
ui.setStatus('ships', 'demo fleet error', 'err');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- HUD toggle ----
|
|
||||||
// Controls whichever fleet is actually on screen: the demo fleet, or the live
|
|
||||||
// AIS fleet once it takes over. Must not resurrect the hidden demo fleet on top
|
|
||||||
// of live vessels, so it follows liveActive rather than always poking shipsDS.
|
|
||||||
let aisDS = null;
|
|
||||||
let liveActive = false;
|
|
||||||
ui.addLayer('ships', 'Ships [DEMO]', true, (on) => {
|
|
||||||
if (liveActive) { if (aisDS) aisDS.show = on; }
|
|
||||||
else { shipsDS.show = on; }
|
|
||||||
});
|
|
||||||
|
|
||||||
// ---- Optional live AIS (guarded, default off) ----
|
// ---- Optional live AIS (guarded, default off) ----
|
||||||
// Only attempts a socket if a key is configured. On the first position report
|
// Only attempts a socket if a key is configured. On the first position report
|
||||||
// the demo fleet is hidden in favor of live vessels. Never blocks init.
|
// the demo fleet is hidden in favor of live vessels. Never blocks init.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user