Input parameters for a ServiceAreaTask.
Note: ServiceAreaParameters, 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.
esri.tasks.ServiceAreaParameters
| Constructor | Description |
|---|---|
| esri.tasks.ServiceAreaParameters() | Creates a new ServiceAreaParameters object. |
| Property | Type | Description |
|---|---|---|
| accumulateAttributes | String[] | The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. |
| attributeParameterValues | Object[] | An array of attribute parameter values that can be used to determine which network elements can be used by a vehicle. |
| defaultBreaks | Number[] | An array of numbers defining the breaks. The default value is defined in the network analysis layer . |
| excludeSourcesFromPolygons | String[] | An array of network source names to NOT use when generating polygons. |
| facilities | Object | The set of facilities loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet. |
| impedanceAttribute | String | The network attribute name used as the impedence attribute in analysis. |
| mergeSimilarPolygonRanges | Boolean | If true, similar ranges will be merged in the result polygons. |
| outputGeometryPrecision | Number | The precision of the output geometry after generalization. |
| outputGeometryPrecisionUnits | String | The units of the output geometry precision. The default value is esriUnknownUnits. |
| outputLines | String | The type of output lines to be generated in the result |
| outputPolygons | String | The type of output polygons to be generated in the result |
| outSpatialReference | SpatialReference | The well-known ID of the spatial reference for the geometries returned with the analysis results. If outSpatialReference is not specified, the geometries are returned in the spatial reference of the map. |
| overlapLines | Boolean | Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your ServiceAreaTask. |
| overlapPolygons | Boolean | Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your ServiceAreaTask. |
| pointBarriers | Object | The set of point barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet. |
| polygonBarriers | Object | The set of polygons barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet. |
| polylineBarriers | Object | The set of polyline barriers loaded as network locations during analysis. Can be either an instance of esri.tasks.DataLayer or esri.tasks.FeatureSet. |
| restrictionAttributes | String[] | The list of network attribute names to be used as restrictions with the analysis |
| restrictUTurns | String | Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your RouteTask.See NAUTurn for a list of valid values. |
| returnFacilities | Boolean | If true, facilities will be returned with the analysis results. Default value is false. |
| returnPointBarriers | Boolean | If true, barriers will be returned in the barriers property of ClosestFacilitySolveResult. The default value is false. |
| returnPolygonBarriers | Boolean | If true, polygon barriers will be returned in the polygonBarriers property of ClosestFacilitySolveResult. The default value is false. |
| returnPolylineBarriers | Boolean | If true, polyline barriers will be returned in the polylineBarriers property of ClosestFacilitySolveResult. The default value is false. |
| splitLinesAtBreaks | Boolean | If true, lines will be split at breaks. |
| splitPolygonsAtBreaks | Boolean | If true, polygons will be split at breaks. |
| travelDirection | String | Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values. |
| trimOuterPolygon | Boolean | If true, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your ServiceAreaTask. |
| trimPolygonDistance | Number | If polygons are being trimmed, provides the distance to trim. The default is defined in the network analysis layer. |
| trimPolygonDistanceUnits | String | If polygons are being trimmed, specifies the units of the trimPolygonDistance. The default is defined in the network analysis layer. |
| <String> url | URL to the ArcGIS Server REST resource that represents a network analysis service. Use the Service Directory to obtain the URL. |
params = new esri.tasks.ServiceAreaParameters(); params.defaultBreaks= [2]; params.outSpatialReference = map.spatialReference; params.returnFacilities = false;
params.defaultBreaks= [1,2];
var features = []; features.push(new esri.Graphic(inPoint,pointSymbol)); var facilities = new esri.tasks.FeatureSet(); facilities.features = features; paramsfacilities = facilities;
The network attribute name used as the impedence attribute in analysis.The default is as defined in the specific routing network layer used in your RouteTask. You can specify any attributes names listed in the Service Directory under Network Dataset > Network Attributes as Usage Type: esriNAUTCost. You can also specify a value of none to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service.
For example, set impedanceAttribute=Time for quickest route and impedanceAttribute=Length for shortest drive. Assuming the service has those two esriNAUTCost attributes.
View the Understanding the network attribute ArcGIS desktop help topic for more details.myRouteParams.restrictionAttributes = ["OneWay"];Do not use the service defaults for restrictions:
myRouteParams.restrictionAttributes = ["none"];