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
Constants
SPATIAL_REL_CONTAINS | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. |
SPATIAL_REL_CROSSES | The feature from feature class 1 crosses a feature from feature class 2. |
SPATIAL_REL_ENVELOPEINTERSECTS | The envelope of feature class 1 intersects with the envelope of feature class 2. |
SPATIAL_REL_INDEXINTERSECTS | The envelope of the query feature class intersects the index entry for the target feature class. |
SPATIAL_REL_INTERSECTS | Part of a feature from feature class 1 is contained in a feature from feature class 2. |
SPATIAL_REL_OVERLAPS | Features from feature class 1 overlap features in feature class 2. |
SPATIAL_REL_TOUCHES | The feature from feature class 1 touches the border of a feature from feature class 2. |
SPATIAL_REL_WITHIN | The feature from feature class 1 is completely enclosed by the feature from feature class 2. |
Properties
Constructor Details
Creates a new DataLayer object.
Sample:
require([
"esri/tasks/DataLayer", ...
], function(DataLayer, ... ) {
var stops = new DataLayer();
...
});
Property Details
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;
...
});
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";
...
});
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;
...
});
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"
.