Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

fix: recover near-view places through the application's place search

Sameh Khamisf86d1c329634
diff --git a/src/locations.js b/src/locations.js
index c9df123e8..02bd853fb 100644
--- a/src/locations.js
+++ b/src/locations.js
@@ -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) {
diff --git a/src/locations.test.mjs b/src/locations.test.mjs
index 35db0188e..c225488a3 100644
--- a/src/locations.test.mjs
+++ b/src/locations.test.mjs
@@ -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