mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
fix(recent-imagery): take the short arc when a box is dragged across the dateline
A drag across ±180° was turned into a min/max box about 360° wide and refused as "Box is 38,332 km wide", and validateBox() refused any west > east box. A drag whose corners are more than 180° apart is now the short box (west > east), and the layer handles it end to end: - model: lonSpanDeg() and nonCrossingBoxes(); validateBox, boxSideKm, boxCentre, boxFromPin and coverageFor read a west > east box as the short arc. - catalog: CMR reads a west > east bounding_box as the short box, so the box is sent as it is. - rendering: the slot drapes one imagery layer per side of ±180°. - Worldview Snapshots rejects a west > east BBOX, so snapshot URLs, EXPORT and get_recent_imagery refuse a dateline box and request nothing; thumbnail and Data-Present probes use the box's wider side.
This commit is contained in:
1 parent
7df581765d
commit
ca14954636
16 files changed
+503
-70
No files matched your search
@@ -968,6 +968,26 @@ test('opacity drives both images; EXPORT downloads the pin or the preview and EX
|
||||
await settle();
|
||||
assert.equal(await f.readout.exportImage('a'), true);
|
||||
assert.match(f.fetches.at(-1), /WIDTH=1024&HEIGHT=512/);
|
||||
// A dateline box is drawn on the map, but Worldview rejects a crossing BBOX.
|
||||
const before = f.fetches.length;
|
||||
f.layer.setBox({ west: 179, south: 0, east: -179, north: 1 });
|
||||
f.catalog.resolveLast();
|
||||
await settle();
|
||||
assert.notEqual(
|
||||
f.byId('ri-notice-text').textContent,
|
||||
'Select one side of the dateline',
|
||||
'the drawn box is not a warning until an export is tried',
|
||||
);
|
||||
assert.equal(await f.readout.exportImage('a'), false);
|
||||
assert.equal(
|
||||
f.byId('ri-notice-text').textContent,
|
||||
'Select one side of the dateline',
|
||||
);
|
||||
assert.equal(
|
||||
f.fetches.length,
|
||||
before,
|
||||
'export does not request a crossing BBOX',
|
||||
);
|
||||
f.layer.setMode('ab');
|
||||
assert.deepEqual(
|
||||
[
|
||||
|
||||
Reference in new issue
Block a user