fix(trails, data-packs): a scene with no page to take input from draws without a double-click

The double-click follow asked for the scene's input when a set was first
drawn. On a headless scene Cesium's event handler needs a document, so
drawing a trail or a pack threw there. Asking is guarded, as Directions
does: a scene that cannot take input has no double-click.
This commit is contained in:
Sameh Khamis committed 2026-11-14 01:55:35 -08:00
1 parent 4f24b9a062
commit c99c577b3e
2 files changed
+16 -4

No files matched your search

+8 -2
View File
@@ -61,8 +61,14 @@ function joinDoubleClick(viewer, setId, lineFor) {
let shared = doubleClicks.get(viewer); let shared = doubleClicks.get(viewer);
if (!shared) { if (!shared) {
const lines = new Map(); const lines = new Map();
// A scene that takes no input has no double-click. // A scene that takes no input (or a headless one, with no page to take
const input = findInput(viewer); // it from) has no double-click.
let input = null;
try {
input = findInput(viewer);
} catch {
input = null;
}
shared = { shared = {
lines, lines,
follow: input follow: input
+8 -2
View File
@@ -78,8 +78,14 @@ export function createPackPresentations(
function followPoints(setId, items) { function followPoints(setId, items) {
pointSets.set(setId, new Map(items.map((item) => [item.id, item]))); pointSets.set(setId, new Map(items.map((item) => [item.id, item])));
if (stockFollow) return; if (stockFollow) return;
// A scene that takes no input has no double-click. // A scene that takes no input (or a headless one, with no page to take
const input = findInput(viewer); // it from) has no double-click.
let input = null;
try {
input = findInput(viewer);
} catch {
input = null;
}
if (!input) return; if (!input) return;
stockFollow = followOnDoubleClick({ stockFollow = followOnDoubleClick({
viewer, viewer,