Options
All
  • Public
  • Public/Protected
  • All
Menu

A widget that provides Place predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered.

Hierarchy

Index

Constructors

constructor

  • A widget that provides Place predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered.

    Parameters

    • inputField: HTMLInputElement

      The <input> text field to which the Autocomplete should be attached.

    • Optional opts: null | AutocompleteOptions

      Options.

    Returns Autocomplete

Methods

addListener

  • Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with google.maps.event.removeListener.

    Parameters

    • eventName: string
    • handler: Function

    Returns MapsEventListener

bindTo

  • bindTo(key: string, target: MVCObject, targetKey?: null | string, noNotify?: boolean): void
  • Binds a View to a Model.

    Parameters

    • key: string
    • target: MVCObject
    • Optional targetKey: null | string
    • Optional noNotify: boolean

    Returns void

get

  • get(key: string): any
  • Gets a value.

    Parameters

    • key: string

    Returns any

getBounds

  • Returns the bounds to which predictions are biased.

    Returns undefined | LatLngBounds

getFields

  • getFields(): undefined | string[]
  • Returns the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see google.maps.places.PlaceResult.

    Returns undefined | string[]

getPlace

  • Returns the details of the Place selected by user if the details were successfully retrieved. Otherwise returns a stub Place object, with the name property set to the current value of the input field.

    Returns PlaceResult

notify

  • notify(key: string): void
  • Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to.

    Parameters

    • key: string

    Returns void

set

  • set(key: string, value: any): void
  • Sets a value.

    Parameters

    • key: string
    • value: any

    Returns void

setBounds

  • Sets the preferred area within which to return Place results. Results are biased towards, but not restricted to, this area.

    Parameters

    Returns void

setComponentRestrictions

  • Sets the component restrictions. Component restrictions are used to restrict predictions to only those within the parent component. For example, the country.

    Parameters

    Returns void

setFields

  • setFields(fields: undefined | string[]): void
  • Sets the fields to be included for the Place in the details response when the details are successfully retrieved. For a list of fields see google.maps.places.PlaceResult.

    Parameters

    • fields: undefined | string[]

    Returns void

setOptions

setTypes

  • setTypes(types: null | string[]): void
  • Sets the types of predictions to be returned. For a list of supported types, see the developer's guide. If no type is specified, all types will be returned. The setTypes method accepts a single element array.

    Parameters

    • types: null | string[]

      The types of predictions to be included.

    Returns void

setValues

  • setValues(values?: null | object): void
  • Sets a collection of key-value pairs.

    Parameters

    • Optional values: null | object

    Returns void

unbind

  • unbind(key: string): void
  • Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed.

    Parameters

    • key: string

    Returns void

unbindAll

  • unbindAll(): void

Generated using TypeDoc