| Package | com.esri.aws.services |
| Class | public class GeocodeCandidate |
| Property | Defined by | ||
|---|---|---|---|
| address : Address
The address or intersection of the place.
| GeocodeCandidate | ||
| desc1 : String
The scrubbed address (e.g., 380 New York St.
| GeocodeCandidate | ||
| desc2 : String
The short description of the place (e.g., Redlands).
| GeocodeCandidate | ||
| extent : Envelope
The envelope (coordSys maxX, maxY, minX, minY) of the place.
| GeocodeCandidate | ||
| latLon : GeoPoint
The lat,lon coordinates of the place.
| GeocodeCandidate | ||
| matchType : String
The type of match for the address location.
| GeocodeCandidate | ||
| score : Number
The score number from 1 to 20 in the form X.X indicating the likelihood of a match to the place, with 1 being the most likely and 20 being the least likely.
| GeocodeCandidate | ||
| type : String
The geocode code indicating the type of place.
| GeocodeCandidate | ||
| address | property |
public var address:AddressThe address or intersection of the place. Addresses are only returned by Address Finder.
| desc1 | property |
public var desc1:StringThe scrubbed address (e.g., 380 New York St. Redlands, CA 92373) or long description of the place (e.g., Redlands, California, United States).
| desc2 | property |
public var desc2:StringThe short description of the place (e.g., Redlands). Time zones are returned with Address Finder getLocationByPhoneNumber requests. Only returned with place names.
| extent | property |
public var extent:EnvelopeThe envelope (coordSys maxX, maxY, minX, minY) of the place. Only returned with place names.
| latLon | property |
public var latLon:GeoPointThe lat,lon coordinates of the place.
| matchType | property |
public var matchType:StringThe type of match for the address location. Used when either an address or a phone number is returned.
See also
| score | property |
public var score:NumberThe score number from 1 to 20 in the form X.X indicating the likelihood of a match to the place, with 1 being the most likely and 20 being the least likely. For convenience, the returned records are sorted by score. Only returned with place names (address score returned as 0.0)
| type | property |
public var type:StringThe geocode code indicating the type of place. Only returned with places.
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 PlaceFinder Report"
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.IPlaceFinder;
import com.esri.aws.services.PlaceFinderOptions;
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 placeTracker:ServiceTracker;
private function onComplete():void
{
placeTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IPlaceFinder));
placeTracker.open();
}
private function doSearch():void
{
var placeService:IPlaceFinder = placeTracker.getService() as IPlaceFinder;
if(placeService)
{
//build some simple options
var pfOptions:PlaceFinderOptions = new PlaceFinderOptions();
pfOptions.dataSource = "auto"; // ArcWeb:ESRI.Gazetteer.World
//call the PlaceFinder service using 'this' as the responder.
placeService.findPlace(locationText.text,pfOptions,this);
m_info.htmlText = "Sending request ...";
}
}
public function result(data:Object):void
{
var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
m_info.htmlText = "<i>Showing " + m_geocodeInfo.candidates.length ;
m_info.htmlText += " of " + m_geocodeInfo.totalCount + ".</i><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.type + "]<br>";
}
}
else
{
m_info.htmlText += "<b>No matches.";
}
}
public function fault(info:Object):void
{
Alert.show(info.toString());
}
]]>
</mx:Script>
<awx:Framework id="m_framework" apiKey="[MY-API-KEY]" >
<awx:PlaceFinderActivator/>
</awx:Framework>
<mx:Panel paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"
width="100%"
title="Place Finder Search" layout="horizontal">
<mx:TextInput width="95%" id="locationText" text="Paradise" enter="doSearch()"/>
<mx:Button label="Find Place" click="doSearch()" id="m_button" />
</mx:Panel>
<mx:Text id="m_info" fontSize="14" top="80"/>
</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>