Switch location bias from a point to a bounding box for improved autocomplete accuracy and validation.

This commit is contained in:
Ben Haas
2026-04-13 07:53:40 -07:00
parent 4a16442db0
commit 7fca16d866
9 changed files with 80 additions and 145 deletions
+2 -2
View File
@@ -917,12 +917,12 @@ describe('mapsApi', () => {
})
);
const result = await mapsApi.autocomplete('Par', 'fr', { lat: 48.8, lng: 2.3 });
const result = await mapsApi.autocomplete('Par', 'fr', { low: { lat: 48.5, lng: 2.0 }, high: { lat: 49.0, lng: 2.8 } });
expect(capturedBody).toEqual({
input: 'Par',
lang: 'fr',
locationBias: { lat: 48.8, lng: 2.3 },
locationBias: { low: { lat: 48.5, lng: 2.0 }, high: { lat: 49.0, lng: 2.8 } },
});
expect(result.suggestions).toHaveLength(1);
expect(result.suggestions[0].mainText).toBe('Paris');