mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
Merge pull request #947 from bilawalsidhu/fix/near-view-recovery-uses-app-search
fix: recover near-view places through the application's place search
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -841,6 +841,7 @@ export async function searchAndFlyTo(viewer, query, options = {}) {
|
||||
query,
|
||||
result && !outcome.fallbackUsed ? { lat, lon: lng } : null,
|
||||
signal,
|
||||
placeSearch,
|
||||
);
|
||||
signal?.throwIfAborted();
|
||||
if (recovered) {
|
||||
|
||||
@@ -599,6 +599,21 @@ test('search without an authority hook preserves the existing caller contract',
|
||||
assert.equal(viewer.flights.length, 1);
|
||||
});
|
||||
|
||||
test('near-view recovery searches through the application place search', async () => {
|
||||
// Recovery must use the place search the application configured, not the module default.
|
||||
const viewer = stubViewer();
|
||||
const placeSearch = createStandalonePlaceSearch({ resolveApiKey: () => 'test-key' });
|
||||
let received = null;
|
||||
await runSearch(viewer, {
|
||||
placeSearch,
|
||||
recoverNearView: async (...args) => {
|
||||
received = args[4];
|
||||
return null;
|
||||
},
|
||||
});
|
||||
assert.equal(received, placeSearch);
|
||||
});
|
||||
|
||||
test('a precise search without an outline frames against the resolved ground, not sea level', async () => {
|
||||
// Camp Mabry field report: with no detailed outline (no configured Overpass)
|
||||
// framing used the 250 m landmark range from a sea-level target, and the eye
|
||||
|
||||
Reference in new issue
Block a user