Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: DirectionsFeatureSet

require(["esri/tasks/DirectionsFeatureSet"], function(DirectionsFeatureSet) { /* code goes here */ });

Description

(Added at v1.4)
A FeatureSet that has properties specific to routing. The FeatureSet.features property contains the turn by turn directions text and geometry of the route. The attributes for each feature provide information associated with the corresponding route segment. The following attributes are returned:
  • text - The direction text.
  • length - The length of the route segment.
  • time - The time to travel along the route segment.
  • ETA - The estimated time of arrival at the route segment in the local time.
  • maneuverType - The type of maneuver that the direction represents.

DirectionsFeatureSet has no constructor.

NOTE: For a more updated approach to working with directions, please see the Working with the Directions Widget topic.

Samples

Search for samples that use this class.

Class hierarchy

esri/tasks/FeatureSet
|_esri/tasks/DirectionsFeatureSet

Properties

NameTypeSummary
displayFieldNameStringThe name of the layer's primary display field.
exceededTransferLimitBooleanTypically a layer has a limit on the number of features (i.e., records) returned by the query operation.
extentExtentThe extent of the route.
featuresGraphic[]The array of graphics returned.
fieldAliasesObjectSet of name-value pairs for the attribute's field and alias names.
fieldsObject[]The array of fields.
geometryTypeStringThe geometry type of the FeatureSet.
mergedGeometryPolylineA single polyline representing the route.
routeIdStringThe ID of the route returned from the server.
routeNameStringName specified in RouteParameters.stops.
spatialReferenceSpatialReferenceWhen a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default.
stringsObject[]Lists additional information about the direction depending on the value of directionsOutputType. .
totalDriveTimeNumberActual drive time calculated for the route.
totalLengthNumberThe length of the route as specified in RouteParameters.directionsLengthUnits.
totalTimeNumberThe total time calculated for the route as specified in RouteParameters.directionsTimeAttribute.
Property Details

<String> displayFieldName

The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. Only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task.

<Boolean> exceededTransferLimit

Typically a layer has a limit on the number of features (i.e., records) returned by the query operation. See FeatureLayer.maxRecordCount property. If maxRecordCount is configured for a layer, exceededTransferLimit will be true if a query matches more than the maxRecordCount features and false otherwise. Supported by ArcGIS Server version 10.1 and later. (Added at v2.8)
Known values: true | false

<Extent> extent

The extent of the route.

<Graphic[]> features

The array of graphics returned.
Sample:
require([
  "esri/graphic", "esri/tasks/FeatureSet", ... 
], function(Graphic, FeatureSet, ... ) {
  var graphic = new Graphic( ... );
  var features= [];
  features.push(graphic);
  var featureSet = new FeatureSet();
  featureSet.features = features;
  ...
});

<Object> fieldAliases

Set of name-value pairs for the attribute's field and alias names.

<Object[]> fields

The array of fields. (Added at v3.18)

<String> geometryType

The geometry type of the FeatureSet.

<Polyline> mergedGeometry

A single polyline representing the route.

<String> routeId

The ID of the route returned from the server.

<String> routeName

Name specified in RouteParameters.stops.

<SpatialReference> spatialReference

When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references.

<Object[]> strings

Lists additional information about the direction depending on the value of directionsOutputType.  (Added at v3.3)

<Number> totalDriveTime

Actual drive time calculated for the route.

<Number> totalLength

The length of the route as specified in RouteParameters.directionsLengthUnits.

<Number> totalTime

The total time calculated for the route as specified in RouteParameters.directionsTimeAttribute.