From c5ed60e0751ff90164e1c31bec186f98163eae3f Mon Sep 17 00:00:00 2001 From: Craig Kochis Date: Wed, 30 Aug 2023 14:01:27 -0400 Subject: [PATCH] add support for expandUnits to autocomplete input --- src/types.ts | 1 + src/ui/autocomplete.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 90f89c2f..ce8df183 100644 --- a/src/types.ts +++ b/src/types.ts @@ -467,6 +467,7 @@ export interface RadarAutocompleteUIOptions { limit?: number, // Maximum number of autocomplete results layers?: RadarGeocodeLayer[]; countryCode?: string; + expandUnits?: boolean; placeholder?: string, // Placeholder text for the input field onSelection?: (selection: any) => void, onRequest?: (params: RadarAutocompleteParams) => void, diff --git a/src/ui/autocomplete.ts b/src/ui/autocomplete.ts index 3060c261..db836f66 100644 --- a/src/ui/autocomplete.ts +++ b/src/ui/autocomplete.ts @@ -226,13 +226,14 @@ class AutocompleteUI { } public async fetchResults(query: string) { - const { limit, layers, countryCode, onRequest } = this.config; + const { limit, layers, countryCode, expandUnits, onRequest } = this.config; const params: RadarAutocompleteParams = { query, limit, layers, countryCode, + expandUnits, } if (this.near) {