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

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

Description

(Added at v2.7)
The LayerDataSource class defines and provides information about a layer created on the fly from a data source. Requires ArcGIS Server 10.1 or greater.

Samples

Search for samples that use this class.

Class hierarchy

esri/layers/LayerSource
|_esri/layers/LayerDataSource

Constructors

NameSummary
new LayerDataSource(json?)Creates a new LayerDataSource object.

Properties

NameTypeSummary
dataSourceDataSourceThe data source used to create a dynamic data layer on the fly.
typeStringUsed to describe the origin of the LayerSource.

Methods

NameReturn typeSummary
toJson()ObjectConverts object to its ArcGIS Server JSON representation.
Constructor Details

new LayerDataSource(json?)

Creates a new LayerDataSource object.
Parameters:
<Object> json Optional JSON object representing the LayerDataSource.
Sample:
require([
  "esri/layers/LayerDataSource", ... 
], function(LayerDataSource, ... ) {
  var layerSource = new LayerDataSource();
  layerSource.dataSource = dataSource;
  ...
});
Property Details

<DataSource> dataSource

The data source used to create a dynamic data layer on the fly. The data source can be one of the following:
Sample:
require([
  "esri/layers/LayerDataSource", ... 
], function(LayerDataSource, ... ) {
  var dataSource = new TableDataSource();
  dataSource.workspaceId = "d203";
  dataSource.dataSourceName = "sde.SDE.states";

  var layerSource = new esri.layers.LayerDataSource();
  layerSource.dataSource = dataSource;
  ...
});

<String> type

Used to describe the origin of the LayerSource.
Method Details

toJson()

Converts object to its ArcGIS Server JSON representation.
Return type: Object
Show Modal