Hide Table of Contents
esri
Map
toolbars
Class: FeatureSet
[ AMD Module Require | Legacy Module Require ]

Description

A collection of features returned from ArcGIS Server or used as input to tasks. Each feature in the FeatureSet may contain geometry, attributes, symbology, and an InfoTemplate. If the FeatureSet does not contain geometry, and only contains attributes, the FeatureSet can be treated as a table where each feature is a row object. Tasks that return FeatureSet include QueryTask, Geoprocessor, and RouteTask. In addition, Geoprocessor and RouteTask may require FeatureSet as input.

Samples

Search for samples that use this class.

Class hierarchy

esri.tasks.FeatureSet

Subclasses

DirectionsFeatureSet

Constructors

ConstructorDescription
new esri.tasks.FeatureSet()Creates a new FeatureSet object. The constructor takes no parameters.
new esri.tasks.FeatureSet(json)Creates a new FeatureSet object using a JSON object.

Properties

PropertyTypeDescription
displayFieldNameStringThe 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.
exceededTransferLimitNumber
featuresGraphic[]The array of graphics returned.
fieldAliasesObjectSet of name-value pairs for the attribute's field and alias names.
geometryTypeStringThe geometry type of the FeatureSet.
spatialReferenceSpatialReferenceWhen 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.
Constructor Details

new esri.tasks.FeatureSet()

Creates a new FeatureSet object. The constructor takes no parameters.

new esri.tasks.FeatureSet(json)

Creates a new FeatureSet object using a JSON object.
Parameters:
<Object> jsonRequiredA JSON object that contains feature set.
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.

<Number> 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 false otherwise. Supported by ArcGIS Server version 10.1 and later.

<Graphic[]> features

The array of graphics returned.
Code Snippet:
var features = [];
features.push(graphic);
var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features;

<Object> fieldAliases

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

<String> geometryType

The geometry type of the FeatureSet.

<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.