Localities Reference 1.0 (Deprecated)
Localities Javascript API Reference 1.0- AutocompleteService class
- AutocompleteLocalities Interface
- AutocompleteParameters Interface
- AutocompleteRequest Interface
- AutocompleteResponse Interface
- ComponentRestrictions Interface
- ErrorCallback Interface
- LatLngBoundsLiteral Interface
- LatLngLiteral Interface
- MatchedElements Interface
- MatchedSubstring Interface
- SuccessCallback Interface
AutocompleteService class
woosmap.localities.AutocompleteService
Localities Service to help you call the Localities API.
Constructor |
AutocompleteService(apiKey) Parameters:
Instantiate a new AutocompleteService Object |
Methods | |
getQueryPredictions(params, callback, errorCallback, debounceTime) Parameters:
Get the predictions array from an input value. |
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:
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. | |
Type:
String The location name | |
Type:
String Array of postal codes for suggested location (only returned for localities predictions) | |
Type:
String Contains the larger city (or the post office city) for a postal_code (only available on suggestions with type: postal_code). | |
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’) | |
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:
String the public key of your Woosmap project. To use this parameter a dedicated option on your licence is needed. Please contact us if you are interested in using this parameter and you do not have subscribed the proper option yet. | |
Type:
ComponentRestrictions restricts predictions to selected components | |
Type:
String the data set to use, accepted values | |
Type:
String param to extend the search, accepted value is | |
Type:
String Value to search for predictions | |
Type:
String expected response language | |
Type:
String requested prediction type (‘locality’, ‘postal_code’, ‘country’, ‘admin_level’, ‘airport’, ‘train_station’, ‘metro_station’, ‘shopping’, ‘museum’, ‘zoo’, ‘amusement_park’, ‘art_gallery’, ‘tourist_attraction’ or undefined for ‘locality’ + ‘postal_code’) |
AutocompleteRequest Interface
Properties | |
Type:
ComponentRestrictions restricts predictions to selected components | |
Type:
String Defaults to ‘standard’, can be set to ‘advanced’ to retrieve postal codes outside western Europe | |
Type:
String can be set to ‘postal_code’ to search localities by name or postal code | |
Type:
String User input | |
Type:
String expected response language (ISO 639-1 code). Default is the country local or browser language. | |
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’) |
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. |
ErrorCallback Interface
Function
Callback executed when query fails
Function |
ErrorCallback(errorCode, errorText) Parameters:
Callback executed when query fails |
LatLngBoundsLiteral Interface
Properties | |
Type:
String The east value | |
Type:
String The north value | |
Type:
String The south value | |
Type:
String The west value |
LatLngLiteral Interface
Properties | |
Type:
String The latitude value | |
Type:
String The longitude value |
MatchedElements Interface
Properties | |
Type:
MatchedSubstring[] (optional) A set of substrings that match the admin_0 field | |
Type:
MatchedSubstring[] (optional) A set of substrings that match the admin_1 field | |
Type:
MatchedSubstring[] (optional) A set of substrings that match the description field | |
Type:
MatchedSubstring[] (optional) A set of substrings that match the name field | |
Type:
MatchedSubstring[] (optional) A set of substrings that match the postal_town field |
MatchedSubstring Interface
Properties | |
Type:
Number The length of the substring | |
Type:
Number The offset to the substring’s start within the AutocompleteLocalities field string |
SuccessCallback Interface
Function
Callback executed when query is successful
Function |
SuccessCallback(autocompleteResponse) Parameters:
Callback executed when query is successful |