The result from esri/rest/ClosestFacilityTask.
ClosestFacilitySolveResult, and other closest facility related classes, requires a closest facility layer.
A closest facility layer is a layer of type esriNAServerClosestFacilityLayer
.
- See also:
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | more details The name of the class. | more details | Accessor | |
DirectionsFeatureSet[] | more details An array of directions. | more details | ClosestFacilitySolveResult | |
Point[] | more details An array of points representing facilities. | more details | ClosestFacilitySolveResult | |
Point[] | more details An array of points representing incidents. | more details | ClosestFacilitySolveResult | |
NAMessage[] | more details Message received when the solve is complete. | more details | ClosestFacilitySolveResult | |
Point[] | more details The point barriers are an array of points. | more details | ClosestFacilitySolveResult | |
Polygon[] | more details The polygon barriers are an array of polygons. | more details | ClosestFacilitySolveResult | |
Polyline[] | more details The polyline barriers are an array of polylines. | more details | ClosestFacilitySolveResult | |
Graphic[] | more details The array of graphics representing routes. | more details | ClosestFacilitySolveResult |
Property Details
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
directions DirectionsFeatureSet[]
-
An array of directions. A direction is an instance of DirectionsFeatureSet. Route directions are returned if
returnDirections = true
(default is false).
-
An array of points representing facilities. Only returned when
ClosestFacilityParameters.returnFacilities = true
.
-
An array of points representing incidents. Only returned when
ClosestFacilityParameters.returnIncidents = true
.- See also:
-
Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved.
-
The point barriers are an array of points. They are returned only if
ClosestFacilityParameters.returnPointBarriers
was set totrue
(which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server.- See also:
-
The polygon barriers are an array of polygons. They are returned only if
ClosestFacilityParameters.returnPolygonBarriers
was set totrue
(which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server.- See also:
-
The polyline barriers are an array of polylines. They are returned only if
ClosestFacilityParameters.returnPolylineBarriers
was set totrue
(which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server.- See also:
-
The array of graphics representing routes.
Route graphics are returned if
returnRoutes
istrue
andoutputLines
does not equalnone
.Example:let routeGraphicLayer = new GraphicsLayer(); let closestFacilityTask = new ClosestFacilityTask(url); let params = new ClosestFacilityParameters({ returnRoutes: true, outputLines: "true-shape", ... }); closestFacilityTask.solve(params).then(function(solveResult) { solveResult.routes.forEach(function(route, index) { routeGraphicLayer.add(route); }); });
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
* | more details Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. | more details | ClosestFacilitySolveResult | |
Object | more details Converts an instance of this class to its ArcGIS portal JSON representation. | more details | ClosestFacilitySolveResult |
Method Details
-
fromJSON(json){*}static
-
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameter:json ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns:Type Description * Returns a new instance of this class.
-
toJSON(){Object}
-
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
Returns:Type Description Object The ArcGIS portal JSON representation of an instance of this class.