Localities Reference

Localities Javascript API Reference
  1. AutocompleteService class
  2. AutocompleteLocalities object Specification
  3. AutocompleteRequest object Specification
  4. AutocompleteResponse object Specification
  5. ComponentRestrictions object Specification
  6. ErrorCallback function definition
  7. LatLngBoundsLiteral object Specification
  8. LatLngLiteral object Specification
  9. SuccessCallback function definition

AutocompleteService class 🔗



Instantiate a new AutocompleteService Object

getQueryPredictions(params:AutocompleteRequest, callback:SuccessCallback, errorCallback:ErrorCallback)

Get the predictions array from an input value.

AutocompleteLocalities object Specification  🔗

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.<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’ or ‘postal_code’)

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.

AutocompleteRequest object Specification  🔗

input Type: String

User input

components Type: ComponentRestrictions

restricts predictions to selected components

types Type: String

The types queried (supports ‘locality’ and ‘postal_code’ ; omit param for both)

data Type: String

Defaults to ‘standard’, can be set to ‘advanced’ to retrieve postal codes outside western Europe

language Type: String

expected response language (ISO 639-1 code). Default is the country local or browser language.

AutocompleteResponse object Specification  🔗

localities Type: AutocompleteLocalities

Array with Autocomplete Localities

ComponentRestrictions object Specification  🔗

country Type: String|Array.<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  🔗



Callback executed when query fails

LatLngBoundsLiteral object Specification  🔗

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  🔗

lat Type: String

The latitude value

lng Type: String

The longitude value

SuccessCallback function definition  🔗



Callback executed when query is successful