com.google.maps.gwt.client.places
Class Autocomplete

java.lang.Object
  extended by JavaScriptObject
      extended by com.google.maps.gwt.client.MVCObject
          extended by com.google.maps.gwt.client.places.Autocomplete

public class Autocomplete
extends MVCObject

A service to provide 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. THIS SOURCE CODE IS GENERATED, DO NOT MODIFY


Nested Class Summary
static interface Autocomplete.PlaceChangedHandler
          This event is fired when a PlaceResult is made available for a Place the user has selected.
 
Constructor Summary
protected Autocomplete()
          Protected constructor avoids default public constructor.
 
Method Summary
 void addPlaceChangedListener(Autocomplete.PlaceChangedHandler handler)
          Adds the given listener function to the given event name for the given object instance.
 void addPlaceChangedListenerOnce(Autocomplete.PlaceChangedHandler handler)
          Like addListener, but the handler removes itself after handling the first event.
 void clearInstanceListeners()
          Removes all listeners for all events for the given instance.
 void clearPlaceChangedListeners()
          Removes all listeners for the given event for the given instance.
static Autocomplete create(InputElement inputField)
          Creates a new instance of Autocomplete that attaches to the specified input text field with the given options.
static Autocomplete create(InputElement inputField, AutocompleteOptions opts)
          Creates a new instance of Autocomplete that attaches to the specified input text field with the given options.
 LatLngBounds getBounds()
          Returns the bounds to which predictions are biased.
 PlaceResult getPlace()
          Returns the details of the Place selected by the user, or null if no Place has been selected yet.
 void setBounds(LatLngBounds bounds)
          Sets the preferred area within which to return Place results.
 void setTypes(JsArrayString types)
          Sets the types of predictions to be returned.
 void triggerPlaceChanged(JavaScriptObject... varargs)
          Triggers the given event.
 
Methods inherited from class com.google.maps.gwt.client.MVCObject
bindTo, bindTo, bindTo, bindTo, changed, create, get, notify, set, setValues, setValues, unbind, unbindAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Autocomplete

protected Autocomplete()
Protected constructor avoids default public constructor.

Method Detail

create

public static Autocomplete create(InputElement inputField,
                                  AutocompleteOptions opts)
Creates a new instance of Autocomplete that attaches to the specified input text field with the given options.


create

public static Autocomplete create(InputElement inputField)
Creates a new instance of Autocomplete that attaches to the specified input text field with the given options.


addPlaceChangedListener

public final void addPlaceChangedListener(Autocomplete.PlaceChangedHandler handler)
Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener().


addPlaceChangedListenerOnce

public final void addPlaceChangedListenerOnce(Autocomplete.PlaceChangedHandler handler)
Like addListener, but the handler removes itself after handling the first event.


clearInstanceListeners

public final void clearInstanceListeners()
Removes all listeners for all events for the given instance.


clearPlaceChangedListeners

public final void clearPlaceChangedListeners()
Removes all listeners for the given event for the given instance.


getBounds

public final LatLngBounds getBounds()
Returns the bounds to which predictions are biased.


getPlace

public final PlaceResult getPlace()
Returns the details of the Place selected by the user, or null if no Place has been selected yet.


setBounds

public final void setBounds(LatLngBounds bounds)
Sets the preferred area within which to return Place results. Results are biased towards, but not restricted to, this area.


setTypes

public final void setTypes(JsArrayString types)
Sets the types of predictions to be returned. Supported types are ' establishment ' for businesses and ' geocode ' for addresses. If no type is specified, both types will be returned.


triggerPlaceChanged

public final void triggerPlaceChanged(JavaScriptObject... varargs)
Triggers the given event. All arguments after eventName are passed as arguments to the listeners.