ClosestFacilitySolveResult
esri/tasks/support/ClosestFacilitySolveResult
The result from ClosestFacilityTask.
ClosestFacilitySolveResult, and other closest facility related classes, requires a closest facility layer. A closest facility layer is a layer of type esriNAServerClosestFacilityLayer
.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
DirectionsFeatureSet | An array of directions. more details | more details | ClosestFacilitySolveResult | |
Point[] | An array of points representing facilities. more details | more details | ClosestFacilitySolveResult | |
Point[] | An array of points representing incidents. more details | more details | ClosestFacilitySolveResult | |
NAMessage[] | Message received when the solve is complete. more details | more details | ClosestFacilitySolveResult | |
Point[] | The point barriers are an array of points. more details | more details | ClosestFacilitySolveResult | |
Polygon[] | The polygon barriers are an array of polygons. more details | more details | ClosestFacilitySolveResult | |
Polyline[] | The polyline barriers are an array of polylines. more details | more details | ClosestFacilitySolveResult | |
Graphic[] | The array of routes. more details | more details | ClosestFacilitySolveResult |
Property Details
- Since: ArcGIS API for JavaScript 4.7
The name of the class. The declared class name is formatted as
esri.folder.className
.
- directionsDirectionsFeatureSet
An array of directions. A direction is an instance of DirectionsFeatureSet. Route directions are returned if
returnDirections = true
(default is false).
- facilitiesPoint[]
An array of points representing facilities. Only returned when
ClosestFacilityParameters.returnFacilities = true
.
- incidentsPoint[]
An array of points representing incidents. Only returned when
ClosestFacilityParameters.returnIncidents = true
.
- messages
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.
- pointBarriersPoint[]
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.
- polygonBarriersPolygon[]
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.
- polylineBarriersPolyline[]
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.
- routesGraphic[]
The array of routes. Route graphics are returned if
returnRoutes = true
andoutputLines
does not equalnone
. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics.Example:require([ "esri/layers/GraphicsLayer", "esri/tasks/ClosestFacilityTask", "dojo/_base/array", ... ], function(GraphicsLayer, ClosestFacilityTask, array, ... ) { var routeGraphicLayer = new GraphicsLayer( ... ); var closestFacilityTask = new ClosestFacilityTask(); closestFacilityTask.solve(params).then(function(solveResult){ array.forEach(solveResult.routes, function(route, index){ routeGraphicLayer.add(route); }); ... }); });
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
* | Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. more details | more details | ClosestFacilitySolveResult | |
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | 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 a product in the ArcGIS platform. 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() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS portal JSON representation of an instance of this class.