| Package | com.esri.ags.tasks |
| Class | public class Locator |
| Inheritance | Locator BaseTask flash.events.EventDispatcher |
Set the URL to the ArcGIS Server REST resource that represents a Locator service, for example, http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA/GeocodeServer. For more information on constructing a URL, see Using the ArcGIS Services Directory.
See also
| Property | Defined By | ||
|---|---|---|---|
| addressToLocationsLastResult : Array
Array of AdressCandidate object returned from last call to the addressToLocations function. | Locator | ||
![]() | autoNormalize : Boolean
If true, normalizes the geometries across the central meridian. | BaseTask | |
![]() | concurrency : String
Value that indicates how to handle multiple calls to the same task. | BaseTask | |
![]() | disableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from
being loaded from the browser's cache. | BaseTask | |
| locationToAddressLastResult : AddressCandidate
The result from the most recent locationToAddress call. | Locator | ||
![]() | method : String
URL request method to use. | BaseTask | |
| outSpatialReference : SpatialReference
The spatial reference of the output geometries. | Locator | ||
![]() | proxyURL : String
The URL to proxy the request through. | BaseTask | |
![]() | requestTimeout : int
The request timeout in seconds. | BaseTask | |
![]() | showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing. | BaseTask | |
![]() | token : String
Token for accessing a secure task. | BaseTask | |
![]() | url : String
URL of the task. | BaseTask | |
| Method | Defined By | ||
|---|---|---|---|
Locator(url:String = null)
Creates a new Locator object. | Locator | ||
addressToLocations(address:Object, outFields:Array = null, responder:IResponder = null):AsyncToken
Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address argument. | Locator | ||
locationToAddress(location:MapPoint, distance:Number = 0, responder:IResponder = null):AsyncToken
Locates an address based on a given point. | Locator | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when an addressToLocations operation successfully completes. | Locator | |||
| Dispatched when a Locator request fails. | Locator | |||
| Dispatched when a locationToAddress operation successfully completes. | Locator | |||
| addressToLocationsLastResult | property |
addressToLocationsLastResult:ArrayArray of AdressCandidate object returned from last call to the addressToLocations function.
This property can be used as the source for data binding.
public function get addressToLocationsLastResult():Array public function set addressToLocationsLastResult(value:Array):voidSee also
| locationToAddressLastResult | property |
locationToAddressLastResult:AddressCandidateThe result from the most recent locationToAddress call.
This property can be used as the source for data binding.
public function get locationToAddressLastResult():AddressCandidate public function set locationToAddressLastResult(value:AddressCandidate):void| outSpatialReference | property |
outSpatialReference:SpatialReferenceThe spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the Locator service. Only available with ArcGIS Server 10.0 and higher.
This property can be used as the source for data binding.
public function get outSpatialReference():SpatialReference public function set outSpatialReference(value:SpatialReference):void| Locator | () | Constructor |
public function Locator(url:String = null)Creates a new Locator object.
Parametersurl:String (default = null) — [optional] URL to the ArcGIS Server REST resource that represents a Locator service.
|
| addressToLocations | () | method |
public function addressToLocations(address:Object, outFields:Array = null, responder:IResponder = null):AsyncTokenSends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address argument. On completion, the addressToLocationsComplete event is fired and the optional callback responder is invoked.
Parameters
address:Object — The address object.
| |
outFields:Array (default = null) — The array of fields to include in the returned result set. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields.
| |
responder:IResponder (default = null) — The responder to call on result or fault.
locateTask.addressToLocations(myAddress, myOutFields, new AsyncResponder(onResult, onFault)); |
AsyncToken |
| locationToAddress | () | method |
public function locationToAddress(location:MapPoint, distance:Number = 0, responder:IResponder = null):AsyncTokenLocates an address based on a given point.
Parameters
location:MapPoint — The point at which to search for the closest address.
| |
distance:Number (default = 0) — The distance in meters from the given location within which a matching address should be searched. If this parameter is not provided or an invalid value is provided, a default value of 0 meters is used.
| |
responder:IResponder (default = null) — The responder to call on result or fault.
locateTask.locationToAddress(myMapPoint, 100); |
AsyncToken |
| addressToLocationsComplete | Event |
com.esri.ags.events.LocatorEventcom.esri.ags.events.LocatorEvent.ADDRESS_TO_LOCATIONS_COMPLETEDispatched when an addressToLocations operation successfully completes.
Defines the value of thetype property of an addressToLocationsComplete event object.
| fault | Event |
mx.rpc.events.FaultEventmx.rpc.events.FaultEvent.FAULTDispatched when a Locator request fails. Applies to both methods.
| locationToAddressComplete | Event |
com.esri.ags.events.LocatorEventcom.esri.ags.events.LocatorEvent.LOCATION_TO_ADDRESS_COMPLETEDispatched when a locationToAddress operation successfully completes.
Defines the value of thetype property of a locationToAddressComplete event object.