Follow us on GitHub

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

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.mvc.MVCObject<Autocomplete>
          extended by com.google.gwt.maps.client.placeslib.Autocomplete

public class Autocomplete
extends MVCObject<Autocomplete>

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 class extends MVCObject.

See Autocomplete API Doc


Constructor Summary
protected Autocomplete()
          use newInstance();
 
Method Summary
 HandlerRegistration addPlaceChangeHandler(PlaceChangeMapHandler handler)
          This event is fired when a PlaceResult is made available for a Place the user has selected.
 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.
static Autocomplete newInstance(Element inputField, AutocompleteOptions options)
          Creates a new instance of Autocomplete that attaches to the specified input text field with the given options.
 void setBounds(LatLngBounds bounds)
          Sets the preferred area within which to return Place results.
 void setTypes(AutocompleteType... types)
          Sets the types of predictions to be returned.
 
Methods inherited from class com.google.gwt.maps.client.mvc.MVCObject
bindTo, bindTo, bindTo, changed, createInstanceOfMVCObject, get, notify, set, setValues, unbind, unbindAll
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Autocomplete

protected Autocomplete()
use newInstance();

Method Detail

newInstance

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

Parameters:
inputField -
options -

addPlaceChangeHandler

public final HandlerRegistration addPlaceChangeHandler(PlaceChangeMapHandler handler)
This event is fired when a PlaceResult is made available for a Place the user has selected. If the user enters the name of a Place that was not suggested by the control and presses the Enter key, a place_changed event will be fired that contains the user input in the name property, with no other properties defined.

Parameters:
handler -

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.

Parameters:
bounds -

setTypes

public final void setTypes(AutocompleteType... 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.

Parameters:
types -


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.