| 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, e.g. 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
The last result of the addressToLocations function execution.
| Locator | ||
![]() | concurrency : String = "multiple"
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 | ||
![]() | proxyURL : String
The URL to proxy the request through.
| BaseTask | |
![]() | requestTimeout : Number = -1
The request timeout in seconds.
| BaseTask | |
![]() | showBusyCursor : Boolean = false
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 |
public var addressToLocationsLastResult:ArrayThe last result of the addressToLocations function execution.
This property can be used as the source for data binding.
See also
| locationToAddressLastResult | property |
public var locationToAddressLastResult:AddressCandidateThe result from the most recent locationToAddress call.
This property can be used as the source for data binding.
| 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 map layer.
|
| 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.
Parametersaddress: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.
Parameterslocation:MapPoint — The point at which to search for the closest address. The location should be in the same spatial reference as that of the geocode service.
|
|
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. Default is 0 meters.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
locateTask.locationToAddress(myMapPoint, 100); |
AsyncToken |
| addressToLocationsComplete | event |
com.esri.ags.events.LocatorEvent
com.esri.ags.events.LocatorEvent.ADDRESS_TO_LOCATIONS_COMPLETE
Dispatched when an addressToLocations operation successfully completes.
Defines the value of the type property of an addressToLocationsComplete event object.
| fault | event |
mx.rpc.events.FaultEvent
Dispatched when a Locator request fails. Applies to both methods.
| locationToAddressComplete | event |
com.esri.ags.events.LocatorEvent
com.esri.ags.events.LocatorEvent.LOCATION_TO_ADDRESS_COMPLETE
Dispatched when a locationToAddress operation successfully completes.
Defines the value of the type property of a locationToAddressComplete event object.