Packagecom.google.maps.services
Classpublic final class ClientGeocoder
Implementsflash.events.IEventDispatcher, IClientGeocoder

A ClientGeocoder object communicates 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.



Public Methods
 MethodDefined by
  
Constructs a ClientGeocoder instance for performing geocoding.
ClientGeocoder
  
geocode(address:String):void
Initiates a geocoding request.
ClientGeocoder
  
Retrieves the geocoder object's options.
ClientGeocoder
  
resetCache():void
Resets the geocoding cache, clearing all results retrieved by this and other ClientGeocoder objects.
ClientGeocoder
  
reverseGeocode(latLng:LatLng):void
Initiates a reverse geocoding request.
ClientGeocoder
  
Updates the geocoder options.
ClientGeocoder
Protected Methods
 MethodDefined by
  
clearWrapper():void
Remove all event listeners and clear the wrapper.
ClientGeocoder
Constructor detail
ClientGeocoder()constructor
public function ClientGeocoder(options:ClientGeocoderOptions = null)

Constructs a ClientGeocoder instance for performing geocoding.

Parameters
options:ClientGeocoderOptions (default = null) — Full or partial set of geocoding options. When a partial set of options is specified, the geocoder object's complete set of options will be a combination of this partial set and the defaults. In API versions prior to 1.8, the ClientGeocoder constructor took a different set of parameters. These parameters are now included within class ClientGeocoderOptions. See the example code for details of how to replace old code with new code. This change makes this class consistent with the majority of other classes in the API.

Example
Deprecated and new-style code for creating a ClientGeocoder.
   // Old-style code (prior to version 1.8).
   var geocoder:ClientGeocoder = new ClientGeocoder("AU", myLatLngBounds);
      // New-style code
   var geocoder:ClientGeocoder = new ClientGeocoder(
       new ClientGeocoderOptions({
         countryCode: "AU",
         viewport: myLatLngBounds
       }));

Method detail
clearWrapper()method
protected function clearWrapper():void

Remove all event listeners and clear the wrapper.

geocode()method 
public function geocode(address:String):void

Initiates a geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.

Parameters
address:String — Address to geocode.

Throws
— A null or empty address will cause an ArgumentError to be thrown.
getOptions()method 
public function getOptions():ClientGeocoderOptions

Retrieves the geocoder object's options. Use the setOptions() method to modify geocoder options.

Returns
ClientGeocoderOptions — Full set of options for the geocoder object.
resetCache()method 
public function resetCache():void

Resets the geocoding cache, clearing all results retrieved by this and other ClientGeocoder objects.

reverseGeocode()method 
public function reverseGeocode(latLng:LatLng):void

Initiates a reverse geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.

Parameters
latLng:LatLng — LatLng to reverse geocode.

Throws
— A null LatLng will cause an ArgumentError to be thrown.
setOptions()method 
public function setOptions(options:ClientGeocoderOptions):void

Updates the geocoder options. The options parameter may specify a complete or partial set of geocoder options.

Parameters
options:ClientGeocoderOptions — New full or partial set of geocoder options.