MultiSearch Reference

MultiSearch Javascript API Reference
  1. multisearch class
  2. ApiOptions Interface
  3. AutocompleteResponseItem Interface
  4. DetailsResponseItem Interface
  5. MultiApiOptions Interface
  6. autocompleteLocalities Interface
  7. autocompleteMulti Interface
  8. autocompleteStore Interface
  9. detailsPlaces Interface
  10. detailsMulti Interface
  11. autocompletePlaces Interface

multisearch class

woosmap.multisearch

Create an instance of the Multisearch library.

Constructor
multisearch(defaultSearchOptions)
Parameters:

Create an instance of the Multisearch library.


ApiOptions Interface

Properties
Type: number | "boolean"

Either false to prevent the API from being fallbacked or a number between 0 and 1 corresponding to the threshold of fallback. A value of 0 indicates that the results must contain at least one perfect match while 1 will match anything. If no value is specified, default values are applied for each API (1 for store, 0,4 for localities, 1 for places)

Type: string

Authentication key to be able to call the API.

Type: number

Empty result will be sent by the API and no fallback will be triggered if the input length does not reach the minInputLength value..

Type: Object

List of the API params to send. Checkout:


AutocompleteResponseItem Interface

Properties
Type: "localities" | "store" | "places"

The api the result was retrieved from

Type: string

Contains the human-readable name for the returned result.

Type: string

HTML description in which the entered term in the prediction result text are in <mark>tags

Type: string

Item identifier

Type: object

The item returned by the API “as is”.

Type: array

Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired.

Type: array

Array of types that apply to this item.


DetailsResponseItem Interface

Properties
Type: array

Array containing the separate components applicable to this address. Each component has a long name (full text description or name of the address component), a short name (abbreviated textual name for the address component, if available) and types (array indicating the type of the address component like locality, street_number…)

Type: string

String containing the human-readable address of this item.

Type: object

Item geometry ({location:{lat, lng}})

Type: string

Item identifier

Type: object

Item returned by the API “as is”.

Type: string

Item name

Type: array

Types of the given item (like locality or postal_code)


MultiApiOptions Interface

Properties
Type: number

The amount of time in ms the autocomplete function will wait after the last received call before executing the next one.

Options for the Woosmap Localities API.

Options for the Google Places API.

Options for the Woosmap Store API.


autocompleteLocalities Interface

Type: Function

Query the autocomplete Woosmap Localities API. Check out the API documentation

Function
autocompleteLocalities(input, options?, callback?)
Parameters:
  • input: string the input to autocomplete on
  • options: ApiOptions Options of the API
  • callback: Function function(error, results) for response callback

Query the autocomplete Woosmap Localities API. Check out the API documentation


autocompleteMulti Interface

Type: Function

Query the different autocomplete APIs defined in the apiOrder list. Depending on the fallbackBreakpoint and the minInputLength defined for each API, if the first API does not send revelant enough results, it will query the next one, until results are relevant or no other API is in the list.

Function
autocompleteMulti(input, options?, callback?)
Parameters:
  • input: string the input to autocomplete on
  • options: MultiApiOptions Options of the API
  • callback: Function function(error, results) for response callback

Query the different autocomplete APIs defined in the apiOrder list. Depending on the fallbackBreakpoint and the minInputLength defined for each API, if the first API does not send revelant enough results, it will query the next one, until results are relevant or no other API is in the list.


autocompleteStore Interface

Type: Function

Query the autocomplete Woosmap Store API.

Function
autocompleteStore(input, options?, callback?)
Parameters:
  • input: string the input to autocomplete on
  • options: ApiOptions Options of the API
  • callback: Function function(error, results) for response callback

Query the autocomplete Woosmap Store API.


detailsPlaces Interface

Type: Function

Query the details Google Places API to get details of a place. Check out the API documentation

Function
detailsPlaces(id, callback?)
Parameters:
  • id: string the place id to retrieve details from
  • callback: Function function(error, results) for response callback

Query the details Google Places API to get details of a place. Check out the API documentation


detailsMulti Interface

Type: Function

Query the details api to get details of an item.

Function
detailsMulti(id, api, callback?)
Parameters:
  • id: string the id of the item to retrieve details from
  • api: "localities" | "store" | "places" the api to retrieve details from
  • callback: Function function(error, results) for response callback

Query the details api to get details of an item.


autocompletePlaces Interface

Type: Function

Query the autocomplete Google Places API. Check out the API documentation

Function
autocompletePlaces(input, options?, callback?)
Parameters:
  • input: string the input to autocomplete on
  • options: ApiOptions Options of the API
  • callback: Function function(error, results) for response callback

Query the autocomplete Google Places API. Check out the API documentation


Was this article helpful?
Have more questions? Submit a request