com.mapitz.gwt.googleMaps.client
Class GClientGeocoder

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.mapitz.gwt.googleMaps.client.GClientGeocoder

public class GClientGeocoder
extends com.google.gwt.core.client.JavaScriptObject

This class is used to communicate directly with Google servers to obtain geocodes for user specified addresses. In addition, a geocoder maintains its own cache of addresses, which allows repeated queries to be answered without a round trip to the server.

Author:
aglaforge

Method Summary
static GClientGeocoder create()
          GClientGeocoder(cache?) Creates a new instance of a geocoder that talks directly to Google servers.
static GClientGeocoder create(GGeocodeCache cache)
          GClientGeocoder(cache?) Creates a new instance of a geocoder that talks directly to Google servers.
 GGeocodeCache getCache()
          getCache() GGeocodeCache Returns currently used geocode cache, or null, if no client-side caching is performed.
 void getLatLng(java.lang.String address, GGeocodeResultListener result)
          getLatLng(address, callback) none Sends a request to Google servers to geocode the specified address.
 void getLocations(java.lang.String address, GGeocodeAdvancedResultListener result)
          getLocations(address, callback) none Sends a request to Google servers to geocode the specified address.
 void reset()
          reset() none Resets the geocoder.
 GGeocodeCache setCache(GGeocodeCache cache)
          setCache(cache) none Sets a new client-side caching.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static GClientGeocoder create(GGeocodeCache cache)
GClientGeocoder(cache?) Creates a new instance of a geocoder that talks directly to Google servers. The optional cache parameter allows one to specify a custom client-side cache of known addresses. If none is specified, a GFactualGeocodeCache is used. (Since 2.55)

Returns:

create

public static GClientGeocoder create()
GClientGeocoder(cache?) Creates a new instance of a geocoder that talks directly to Google servers. The optional cache parameter allows one to specify a custom client-side cache of known addresses. If none is specified, a GFactualGeocodeCache is used. (Since 2.55)

Returns:

getLatLng

public void getLatLng(java.lang.String address,
                      GGeocodeResultListener result)
getLatLng(address, callback) none Sends a request to Google servers to geocode the specified address. If the address was successfully located, the user-specified callback function is invoked with a GLatLng point. Otherwise, the callback function is given a null point. In case of ambiguous addresses, only the point for the best match is passed to the callback function. (Since 2.55)


getLocations

public void getLocations(java.lang.String address,
                         GGeocodeAdvancedResultListener result)
getLocations(address, callback) none Sends a request to Google servers to geocode the specified address. A reply that contains status code, and if successful, one or more Placemark objects, is passed to the user-specified callback function. Unlike the GClientGeocoder.getLatLng method, the callback function may determine the reasons for failure by examining the code value of the Status field. (Since 2.55)

Parameters:
address -
result -

getCache

public GGeocodeCache getCache()
getCache() GGeocodeCache Returns currently used geocode cache, or null, if no client-side caching is performed. (Since 2.55)


setCache

public GGeocodeCache setCache(GGeocodeCache cache)
setCache(cache) none Sets a new client-side caching. If this method is invoked with cache set to null, client-side caching is disabled. Setting a new cache discards previously stored addresses. (Since 2.55)

Returns:

reset

public void reset()
reset() none Resets the geocoder. In particular this method calls the GGeocodeCache.reset method on the client-side cache, if one is used by this geocoder. (Since 2.55)