diff --git a/src/components/LocationAutocompleteInput/GeocoderGoogleMaps.js b/src/components/LocationAutocompleteInput/GeocoderGoogleMaps.js index b276f9d5..1841f92a 100644 --- a/src/components/LocationAutocompleteInput/GeocoderGoogleMaps.js +++ b/src/components/LocationAutocompleteInput/GeocoderGoogleMaps.js @@ -8,15 +8,6 @@ import css from './LocationAutocompleteInput.css'; export const CURRENT_LOCATION_ID = 'current-location'; -// A list of default predictions that can be shown when the user -// focuses on the autocomplete input without typing a search. This can -// be used to reduce typing and Geocoding API calls for common -// searches. -export const defaultPredictions = (config.maps.search.suggestCurrentLocation - ? [{ id: CURRENT_LOCATION_ID, predictionPlace: {} }] - : [] -).concat(config.maps.search.defaults); - // When displaying data from the Google Maps Places API, and // attribution is required next to the results. // See: https://developers.google.com/places/web-service/policies#powered diff --git a/src/components/LocationAutocompleteInput/GeocoderMapbox.js b/src/components/LocationAutocompleteInput/GeocoderMapbox.js index f4bd6d85..6a244936 100644 --- a/src/components/LocationAutocompleteInput/GeocoderMapbox.js +++ b/src/components/LocationAutocompleteInput/GeocoderMapbox.js @@ -33,15 +33,6 @@ const placeBounds = prediction => { return null; }; -// A list of default predictions that can be shown when the user -// focuses on the autocomplete input without typing a search. This can -// be used to reduce typing and Geocoding API calls for common -// searches. -export const defaultPredictions = (config.maps.search.suggestCurrentLocation - ? [{ id: CURRENT_LOCATION_ID, predictionPlace: {} }] - : [] -).concat(config.maps.search.defaults); - export const GeocoderAttribution = () => null; /** diff --git a/src/components/LocationAutocompleteInput/LocationAutocompleteInputImpl.js b/src/components/LocationAutocompleteInput/LocationAutocompleteInputImpl.js index 96e9a296..991ca732 100644 --- a/src/components/LocationAutocompleteInput/LocationAutocompleteInputImpl.js +++ b/src/components/LocationAutocompleteInput/LocationAutocompleteInputImpl.js @@ -7,15 +7,21 @@ import { IconSpinner } from '../../components'; import { propTypes } from '../../util/types'; import IconHourGlass from './IconHourGlass'; import IconCurrentLocation from './IconCurrentLocation'; -import Geocoder, { - GeocoderAttribution, - defaultPredictions, - CURRENT_LOCATION_ID, -} from './GeocoderGoogleMaps'; -// import Geocoder, { GeocoderAttribution, defaultPredictions, CURRENT_LOCATION_ID } from './GeocoderMapbox'; +import Geocoder, { GeocoderAttribution, CURRENT_LOCATION_ID } from './GeocoderGoogleMaps'; +// import Geocoder, { GeocoderAttribution, CURRENT_LOCATION_ID } from './GeocoderMapbox'; +import config from '../../config'; import css from './LocationAutocompleteInput.css'; +// A list of default predictions that can be shown when the user +// focuses on the autocomplete input without typing a search. This can +// be used to reduce typing and Geocoding API calls for common +// searches. +export const defaultPredictions = (config.maps.search.suggestCurrentLocation + ? [{ id: CURRENT_LOCATION_ID, predictionPlace: {} }] + : [] +).concat(config.maps.search.defaults); + const DEBOUNCE_WAIT_TIME = 200; const KEY_CODE_ARROW_UP = 38; const KEY_CODE_ARROW_DOWN = 40;