import DynamicDataLayer from "@arcgis/core/rest/layerSources/DynamicDataLayer.js";const DynamicDataLayer = await $arcgis.import("@arcgis/core/rest/layerSources/DynamicDataLayer.js");- Inheritance
- DynamicDataLayer→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 5.0
A dynamic data layer is a layer created on-the-fly with data stored in a registered workspace. This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following:
| Data source | Description |
|---|---|
| TableDataSource | A feature class with geometries or table without geometries. When a table data source does not contain geometries, it may be used as one of the sources in a join operation. Feature class tables may be used on their own since they contain a geometry field. |
| QueryTableDataSource | A feature class or table that may be queried on the fly with a SQL where clause. This data source is useful for scenarios where you have a table containing unique geometries and another table with multiple records that match to each geometry. You can use the QueryTableDataSource to select only a subset of those matching records (so records in both tables have a one-to-one relationship with each other) and join them to the table with geometries. |
| RasterDataSource | A raster dataset used for visualization purposes only. |
| JoinTableDataSource | This data source consists of two data sources joined by a common attribute or key. The left table data source typically contains geometries, while the right source may be a table or query table without geometries. |
- Example
- let layer = new MapImageLayer({url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer",sublayers: [{id: 0,renderer: renderer,opacity: 0.9,source: {type: "data-layer",dataSource: {type: "join-table",leftTableSource: {type: "map-layer",mapLayerId: 3},rightTableSource: {type: "data-layer",// references a table in a registered workspace that doesn't have geometriesdataSource: {type: "table",workspaceId: "CensusFileGDBWorkspaceID",dataSourceName: "ancestry"}},leftTableKey: "STATE_NAME",rightTableKey: "State",joinType: "left-outer-join"}}}]});
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| readonly inherited | ||
| Field[] | | |
| readonly | "data-layer" | |
dataSource
A table, feature class, or raster that resides in a registered workspace (either a folder or geodatabase). The data sources are not visible in the Services Directory by default. They may be viewed, published, and configured using the ArcGIS Server Manager.
Methods
| Method | Signature | Class |
|---|---|---|
| inherited static | fromJSON(json: any): any | |
| inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.