public class Locator
extends com.google.gwt.core.client.JavaScriptObject
Modifier and Type | Class and Description |
---|---|
static class |
Locator.Parameters
Class for adding sending outFields in addressToLocations()
|
Modifier and Type | Method and Description |
---|---|
void |
addAddressToLocationsHandler(AddressToLocationsHandler handler)
Add event handler for addressToLocations
|
void |
addErrorHandler(ErrorHandler handler)
Add event handler for errors
|
void |
addLocationToAddressHandler(LocationToAddressHandler handler)
Add event handler for locationToAddress
|
Deferred |
addressToLocations(Locator.Parameters params)
Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address
argument.
|
Deferred |
addressToLocations(Locator.Parameters params,
AddressToLocationsCallback callback)
Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address
argument.
|
static Locator |
create(java.lang.String url)
Creates a new Locator object.
|
SpatialReference |
getOutSpatialReference()
The spatial reference of the output geometries.
|
java.lang.String |
getUrl()
URL to the ArcGIS Server REST resource that represents a locator service
|
Deferred |
locationToAddress(Point location,
double distance)
Locates an address based on a given point.
|
Deferred |
locationToAddress(Point location,
double distance,
LocationToAddressCallback callback)
Locates an address based on a given point.
|
void |
setOutSpatialReference(SpatialReference outSpatialReference)
Sets the well-known ID of the spatial reference of the output geometries.
|
public static Locator create(java.lang.String url)
url
- - URL to the ArcGIS Server REST resource that represents a locator service. An example is
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer.public final SpatialReference getOutSpatialReference()
public final java.lang.String getUrl()
public final Deferred addressToLocations(Locator.Parameters params, AddressToLocationsCallback callback)
params
- - Specify the address and optionally specify the outFields and searchExtent. The searchExtent parameter requires
a locator published with ArcGIS Server 10.1 or greater.callback
- - The function to call when the method has completed or if an error object is returned if an error occurs
on the Server during task executionpublic final Deferred addressToLocations(Locator.Parameters params)
params
- - Specify the address and optionally specify the outFields and searchExtent. The searchExtent parameter
requires a locator published with ArcGIS Server 10.1 or greater.public final Deferred locationToAddress(Point location, double distance, LocationToAddressCallback callback)
location
- - 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
- - 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.callback
- - The function to call when the method has completed or if an error object is returned if an error
occurs on the Server during task execution.public final Deferred locationToAddress(Point location, double distance)
location
- - 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
- - 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.public final void setOutSpatialReference(SpatialReference outSpatialReference)
outSpatialReference
- - The well-known ID of a spatial reference.public final void addAddressToLocationsHandler(AddressToLocationsHandler handler)
handler
- - Fires when Locator.addressToLocation() has completed.public final void addErrorHandler(ErrorHandler handler)
handler
- - Fires when an error occurs when executing the task.public final void addLocationToAddressHandler(LocationToAddressHandler handler)
handler
- - Fires when Locator.locationToAddress() has completed.