Localities Widget Reference 1.0 (Deprecated)
Localities Javascript Widget Reference 1.0- Autocomplete class
- AutocompleteLocalities Interface
- AutocompleteParameters Interface
- AutocompleteResponse Interface
- ComponentRestrictions Interface
Autocomplete class
woosmap.localities.Autocomplete
AutocompleteElementsHandler
.
To instantiate the Localities Widget, build a new Autocomplete object.
Constructor |
Autocomplete(inputId, customConfig?) Parameters:
|
Methods | |
addListener(eventName, callback) Parameters:
Return Type:
Function Adds an event listener to the widget Can be removed using removeListener() with the same arguments | |
removeListener(eventName, callback) Parameters:
Removes given event listener from the widget | |
getSelectedLocality() Parameters:
None
Return Type:
AutocompleteLocalities Returns the latest user-selected locality among search results, false when unavailable. | |
getLocalities() Parameters:
None
Return Type:
AutocompleteResponse Returns the latest search results | |
setTypes(types) Parameters:
Sets the types to query | |
setComponentRestrictions(components) Parameters:
Sets the component restrictions | |
AutocompleteLocalities Interface
Properties | |
Type:
String The country name associated to the prediction | |
Type:
String The area name associated to the prediction | |
Type:
String The suggested formatted answer | |
Type:
LatLngLiteral The location object | |
Type:
String The location name | |
Type:
String Array of postal codes for suggested location (only returned for localities predictions) | |
Type:
String The largest city (or the post office city) for a postal_code (only returned for postal_code predictions). | |
Type:
String requested prediction type (‘locality’, ‘postal_code’, ‘country’, ‘admin_level’, ‘train_station’, ‘metro_station’, ‘shopping’, ‘airport’, ‘museum’, ‘zoo’, ‘amusement_park’, ‘art_gallery’, ‘tourist_attraction’) | |
Type:
LatLngBoundsLiteral The preferred viewpoint when displaying this Locality on a map. This property will be null if the preferred viewport for the Locality is not known. |
AutocompleteParameters Interface
Properties | |
Type:
ComponentRestrictions restricts predictions to selected components | |
Type:
String Sets custom description using one or more response field (see AutocompleteLocalities object Specification). Selected field should be string or array of string. Field ‘description’ can not be selected. | |
Type:
String Defaults to ‘standard’, can be set to ‘advanced’ to retrieve postal codes outside western Europe | |
Type:
Number prevents autocomplete requests from being sent unnecessarily often. Default is no debounce. | |
Type:
String can be set to ‘postal_code’ to search localities by name or postal codes | |
Type:
Number all tabindexes in Autocomplete will start from that tabindex. Defaults to 0. | |
Type:
String expected response language. Default is the country local or browser language | |
Type:
Number Number of characters before sending request to Localities API | |
Type:
String The types queried (example ‘locality’, ‘postal_code’, ‘country’ ; omit param for ‘locality’ + ‘postal_code’) |
AutocompleteResponse Interface
Properties | |
Type:
AutocompleteLocalities Array with Autocomplete Localities |
ComponentRestrictions Interface
Properties | |
Type:
String Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). For example, ‘fr’, ‘gb’, or ‘es’. You can provide a single one, or an array of country code strings. |