| Package | com.esri.aws.services |
| Interface | public interface IAddressFinder |
See also
| Method | Defined by | ||
|---|---|---|---|
|
findAddressByPoint(point:GeoPoint, addressFinderOptions:AddressFinderOptions, responder:IResponder):void
Returns an address for a lat,lon coordinate.
| IAddressFinder | ||
|
findLocationByAddress(address:Address, addressFinderOptions:AddressFinderOptions, responder:IResponder):void
Returns a lat,lon coordinate for an address.
| IAddressFinder | ||
|
findLocationByIP(ipAddress:String, addressFinderOptions:AddressFinderOptions, responder:IResponder):void
Returns a lat,lon coordinate for an IP address.
| IAddressFinder | ||
|
findLocationByPhoneNumber(phoneNumber:String, addressFinderOptions:AddressFinderOptions, responder:IResponder):void
Returns location information for a phone number.
| IAddressFinder | ||
| findAddressByPoint | () | method |
public function findAddressByPoint(point:GeoPoint, addressFinderOptions:AddressFinderOptions, responder:IResponder):voidReturns an address for a lat,lon coordinate.
Parameterspoint:GeoPoint — the lat,lon location upon where to reverse geocode
|
|
addressFinderOptions:AddressFinderOptions — geocoding options
|
|
responder:IResponder — the responder to be called with result/fault
|
See also
<?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>
| findLocationByAddress | () | method |
public function findLocationByAddress(address:Address, addressFinderOptions:AddressFinderOptions, responder:IResponder):voidReturns a lat,lon coordinate for an address.
Parametersaddress:Address — the address to geocode
|
|
addressFinderOptions:AddressFinderOptions — geocoding options
|
|
responder:IResponder — the responder to be called with result/fault
|
See also
| findLocationByIP | () | method |
public function findLocationByIP(ipAddress:String, addressFinderOptions:AddressFinderOptions, responder:IResponder):voidReturns a lat,lon coordinate for an IP address.
ParametersipAddress:String — the IP address to geocode
|
|
addressFinderOptions:AddressFinderOptions — geocoding options
|
|
responder:IResponder — the responder to be called with result/fault
|
See also
<?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 AddressFinder by IP Request"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.services.GeocodeCandidate;
import com.esri.aws.services.GeocodeInfo;
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)
{
//build some simple options
var m_options:AddressFinderOptions = new AddressFinderOptions();
m_options.dataSource = "auto"; // ArcWeb:DE.IP.World
//call the AddressFinder service using 'this' as the responder.
findService.findLocationByIP(locationText.text,m_options,this);
m_info.htmlText = "Sending request ...";
}
}
public function result(data:Object):void
{
var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
m_info.htmlText = "Request completed:<br/>";
candidates = new ArrayCollection(m_geocodeInfo.candidates);
if (candidates.length > 0 )
{
for(var i:int=0; i< candidates.length; i++)
{
var gc:GeocodeCandidate = candidates[i];
m_info.htmlText += "<b>" + gc.desc1 + "</b> at <b>"
+ gc.latLon.y + "," + gc.latLon.x + "</b> [" + gc.matchType + "]<br>";
}
}
else
{
m_info.htmlText += "<b>No matches.";
}
}
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="Find Location by IP" layout="horizontal">
<mx:TextInput width="95%" id="locationText" text="203.199.93.39" enter="doSearch()"/>
<mx:Button label="Find IP" click="doSearch()" id="m_button" />
</mx:Panel>
<mx:Text id="m_info" fontSize="14" top="100"/>
</mx:Application>
| findLocationByPhoneNumber | () | method |
public function findLocationByPhoneNumber(phoneNumber:String, addressFinderOptions:AddressFinderOptions, responder:IResponder):voidReturns location information for a phone number.
ParametersphoneNumber:String — the phone number to geocode. This must be a land line not a mobile phone.
|
|
addressFinderOptions:AddressFinderOptions — geocoding options
|
|
responder:IResponder — the responder to be called with result/fault
|
See also
<?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>
<?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 AddressFinder by IP Request"
implements="mx.rpc.IResponder"
creationComplete="onComplete()"
>
<mx:Script>
<![CDATA[
import com.esri.aws.osgi.framework.ServiceTracker;
import com.esri.aws.services.GeocodeCandidate;
import com.esri.aws.services.GeocodeInfo;
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)
{
//build some simple options
var m_options:AddressFinderOptions = new AddressFinderOptions();
m_options.dataSource = "auto"; // ArcWeb:DE.IP.World
//call the AddressFinder service using 'this' as the responder.
findService.findLocationByIP(locationText.text,m_options,this);
m_info.htmlText = "Sending request ...";
}
}
public function result(data:Object):void
{
var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
m_info.htmlText = "Request completed:<br/>";
candidates = new ArrayCollection(m_geocodeInfo.candidates);
if (candidates.length > 0 )
{
for(var i:int=0; i< candidates.length; i++)
{
var gc:GeocodeCandidate = candidates[i];
m_info.htmlText += "<b>" + gc.desc1 + "</b> at <b>"
+ gc.latLon.y + "," + gc.latLon.x + "</b> [" + gc.matchType + "]<br>";
}
}
else
{
m_info.htmlText += "<b>No matches.";
}
}
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="Find Location by IP" layout="horizontal">
<mx:TextInput width="95%" id="locationText" text="203.199.93.39" enter="doSearch()"/>
<mx:Button label="Find IP" click="doSearch()" id="m_button" />
</mx:Panel>
<mx:Text id="m_info" fontSize="14" top="100"/>
</mx:Application>