mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
4f24b9a062
commit
c99c577b3e
2 files changed
+16
-4
No files matched your search
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in new issue
Block a user