| Package | com.esri.aws.services |
| Class | public class AddressFinderOptions |
| Property | Defined by | ||
|---|---|---|---|
| dataSource : String
The name of the data source to use for geocoding.
| AddressFinderOptions | ||
| extendedPostalCode : Boolean = false
If true, returns extended postal codes (for example, zip + 4).
| AddressFinderOptions | ||
| partialAddress : Boolean = false
If true, returns partial addresses when not enough address information exists in the request.
| AddressFinderOptions | ||
| resultSetRange : ResultSetRange
The range of results to be returned.
| AddressFinderOptions | ||
| snapType : String
The reverse geocoding snap types to use with the findAddressByPoint method (Address Finder).
| AddressFinderOptions | ||
| dataSource | property |
public var dataSource:StringThe name of the data source to use for geocoding. Required. See Address Finder data sources for valid values. Use the name in parenthesis. List multiple data sources separated by semicolons to create your own automated data source, for example, "ArcWeb:NT.Streets.EU;ArcWeb:TA.Streets.EU".
| extendedPostalCode | property |
public var extendedPostalCode:Boolean = falseIf true, returns extended postal codes (for example, zip + 4). Extended postal codes apply to forward geocoding (not reverse geocoding) and are only returned for US addresses.
The default value is false.
| partialAddress | property |
public var partialAddress:Boolean = falseIf true, returns partial addresses when not enough address information exists in the request. Partial addresses apply to forward geocoding (not reverse geocoding).
The default value is false.
| resultSetRange | property |
public var resultSetRange:ResultSetRangeThe range of results to be returned.
| snapType | property |
public var snapType:StringThe reverse geocoding snap types to use with the findAddressByPoint method (Address Finder). Valid values are "house", "intersection", or "range". House returns the nearest interpolated full street address; intersection returns the nearest intersection; and range returns the nearest street segment address range. Snap types apply to reverse geocoding (not forward geocoding).
The default value is "house".
<?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>