Class: ServiceAreaTask

Description

Class added v2.0.
dojo.require("esri.tasks.servicearea");

Helps you find service areas around any location on a network. A network service area is a region that encompasses all accessible streets that is, streets that are within a specified impedance. For instance, the 5-minute service area for a point includes all the streets that can be reached within five minutes from that point.

Note: ServiceAreaTask, and other service area related classes, requires ArcGIS Server 10.0 or above and a service area layer. A service area layer is a layer of type esriNAServerServiceAreaLayer.

See also:
Service area analysis ArcGIS Desktop help topic.

Samples

Search for
samples that use this class.  

Class hierarchy

esri.tasks.ServiceAreaTask

Constructor

Constructor Description
esri.tasks.ServiceAreaTask() Creates a new ServiceAreaTask object.

Methods

Method Return Value Description
solve(params, callback?, errback?) dojo.Deferred Solve the service area.

Events

Event Description
onSolveComplete(serviceAreaSolveResult) Fired when the ServiceAreaTask solve is complete.
Constructor Detail

esri.tasks.ServiceAreaTask()

Creates a new ServiceAreaTask object.
Options:
<String> url URL to the ArcGIS Server REST resource that represents a network analysis service. Use the Service Directory to obtain the URL.
Code snippets:
serviceAreaTask = new esri.tasks.ServiceAreaTask("http://servicesbeta.esri.com/ArcGIS/rest/services/Network/USA/NAServer/Service Area");
Methods Detail

solve(params, callback?, errback?)

Solve the service area. (As of v2.0)
Return value: dojo.Deferred
Input Parameters:
<ServiceAreaParameters> params Required The ServiceAreaParameters object.
<Function> callback Optional The function to call when the method has completed. The arguments in the function are the same as the onSolveComplete event.
<Function> errback Optional An error object is returned if an error occurs on the Server during task execution.
Code snippets:
 serviceAreaTask.solve(params,function(serviceAreaSolveResult){
  var result = serviceAreaSolveResult;
  //do something with the results here
 });

Events Detail

onSolveComplete(serviceAreaSolveResult)

Fired when the ServiceAreaTask solve is complete.
Arguments:
<ServiceAreaSolveResult> serviceAreaSolveResult The results from the ServiceAreaTask solve operation.