Class: AddressSearch

AddressSearch(target, parametersopt, delayopt)

AddressSearch Class used to handle the AddressSearch module

Constructor

new AddressSearch(target, parametersopt, delayopt)

Creates an instance of AddressSearch and checks for invalid parameters
Parameters:
Name Type Attributes Description
target Element | String The input targeted by the AddressSearch module
parameters Object <optional>
Additional optional parameters
delay Object <optional>
Delay to wait between keypresses before calling the API
Source:

Members

uniqueId :Number

Type:
  • Number
Source:

value :PlaceResult

Type:
  • PlaceResult
Source:

Methods

(static) destroy(selector)

Removes any AddressSearch mutation from the DOM
Parameters:
Name Type Description
selector String The AddressSearch input selector
Source:

destroy()

Removes any AddressSearch mutation from the DOM
Source:

offError() → {AddressSearch}

Removes every callback previously added with AddressSearch#onError
Source:
Returns:
The current AddressSearch
Type
AddressSearch

offPredict() → {AddressSearch}

Removes every callback previously added with AddressSearch#onPredict
Source:
Returns:
The current AddressSearch
Type
AddressSearch

offSelect() → {AddressSearch}

Removes every callback previously added with AddressSearch#onSelect
Source:
Returns:
The current AddressSearch
Type
AddressSearch

onError(callback) → {AddressSearch}

Adds a callback to be used when an error occurs
Parameters:
Name Type Description
callback onErrorCallback Function to call after an error
Source:
Returns:
The current AddressSearch
Type
AddressSearch

onPredict(callback) → {AddressSearch}

Adds a callback to be used when predictions are displayed
Parameters:
Name Type Description
callback onPredictCallback Function to call after predictions
Source:
Returns:
The current AddressSearch
Type
AddressSearch

onSelect(callback) → {AddressSearch}

Adds a callback to be used when the user selects an address
Parameters:
Name Type Description
callback onSelectCallback Function to call after the user's selection
Source:
Returns:
The current AddressSearch
Type
AddressSearch

refreshService() → {AddressSearch}

Refreshes the Google API fetchers
Source:
Returns:
The current AddressSearch
Type
AddressSearch

reset() → {AddressSearch}

Resets the AddressSearch
Source:
Returns:
The current AddressSearch
Type
AddressSearch

setFields(fieldList) → {AddressSearch}

Manually set which fields should be returned by the Google Places API
Parameters:
Name Type Description
fieldList Array.<String> List of field names
Source:
Returns:
The current AddressSearch
Type
AddressSearch

setPlace(place_id, triggerCallbacksopt) → {Promise}

Manually sets the AddressSearch value via a `place_id`
Parameters:
Name Type Attributes Default Description
place_id Integer New place_id
triggerCallbacks Boolean <optional>
true Should the method trigger the select callbacks?
Source:
Returns:
- Resolves when the place has been set
Type
Promise

setValue(value, triggerCallbacksopt)

Manually sets the AddressSearch value
Parameters:
Name Type Attributes Default Description
value String | PlaceResult New value
triggerCallbacks Boolean <optional>
true Should the method trigger the select callbacks?
Source:

useService(googleService) → {AddressSearch}

Use a different 'google' object to fetch data
Parameters:
Name Type Description
googleService Object The service to use
Source:
Returns:
The current AddressSearch
Type
AddressSearch