Never act on what lies under a mission label when it is clicked

A click on a Space Missions label reaches every click subscriber so they can
let go of their selection, but the layers that test their own painted cards
or pick the scene themselves still found what lay under the label: CCTV
turned that camera on, FIRMS and Vessels selected and flew to theirs, News
and Wildlife Sightings opened their item, Perimeters, Ghost Maps and
Shipwrecks opened the card's link, ALPR selected its reader, and Local ADS-B
drilled the scene itself and selected the aircraft. Each now skips its own
test on such a click, and Local ADS-B drills through the click, so the click
only releases selections, as a click on empty map or another layer's
contact does. Ordinary clicks behave as before.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 17:05:43 -08:00
1 parent 8675ead171
commit 5feac417d6
22 files changed
+453 -72

No files matched your search

+3 -1
View File
@@ -184,7 +184,9 @@ function topHitOf(hit, foreign) {
* engine's pick objects that reads it here.
* @property {boolean} overlay Whether a painted overlay target took the
* click ({@link InputDispatcher.onOverlayClick}). Its hits then name only
* that target: something drawn outside the draw port, with no id.
* that target: something drawn outside the draw port, with no id. A
* subscriber with its own hit test (painted cards, a pick of its own)
* skips it then: what lies under the target is not clicked.
* @property {(width: number, height: number) => unknown} pickWindow
* `native.pickWindow`, the same.
*/
+15
View File
@@ -140,3 +140,18 @@ export function fakeInput(viewer, { now } = {}) {
destroy: () => input.destroy(),
};
}
/**
* `fakeInput` with a label painted over the map, as a Space Missions label
* is: while `label.over` is true the label takes each click, so every click
* subscriber hears it as an overlay click (`event.overlay`), and the
* geometry beneath it is not picked.
* @param {object} viewer
* @param {{now?: () => number}} [options]
*/
export function fakeInputUnderLabel(viewer, options) {
const fake = fakeInput(viewer, options);
const label = { over: false };
fake.input.onOverlayClick(() => label.over);
return { ...fake, label };
}