| Package | com.esri.aws.services |
| Class | public class Address |
See also
| Property | Defined by | ||
|---|---|---|---|
| city : String
The city of the address.
| Address | ||
| country : String
The two-letter country code of the address.
| Address | ||
| houseNumber : String
The house number of the address.
| Address | ||
| intersection : String
The second street of an intersection address.
| Address | ||
| postalCode : String
The ZIP Code or postal code of the address.
| Address | ||
| stateProvince : String
The state or province of the address.
| Address | ||
| street : String
The street name of the address and can include the house number.
| Address | ||
| Method | Defined by | ||
|---|---|---|---|
|
toString():String
Returns the stringified address.
| Address | ||
| city | property |
public var city:StringThe city of the address.
| country | property |
public var country:StringThe two-letter country code of the address. See Geocoding Country Codes for a list of valid country codes.
| houseNumber | property |
public var houseNumber:StringThe house number of the address. House numbers can also be defined within the street field instead of the houseNumber field.
| intersection | property |
public var intersection:StringThe second street of an intersection address.
| postalCode | property |
public var postalCode:StringThe ZIP Code or postal code of the address.
| stateProvince | property |
public var stateProvince:StringThe state or province of the address.
| street | property |
public var street:StringThe street name of the address and can include the house number.
| toString | () | method |
public function toString():StringReturns the stringified address.
ReturnsString |
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
pageTitle="Basic Reverse Geocode Request"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.awx.geom.GeoPoint;
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.services.Address;
import com.esri.aws.services.IAddressFinder;
import com.esri.aws.services.AddressFinderOptions;
import com.esri.aws.osgi.framework.IServiceReference;
import flash.utils.getQualifiedClassName;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.IResponder;
[Bindable]
private var candidates:ArrayCollection;
private var findTracker:ServiceTracker;
private function onComplete():void
{
findTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IAddressFinder));
findTracker.open();
}
private function doSearch():void
{
var findService:IAddressFinder = findTracker.getService() as IAddressFinder;
if (findService)
{
// set the data source (only relevant option)
var m_options:AddressFinderOptions = new AddressFinderOptions();
m_options.dataSource = "auto"; // ArcWeb:DE.IP.World
m_options.extendedPostalCode = true;
m_options.partialAddress = true;
var m_point:GeoPoint = new GeoPoint( Number(lonText.text), Number(latText.text) );
//call the AddressFinder service using 'this' as the responder.
findService.findAddressByPoint(m_point, m_options, this);
m_info.htmlText = "Sending request ...";
}
}
public function result(data:Object):void
{
try
{
var m_address:Address = Address(data);
m_info.htmlText = "<i>[toString: " + m_address.toString() + "]</i><br><br>";
if (m_address.houseNumber != null)
{
m_info.htmlText += "houseNumber: " + m_address.houseNumber + "<br>";
}
if (m_address.street != null)
{
m_info.htmlText += "street: " + m_address.street + "<br>";
}
if (m_address.intersection != null)
{
m_info.htmlText += "intersection: " + m_address.intersection + "<br>";
}
if (m_address.city != null)
{
m_info.htmlText += "city: " + m_address.city + "<br>";
}
if (m_address.stateProvince != null)
{
m_info.htmlText += "stateProvince: " + m_address.stateProvince + "<br>";
}
if (m_address.postalCode != null)
{
m_info.htmlText += "postalCode: " + m_address.postalCode + "<br>";
}
if (m_address.country != null)
{
m_info.htmlText += "country: " + m_address.country + "<br>";
}
}
catch(error:Error)
{
Alert.show(error.message);
}
}
public function fault(info:Object):void
{
m_info.htmlText = "Request failed.";
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
<awx:AddressFinderActivator/>
</awx:Framework>
<mx:Panel paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"
title="Reverse Geocode (findAddressByPoint)" layout="horizontal">
<mx:TextInput width="100" id="latText" text="34.057058" enter="doSearch()"/>
<mx:TextInput width="100" id="lonText" text="-117.195533" enter="doSearch()"/>
<mx:Button label="Look it up" click="doSearch()" id="m_button" />
</mx:Panel>
<mx:Text id="m_info" fontSize="14"/>
</mx:Application>