mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
fix(recent-imagery): refresh when availability removes drape
This commit is contained in:
1 parent
9924cb15eb
commit
eeda6d51d1
5 files changed
+13
-15
No files matched your search
@@ -2,7 +2,7 @@
|
||||
into a box about 360° wide and refused as too large; it is now the short box
|
||||
across ±180°, which lists the days for that box and drapes a pinned day on
|
||||
both sides. Availability probes both sides of ±180° (a day counts as present when either
|
||||
side has data, and only the sides the probe proved present are draped — a
|
||||
side has data, and sides confirmed empty are not draped — a
|
||||
side confirmed empty never lands on the map), each side is bounded by its
|
||||
own deadline and both sides' answers are heard — sides proven present all
|
||||
drape, a side that stalls only bounds the day for its deadline instead of
|
||||
|
||||
@@ -549,9 +549,7 @@ export function createRecentImageryLayer({
|
||||
: (slotId === 'a') !== _swapped
|
||||
? 'left'
|
||||
: 'right',
|
||||
// Which halves of a dateline box the probe proved present; the
|
||||
// renderer drapes only those, so a confirmed-empty half never
|
||||
// lands on the map as black "no data" tiles.
|
||||
// Keep every half except those confirmed empty by the probe.
|
||||
availableBoxes: thumbnails.get(candidate.key)?.availableBoxes ?? null,
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,7 @@ function clampAlpha(value) {
|
||||
const boxKey = (box) =>
|
||||
[box.west, box.south, box.east, box.north].map(Number).join(',');
|
||||
|
||||
/** Comparable per-half availability signature; '' with no evidence. */
|
||||
/** Comparable per-half availability signature; unknown differs from empty. */
|
||||
const boxesKey = (list) =>
|
||||
Array.isArray(list)
|
||||
? list
|
||||
@@ -160,10 +160,9 @@ export function createRecentImageryRenderer({
|
||||
// [] means "not a box": add no layer rather than drape the raw box.
|
||||
const parts = nonCrossingBoxes(box);
|
||||
if (!parts.length) return false;
|
||||
// A dateline day drapes only the halves its probe proved present (VIIRS
|
||||
// is a JPEG product; a draped confirmed-empty half is a black rectangle).
|
||||
// No evidence drapes the whole box, as before. Proven halves that do not
|
||||
// match this box (a stale entry) leave the slot empty, never draped.
|
||||
// Skip confirmed-empty halves; a failed probe is not proof of emptiness.
|
||||
// No evidence drapes the whole box, as before. Evidence for a different
|
||||
// box leaves the slot empty rather than applying stale availability.
|
||||
const allowed = Array.isArray(availableBoxes)
|
||||
? parts.filter((part) =>
|
||||
availableBoxes.some((half) => half && boxKey(half) === boxKey(part)),
|
||||
@@ -237,9 +236,11 @@ export function createRecentImageryRenderer({
|
||||
}
|
||||
return true;
|
||||
}
|
||||
removeOwned(slotId);
|
||||
if (!mount(slotId, { candidate, box, ...look, availableBoxes }))
|
||||
const removed = removeOwned(slotId);
|
||||
if (!mount(slotId, { candidate, box, ...look, availableBoxes })) {
|
||||
if (removed) requestRender('recent-imagery-hide');
|
||||
return false;
|
||||
}
|
||||
requestRender('recent-imagery-show');
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -119,8 +119,8 @@ function probeHalf(
|
||||
/**
|
||||
* The answer to one request: the response, enriched (non-enumerably, so the
|
||||
* transport's own shape is untouched) with the non-crossing halves the probe
|
||||
* proved present. An empty evidence list is a confirmed-empty day; no field
|
||||
* means the caller did not probe per half.
|
||||
* did not confirm empty. An empty evidence list is a confirmed-empty day;
|
||||
* no field means the caller did not probe per half.
|
||||
*/
|
||||
function withPresentBoxes(response, presentBoxes) {
|
||||
if (!response) return response;
|
||||
|
||||
@@ -91,8 +91,7 @@ export function createThumbnailLoader({
|
||||
let status = 'error';
|
||||
let objectUrl = null;
|
||||
let acquisitionTime = null;
|
||||
// Which half of a dateline box the probe proved present; null when the
|
||||
// request was not probed per half.
|
||||
// Halves not confirmed empty; null when no per-half probe is available.
|
||||
let availableBoxes = null;
|
||||
let cancelled = false;
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user