From c99c577b3edec85d8f6500e604d2d1d94e0732b0 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 14 Nov 2026 01:55:35 -0800 Subject: [PATCH] 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. --- src/data/trailRenderer.js | 10 ++++++++-- src/scenes/dataPacks/presentation.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/data/trailRenderer.js b/src/data/trailRenderer.js index 9d40da95e..fe1590038 100644 --- a/src/data/trailRenderer.js +++ b/src/data/trailRenderer.js @@ -61,8 +61,14 @@ function joinDoubleClick(viewer, setId, lineFor) { let shared = doubleClicks.get(viewer); if (!shared) { const lines = new Map(); - // A scene that takes no input has no double-click. - const input = findInput(viewer); + // A scene that takes no input (or a headless one, with no page to take + // it from) has no double-click. + let input = null; + try { + input = findInput(viewer); + } catch { + input = null; + } shared = { lines, follow: input diff --git a/src/scenes/dataPacks/presentation.js b/src/scenes/dataPacks/presentation.js index 17e588493..be60d1ac8 100644 --- a/src/scenes/dataPacks/presentation.js +++ b/src/scenes/dataPacks/presentation.js @@ -78,8 +78,14 @@ export function createPackPresentations( function followPoints(setId, items) { pointSets.set(setId, new Map(items.map((item) => [item.id, item]))); if (stockFollow) return; - // A scene that takes no input has no double-click. - const input = findInput(viewer); + // A scene that takes no input (or a headless one, with no page to take + // it from) has no double-click. + let input = null; + try { + input = findInput(viewer); + } catch { + input = null; + } if (!input) return; stockFollow = followOnDoubleClick({ viewer,