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

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

Description

(Added at v1.4)
Input for properties of ClosestFacilityParameters,RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each parameter type:

Samples

Search for samples that use this class.

Constructors

NameSummary
new DataLayer()Creates a new DataLayer object.

Constants

NameDescription
SPATIAL_REL_CONTAINSPart or all of a feature from feature class 1 is contained within a feature from feature class 2.
SPATIAL_REL_CROSSESThe feature from feature class 1 crosses a feature from feature class 2.
SPATIAL_REL_ENVELOPEINTERSECTSThe envelope of feature class 1 intersects with the envelope of feature class 2.
SPATIAL_REL_INDEXINTERSECTSThe envelope of the query feature class intersects the index entry for the target feature class.
SPATIAL_REL_INTERSECTSPart of a feature from feature class 1 is contained in a feature from feature class 2.
SPATIAL_REL_OVERLAPSFeatures from feature class 1 overlap features in feature class 2.
SPATIAL_REL_TOUCHESThe feature from feature class 1 touches the border of a feature from feature class 2.
SPATIAL_REL_WITHINThe feature from feature class 1 is completely enclosed by the feature from feature class 2.

Properties

NameTypeSummary
geometryGeometryThe geometry to apply to the spatial filter.
nameStringThe name of the data layer in the map service that is being referenced.
spatialRelationshipStringThe spatial relationship to be applied on the input geometry while performing the query.
whereStringA where clause for the query.
Constructor Details

new DataLayer()

Creates a new DataLayer object.
Sample:
require([
  "esri/tasks/DataLayer", ... 
], function(DataLayer, ... ) {
  var stops = new DataLayer();
  ...
});
Property Details

<Geometry> geometry

The geometry to apply to the spatial filter. The spatial relationship as specified by spatialRelationship is applied to this geometry while performing the query.
Sample:
require([
  "esri/map", "esri/tasks/DataLayer", ... 
], function(Map, DataLayer, ... ) {
  var map = new Map( ... );
  var stops = new DataLayer();
  stops.geometry = map.extent;
  ...
});

<String> name

The name of the data layer in the map service that is being referenced.
Sample:
require([
  "esri/tasks/DataLayer", ... 
], function(DataLayer, ... ) {
  var stops = new DataLayer();
  stops.name = "Hospitals";
  ...
});

<String> spatialRelationship

The spatial relationship to be applied on the input geometry while performing the query. See the Constants Table for a list of valid values.
Sample:
require([
  "esri/tasks/DataLayer", ... 
], function(DataLayer, ... ) {
  var stops = new DataLayer();
  stops.spatialRelationship = DataLayer.SPATIAL_REL_CONTAINS;
  ...
});

<String> where

A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed, for example: query.where = "POP2000 > 350000".
Show Modal