Class: ClosestFacilitySolveResult

Description

Class added v2.0.

The result from a ClosestFacilityTask operation.

Note: ClosestFacilitySolveResult, and other closest facility related classes, requires ArcGIS Server 10.0 or above and a closest facility layer. A closest facility layer is a layer of type esriNAServerClosestFacilityLayer.

Samples

Search for samples that use this class.  

Class hierarchy

esri.tasks.ClosestFacilitySolveResult

Properties

Property Type Description
directions DirectionsFeatureSet An array of directions. A direction is an instance of esri.tasks.DirectionFeatureSest. Route directions are returned if returnDirections was set to true, the default is false.
facilities Point[] An array of points, only returned when ClosestFacilityParameters.returnFacilities is true.
incidents Point[] An array of points, only returned when ClosestFacilityParameters.returnIncidents is true.
messages esri.tasks.NAMessage 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.
pointBarriers Point[] The point barriers are an array of points. They are returned only if ClosestFacilityParameters.returnPointBarriers was set to true (which is not the default). If you send in the point barriers as a featureSet (instead of using DataLayer), you already have the barrers and might not need to request them back from the server.
polygonBarriers Polygon[] The polygon barriers are an array of polygons. They are returned only if ClosestFacilityParameters.returnPolygonBarriers was set to true (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.
polylineBarriers Polyline[] The polyline barriers are an array of polylines. They are returned only if ClosestFacilityParameters.returnPolylineBarriers was set to true (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.
routes Polyline[] The array of routes. Route features are returned if returnRoutes is true and outputLines does not equal esriNAOutputLineNone.
Properties Detail

<DirectionsFeatureSet> directions

An array of directions. A direction is an instance of esri.tasks.DirectionFeatureSest. Route directions are returned if returnDirections was set to true, the default is false.
Code snippets:
var directions = solveResult.directions;

<Point[]> facilities

An array of points, only returned when ClosestFacilityParameters.returnFacilities is true.

<Point[]> incidents

An array of points, only returned when ClosestFacilityParameters.returnIncidents is true.
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.

<Point[]> pointBarriers

The point barriers are an array of points. They are returned only if ClosestFacilityParameters.returnPointBarriers was set to true (which is not the default). If you send in the point barriers as a featureSet (instead of using DataLayer), you already have the barrers and might not need to request them back from the server.

<Polygon[]> polygonBarriers

The polygon barriers are an array of polygons. They are returned only if ClosestFacilityParameters.returnPolygonBarriers was set to true (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.

<Polyline[]> polylineBarriers

The polyline barriers are an array of polylines. They are returned only if ClosestFacilityParameters.returnPolylineBarriers was set to true (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.

<Polyline[]> routes

The array of routes. Route features are returned if returnRoutes is true and outputLines does not equal esriNAOutputLineNone.
Code snippets:
closestFacilityTask.solve(params,function(solveResult){
  dojo.forEach(solveResult.routes,function(route,index){
    var graphic = new esri.Graphic(route);
    routeGraphicLayer.add(graphic);
  });