Skip to content

Commit

Permalink
add support for expandUnits to autocomplete input (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
kochis authored Aug 30, 2023
1 parent 6e5214a commit 3d1f267
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/ui/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3d1f267

Please sign in to comment.