mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Move default predictions out of the geocoder files
This commit is contained in:
parent
e051ea3f31
commit
01623f3c4c
3 changed files with 3 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -64,15 +64,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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ import classNames from 'classnames';
|
|||
import debounce from 'lodash/debounce';
|
||||
import { IconSpinner } from '../../components';
|
||||
import { propTypes } from '../../util/types';
|
||||
import config from '../../config';
|
||||
|
||||
import IconHourGlass from './IconHourGlass';
|
||||
import IconCurrentLocation from './IconCurrentLocation';
|
||||
import Geocoder, { GeocoderAttribution, CURRENT_LOCATION_ID } from './GeocoderMapbox';
|
||||
import config from '../../config';
|
||||
// import Geocoder, { GeocoderAttribution, CURRENT_LOCATION_ID } from './GeocoderGoogleMaps';
|
||||
|
||||
import css from './LocationAutocompleteInput.css';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue