Localities Reference 1.0 (Deprecated)
Localities Javascript API Reference 1.0- AutocompleteService class
- AutocompleteLocalities object Specification
- AutocompleteRequest object Specification
- AutocompleteResponse object Specification
- ComponentRestrictions object Specification
- ErrorCallback function definition
- LatLngBoundsLiteral object Specification
- LatLngLiteral object Specification
- MatchedElements object Specification
- MatchedSubstring object Specification
- SuccessCallback function definition
AutocompleteService class 🔗
woosmap.localities.AutocompleteService
Constructor | |
AutocompleteService( |
Instantiate a new AutocompleteService Object |
Methods | |
getQueryPredictions( |
Get the predictions array from an input value. |
AutocompleteLocalities object Specification 🔗
Properties | |
admin_0 |
Type: String
The country name associated to the prediction |
admin_1 |
Type: String
The area name associated to the prediction |
description |
Type: String
The suggested formatted answer |
location |
Type: LatLngLiteral
The location object |
name |
Type: String
The location name |
postal_codes |
Type: String| Array of postal codes for suggested location (only returned for localities predictions) |
postal_town |
Type: String
Contains the larger city (or the post office city) for a postal_code (only available on suggestions with type: postal_code). |
type |
Type: String
requested prediction type (‘locality’, ‘postal_code’, ‘country’, ‘admin_level’, ‘train_station’, ‘metro_station’, ‘shopping’, ‘museum’, ‘zoo’, ‘amusement_park’, ‘art_gallery’, ‘tourist_attraction’ or ‘airport’) |
viewpoint |
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. |
matched_substrings |
Type: MatchedElements
A set of substrings of each field (description, name, admin_0, admin_1) that match elements in the input. It can be used to highlight those substrings. Each substring is identified by an offset and a length. |
AutocompleteRequest object Specification 🔗
Properties | |
input |
Type: String
User input |
components |
Type: ComponentRestrictions
restricts predictions to selected components |
types |
Type: String| The types queried (supports ‘locality’, ‘postal_code’, ‘country’, ‘admin_level’, ‘train_station’, ‘metro_station’, ‘shopping’, ‘museum’, ‘zoo’, ‘amusement_park’, ‘art_gallery’, ‘tourist_attraction’ and ‘airport’ ; omit param for ‘locality’ + ‘postal_code’) |
data |
Type: String
Defaults to ‘standard’, can be set to ‘advanced’ to retrieve postal codes outside western Europe |
extended |
Type: String
can be set to ‘postal_code’ to search localities by name or postal code |
language |
Type: String
expected response language (ISO 639-1 code). Default is the country local or browser language. |
AutocompleteResponse object Specification 🔗
Properties | |
localities |
Type: AutocompleteLocalities
Array with Autocomplete Localities |
ComponentRestrictions object Specification 🔗
Properties | |
country |
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. |
ErrorCallback function definition 🔗
ErrorCallback
Function | function(errorCode:Number,errorText:String) |
Callback executed when query fails |
LatLngBoundsLiteral object Specification 🔗
Properties | |
east |
Type: String
The east value |
north |
Type: String
The north value |
south |
Type: String
The south value |
west |
Type: String
The west value |
LatLngLiteral object Specification 🔗
Properties | |
lat |
Type: String
The latitude value |
lng |
Type: String
The longitude value |
MatchedElements object Specification 🔗
Properties | |
description |
Type: [ 'Array' ].<MatchedSubstring>
(optional) A set of substrings that match the description field |
name |
Type: [ 'Array' ].<MatchedSubstring>
(optional) A set of substrings that match the name field |
admin_0 |
Type: [ 'Array' ].<MatchedSubstring>
(optional) A set of substrings that match the admin_0 field |
admin_1 |
Type: [ 'Array' ].<MatchedSubstring>
(optional) A set of substrings that match the admin_1 field |
postal_town |
Type: [ 'Array' ].<MatchedSubstring>
(optional) A set of substrings that match the postal_town field |
MatchedSubstring object Specification 🔗
Properties | |
offset |
Type: Number
The offset to the substring’s start within the AutocompleteLocalities field string |
length |
Type: Number
The length of the substring |
SuccessCallback function definition 🔗
SuccessCallback
Function | function(autocompleteResponse:AutocompleteResponse) |
Callback executed when query is successful |