Packagecom.yahoo.maps.api.core.location
Classpublic class Address
InheritanceAddress Inheritance flash.events.EventDispatcher
ImplementsILocation

This class wraps an address string and provides methods to geocode the location, access its geocoder result and normalizing address strings.


Example
This example creates a new Address object and sets the center of the map.
   var address:Address = new Address("Seattle, WA");
   _map.setCenterAddress(address);
  

This example creates a new Address object and begins the geocode request.
   var address:Address = new Address("San Francisco, CA");
   address.addEventListener(GeocoderEvent.GEOCODE_SUCCESS, handleGeocodeSuccess);
   address.geocode();
  
   function handleGeocodeSuccess(event:GeocoderEvent):void
   {
    // handle event
   }
  



Public Properties
 PropertyDefined by
  address : String
[read-only] The address location.
Address
  canonicalizedAddress : String
[read-only] The canonicalized address location.
Address
  geocoded : Boolean
[read-only] Returns true if this address has been geocoded.
Address
  geocoderResultSet : GeocoderResultSet
[read-only] Returns the ResultSet provided by the geocoder.
Address
  locale : String
The locale to geocode this address to.
Address
Public Methods
 MethodDefined by
  
Address(address:String)
Creates a new Address object.
Address
  
canonicalize(address:String):String
[static] Normalizes the address string by removing double spaces and commas.
Address
  
geocode():void
Geocodes the address input using the built-in Geocoder class.
Address
  
toString():String
Returns the address string.
Address
Events
 EventSummaryDefined by
    Address
    Address
Property detail
addressproperty
address:String  [read-only]

The address location.

Implementation
    public function get address():String
canonicalizedAddressproperty 
canonicalizedAddress:String  [read-only]

The canonicalized address location.
Replaces commas and double spaces with a single space, and converts to lower case.

Implementation
    public function get canonicalizedAddress():String
geocodedproperty 
geocoded:Boolean  [read-only]

Returns true if this address has been geocoded.

Implementation
    public function get geocoded():Boolean
geocoderResultSetproperty 
geocoderResultSet:GeocoderResultSet  [read-only]

Returns the ResultSet provided by the geocoder.

Implementation
    public function get geocoderResultSet():GeocoderResultSet
localeproperty 
locale:String  [read-write]

The locale to geocode this address to. (Defaults to MapLocales.EN)

Implementation
    public function get locale():String
    public function set locale(value:String):void
Constructor detail
Address()constructor
public function Address(address:String)

Creates a new Address object.

Parameters
address:String — An address string (ie: "701 First Avenue, Sunnyvale, CA")
Method detail
canonicalize()method
public static function canonicalize(address:String):String

Normalizes the address string by removing double spaces and commas.

Parameters
address:String — The address string to normalize

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

Geocodes the address input using the built-in Geocoder class.

See also

Geocoder
toString()method 
public override function toString():String

Returns the address string.

Returns
String
Event detail
geocoderFailureevent 
Event object type: GeocoderEvent

geocoderSuccessevent  
Event object type: GeocoderEvent