Extends L.
A generic class representing a hosted resource on ArcGIS Online or ArcGIS Server. This class can be extended to provide support for making requests and serves as a standard for authentication and proxying.
Constructor
| Constructor | Description |
|---|---|
L.esri.service( | Options includes a url parameter which refers to the ArcGIS Server or ArcGIS Online service you would like to consume. |
Options
| Option | Type | Default | Description |
|---|---|---|---|
url | String | '' | URL of the ArcGIS service you would like to consume. |
proxy | String | false | URL of an ArcGIS Maps SDK for JavaScript proxy or ArcGIS Resource Proxy to use for proxying POST requests. |
use | Boolean | true | If this service should use CORS when making GET requests. |
timeout | Number | Milliseconds before a request to the service is automatically terminated. | |
request | Object | null | Used to pass through arbitrary request parameters to services. |
Events
| Event | Type | Description |
|---|---|---|
requeststart | <Request | Fired when a request to the service begins. |
requestend | <Request | Fired when a request to the service ends. |
requestsuccess | <Request | Fired when a request to the service was successful. |
requesterror | <Request | Fired when a request to the service responds with an error. |
authenticationrequired | <Authentication | This will be fired when a request to the service fails and requires authentication. |
Methods
| Method | Returns | Description |
|---|---|---|
get( | this | Makes a GET request to the service. The service's URL will be combined with the path option and parameters will be serialized to a query string. Accepts an optional function context for the callback. |
post( | this | Makes a POST request to the service. The service's URL will be combined with the path option and parameters will be serialized. Accepts an optional function context for the callback. |
metadata( | this | Requests the metadata about the service. This is an alias for get("/", {}, callback, context). |
authenticate( | this | Authenticates this service with a new token and runs any pending requests that required a token. |