Skip to content

Interface

MapServiceDataSource is created from map service or webmap/webscene.

Inheritance: MapServiceDataSourceAbstractArcGISLayerFolderDataSource

Properties

Hide inherited properties
PropertyTypeNotes
DataSource

The data source which this data source derives from.

count
inherited
number

The total records count depends on the current query

DataSourceManager

The data source manager, which is used to manage the data source, including create/get/destroy the data source instance.

dataViewId
inherited
string

The data view ID configured in JSON.

id
inherited
string

The data source ID.

isDataView
inherited
boolean

True means the data source is a data view. For local data source, this is false even the local data source is created from a data view.

isLocal
inherited
boolean

True means the data source is a local data source.

layerMapImageLayer | TileLayer

When add a map service directly, there is no layer instance created. When add a webmap that contains map service, the map service will be created as __esri.MapImageLayer or __esri.TileLayer layer.

localId
inherited
string

The local ID of the data source.

order
inherited
number

Order in the parent data source.

DataSource & SetDataSourceMixin

The parent data source of this data source, mull means it's a root data source.

typeMapService

The type of the data source.

belongToDataSource

optionalinheritedinherited
Interface Property

count

optionalinheritedinherited
Interface Property

dataSourceManager

inheritedinherited
Interface Property

dataViewId

optionalinheritedinherited
Interface Property

id

inheritedinherited
Interface Property

isDataView

inheritedinherited
Interface Property

isLocal

inheritedinherited
Interface Property

layer

optional
Interface Property

localId

optionalinheritedinherited
Interface Property

order

optionalinheritedinherited
Interface Property

parentDataSource

inheritedinherited
Interface Property

type

Interface Property

Methods

Hide inherited methods
MethodReturnsNotes
addSourceVersion()
inherited
void

When current data source is created from an array of records, it will be saved in sourceRecords . Add the version of sourceRecords . setSourceRecords will add the version by default.

addVersion()
inherited
void

Update data source version.

boolean

Return whether all child data sources (including descendant data sources) are created. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

buildRecord(data)
inherited
DataRecord

Builds a data record only -- does not add the record into data source.

changeGDBVersion(gdbVersion)
inherited
void

Change the GDB version for all layers in the service.

changeTimeExtent(time, widgetId)void

Change the time extent for all layers in the service.

Promise<DataSource[]>

All child data sources (including descendant data sources) are ready for use. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

clearRecords()
inherited
void

This function will clear the loaded records and won't clear the sourceRecords. Once the loaded records are cleared, the version in the data source info will be updated.

void

Clear both sourceRecords and loaded records. Both source version and version in data source info will be updated.

createDataSourceById(dataSourceId)
inherited
Promise<DataSource>

Create a child or a descendant data source by id. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

createJSAPILayerByDataSource(dataSource?, useDataSourceQueryParams?, throwError?)
inherited
Promise<Layer | ArcGISSubLayer>

Default dataSource is the current data source. Default useDataSourceQueryParams is true, that is to say apply the data source's query params to the created ArcGIS Maps SDK for JavaScript layer by default. Default throwError is false, that is to say the method won't throw error and will return undefined if the creation fail.

destroy()
inherited
void

Destroy the data source.

fetchSchema()
inherited
Promise<IMDataSourceSchema>

Fetch the data schema from an actual data source. If it's a statistic data source, the schema will not be fetched.

DataSource[]

Return all child data sources of a parent data source, includes the grandchildren

DataSource[]

Return the derived data views and local data sources.

getChildDataSource(jimuChildId)
inherited
DataSource

Get child data source by jimuChildId . You can get jimuChildId by getJimuChildId() .

string[]

Get child data source IDs, the child data sources may not be created by the time.

DataSource[]

Return child data sources of a parent data source.

getCountStatus()
inherited
DataSourceStatus

Return data source count status.

IMDataSourceJson

The data source JSON object in app config.

getDataView(dataViewId)
inherited
DataSource

Get data view by data view ID.

IMDataViewJson

Return the config of the current data source.

getDataViews()
inherited
DataSource[]

Return all data views created from a main data source.

getGDBVersion()
inherited
string

Get the service GDB version.

getIdField()
inherited
string

Return the data source ID field.

getInfo()
inherited
IMDataSourceInfo

Return the data source info in redux store.

getLabel()
inherited
string

Return data source label.

boolean

Return whether listen selection.

getLocalDataSource(localId)
inherited
DataSource

Get local data source by local ID.

DataSource[]

Return all local data sources created from a main data source or data view.

DataSource

Return the main data source.

getRecordById(id)
inherited
DataRecord

Get record by ID

getRecords()
inherited
DataRecord[]

Get records

DataRecord[]

If selected records are not loaded in the current data source, they will be concatenated to the end of records array. For example, record 1 is selected in data view 1 and it is not loaded in data view 2 (record 1 actually matches query params of data view 2), dataView2.getRecordsWithSelection() will return all loaded records in data view 2 and record 1.

DataSource

Return the root data source.

getSchema()
inherited
IMDataSourceSchema

The schema returned here is the merged result of the configured schema and the fetched schema. The configured schema is the user's changes, such as a new data source name. The fetched schema is the original schema from AGOL/portal item or a remote database, such as the service name, the fields and the filters.

string[]

Get selected record IDs

number[]

Get selected record indexes

DataRecord[]

Get selected records

DataSource

Get selection data view

getSourceRecords()
inherited
DataRecord[]

Return the source records

getSourceVersion()
inherited
number

When current data source is created from an array of records, it will be saved in sourceRecords . Return the version of sourceRecords .

getStatus()
inherited
DataSourceStatus

Return data source status.

getTimeExtent()TimeExtent

Get the time extent.

getVersion()
inherited
number

Return data source version.

isDataSourceSet()
inherited
thisisDataSource & SetDataSourceMixin

Whether a data source contains child data sources. A set data source won't create all its child data sources when ready is resolved. To make sure all child data sources are created, please use childDataSourcesReady .

isInAppConfig()
inherited
boolean

Return whether the data source is added in builder and is saved in app config.

isSelectionView()
inherited
boolean

Determine whether the data source is a selection view.

ready()
inherited
Promise<any>

Ready is resolved means the data source instance is ready for use. Please note that can not make sure all child data sources are created if a set data source is ready. To make sure all child data sources are created, please use childDataSourcesReady .

selectRecordById(id, record?)
inherited
void

Select a record by ID. When select record by ID, we can pass in the record. So when the selected record is not loaded, we can add it in.

selectRecords(options)
inherited
Promise<Pick<QueryResult"records">>

Select records.

selectRecordsByIds(ids, records?)
inherited
void

Select records by IDs. When select records by IDs, we can pass in the records. So when the selected records are not loaded, we can add them in.

setCountStatus(status)
inherited
void

Update data source count status.

setDataSourceJson(dsJson)
inherited
void

Update data source JSON in data source instance

setListenSelection(listen)
inherited
void

Whether listen selected records from other data sources which are derived from the same main data source. If true, will update selected record IDs of current data source info when selecting records via other derived data sources. Will also update selected record IDs when selecting records via current data source itself. If false, won't change selected record IDs when selecting records via other derived data sources. Will update selected record IDs only when selecting records via current data source itself.

setRecords(records)
inherited
void

Update the records in the data source object only, does not update the source data.

setSourceRecords(records)
inherited
void

When current data source is created from an array of records, will save it in sourceRecords . These two methods are used to update or get the source data.

setStatus(status)
inherited
void

Update data source status.

updateSelectionInfo(options, triggerDataSource, forceCheck?)
inherited
void

Update selected records in data source info if the current data source listens selection change (see setListenSelection ) or the current data source is the trigger data source (that is to say, select via it).

addSourceVersion

inheritedinherited
Interface Method
addSourceVersion(): void

When current data source is created from an array of records, it will be saved in sourceRecords . Add the version of sourceRecords . setSourceRecords will add the version by default.

Returns 
void

addVersion

optionalinheritedinherited
Interface Method
addVersion(): void

Update data source version.

Returns 
void

areChildDataSourcesCreated

inheritedinherited
Interface Method
areChildDataSourcesCreated(): boolean

Return whether all child data sources (including descendant data sources) are created. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

Returns 
boolean

buildRecord

inheritedinherited
Interface Method
buildRecord(dataany): DataRecord

Builds a data record only -- does not add the record into data source.

Parameters
ParameterType
dataany
Returns 
DataRecord

changeGDBVersion

inheritedinherited
Interface Method
changeGDBVersion(gdbVersionstring): void

Change the GDB version for all layers in the service.

Parameters
ParameterType
gdbVersionstring
Returns 
void

changeTimeExtent

Interface Method
changeTimeExtent(timeTimeExtent, widgetIdstring): void

Change the time extent for all layers in the service.

Parameters
ParameterType
timeTimeExtent
widgetIdstring
Returns 
void

childDataSourcesReady

inheritedinherited
Interface Method
childDataSourcesReady(): Promise<DataSource[]>

All child data sources (including descendant data sources) are ready for use. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

Returns 
Promise<DataSource[]>

clearRecords

optionalinheritedinherited
Interface Method
clearRecords(): void

This function will clear the loaded records and won't clear the sourceRecords. Once the loaded records are cleared, the version in the data source info will be updated.

Returns 
void

clearSourceRecords

inheritedinherited
Interface Method
clearSourceRecords(): void

Clear both sourceRecords and loaded records. Both source version and version in data source info will be updated.

Returns 
void

createDataSourceById

inheritedinherited
Interface Method
createDataSourceById(dataSourceIdstring): Promise<DataSource>

Create a child or a descendant data source by id. Data source has this method only if it is data source set ( dataSource.isDataSourceSet() is true).

Please note will only create the specific data source, won't create descendant data sources of it.

Parameters
ParameterType
dataSourceIdstring
Returns 
Promise<DataSource>

createJSAPILayerByDataSource

inheritedinherited
Interface Method
createJSAPILayerByDataSource(dataSource?DataSource, useDataSourceQueryParams?boolean, throwError?boolean): Promise<Layer | ArcGISSubLayer>

Default dataSource is the current data source. Default useDataSourceQueryParams is true, that is to say apply the data source's query params to the created ArcGIS Maps SDK for JavaScript layer by default. Default throwError is false, that is to say the method won't throw error and will return undefined if the creation fail.

Parameters
ParameterType
dataSourceDataSource
useDataSourceQueryParamsboolean
throwErrorboolean
Returns 
Promise<Layer | ArcGISSubLayer>

destroy

inheritedinherited
Interface Method
destroy(): void

Destroy the data source.

Returns 
void

fetchSchema

inheritedinherited
Interface Method
fetchSchema(): Promise<IMDataSourceSchema>

Fetch the data schema from an actual data source. If it's a statistic data source, the schema will not be fetched.

Returns 
Promise<IMDataSourceSchema>

getAllChildDataSources

inheritedinherited
Interface Method
getAllChildDataSources(): DataSource[]

Return all child data sources of a parent data source, includes the grandchildren

Returns 
DataSource[]

getAllDerivedDataSources

inheritedinherited
Interface Method
getAllDerivedDataSources(): DataSource[]

Return the derived data views and local data sources.

Returns 
DataSource[]

getChildDataSource

inheritedinherited
Interface Method
getChildDataSource(jimuChildIdstring): DataSource

Get child data source by jimuChildId . You can get jimuChildId by getJimuChildId() .

Parameters
ParameterType
jimuChildIdstring
Returns 
DataSource

getChildDataSourceIds

inheritedinherited
Interface Method
getChildDataSourceIds(): string[]

Get child data source IDs, the child data sources may not be created by the time.

Returns 
string[]

getChildDataSources

inheritedinherited
Interface Method
getChildDataSources(): DataSource[]

Return child data sources of a parent data source.

Returns 
DataSource[]

getCountStatus

inheritedinherited
Interface Method
getCountStatus(): DataSourceStatus

Return data source count status.

Returns 
DataSourceStatus

getDataSourceJson

inheritedinherited
Interface Method
getDataSourceJson(): IMDataSourceJson

The data source JSON object in app config.

Returns 
IMDataSourceJson

getDataView

inheritedinherited
Interface Method
getDataView(dataViewIdstring): DataSource

Get data view by data view ID.

Parameters
ParameterType
dataViewIdstring
Returns 
DataSource

getDataViewConfig

inheritedinherited
Interface Method
getDataViewConfig(): IMDataViewJson

Return the config of the current data source.

Returns 
IMDataViewJson

getDataViews

inheritedinherited
Interface Method
getDataViews(): DataSource[]

Return all data views created from a main data source.

Returns 
DataSource[]

getGDBVersion

inheritedinherited
Interface Method
getGDBVersion(): string

Get the service GDB version.

Returns 
string

getIdField

inheritedinherited
Interface Method
getIdField(): string

Return the data source ID field.

Returns 
string

getInfo

inheritedinherited
Interface Method
getInfo(): IMDataSourceInfo

Return the data source info in redux store.

Returns 
IMDataSourceInfo

getLabel

inheritedinherited
Interface Method
getLabel(): string

Return data source label.

Returns 
string

getListenSelection

inheritedinherited
Interface Method
getListenSelection(): boolean

Return whether listen selection.

Returns 
boolean

getLocalDataSource

inheritedinherited
Interface Method
getLocalDataSource(localIdstring): DataSource

Get local data source by local ID.

Parameters
ParameterType
localIdstring
Returns 
DataSource

getLocalDataSources

inheritedinherited
Interface Method
getLocalDataSources(): DataSource[]

Return all local data sources created from a main data source or data view.

Returns 
DataSource[]

getMainDataSource

inheritedinherited
Interface Method
getMainDataSource(): DataSource

Return the main data source.

Returns 
DataSource

getRecordById

inheritedinherited
Interface Method
getRecordById(idstring): DataRecord

Get record by ID

Parameters
ParameterType
idstring
Returns 
DataRecord

getRecords

inheritedinherited
Interface Method
getRecords(): DataRecord[]

Get records

Returns 
DataRecord[]

getRecordsWithSelection

inheritedinherited
Interface Method
getRecordsWithSelection(): DataRecord[]

If selected records are not loaded in the current data source, they will be concatenated to the end of records array. For example, record 1 is selected in data view 1 and it is not loaded in data view 2 (record 1 actually matches query params of data view 2), dataView2.getRecordsWithSelection() will return all loaded records in data view 2 and record 1.

Returns 
DataRecord[]

getRootDataSource

inheritedinherited
Interface Method
getRootDataSource(): DataSource

Return the root data source.

Returns 
DataSource

getSchema

inheritedinherited
Interface Method
getSchema(): IMDataSourceSchema

The schema returned here is the merged result of the configured schema and the fetched schema. The configured schema is the user's changes, such as a new data source name. The fetched schema is the original schema from AGOL/portal item or a remote database, such as the service name, the fields and the filters.

Returns 
IMDataSourceSchema

getSelectedRecordIds

inheritedinherited
Interface Method
getSelectedRecordIds(): string[]

Get selected record IDs

Returns 
string[]

getSelectedRecordIndexes

inheritedinherited
Interface Method
getSelectedRecordIndexes(): number[]

Get selected record indexes

Returns 
number[]

getSelectedRecords

inheritedinherited
Interface Method
getSelectedRecords(): DataRecord[]

Get selected records

Returns 
DataRecord[]

getSelectionDataView

inheritedinherited
Interface Method
getSelectionDataView(): DataSource

Get selection data view

Returns 
DataSource

getSourceRecords

inheritedinherited
Interface Method
getSourceRecords(): DataRecord[]

Return the source records

Returns 
DataRecord[]

getSourceVersion

inheritedinherited
Interface Method
getSourceVersion(): number

When current data source is created from an array of records, it will be saved in sourceRecords . Return the version of sourceRecords .

Returns 
number

getStatus

inheritedinherited
Interface Method
getStatus(): DataSourceStatus

Return data source status.

Returns 
DataSourceStatus

getTimeExtent

Interface Method
getTimeExtent(): TimeExtent

Get the time extent.

Returns 
TimeExtent

getVersion

inheritedinherited
Interface Method
getVersion(): number

Return data source version.

Returns 
number

isDataSourceSet

inheritedinherited
Interface Method
isDataSourceSet(): thisisDataSource & SetDataSourceMixin

Whether a data source contains child data sources. A set data source won't create all its child data sources when ready is resolved. To make sure all child data sources are created, please use childDataSourcesReady .

Returns 
thisisDataSource & SetDataSourceMixin

isInAppConfig

inheritedinherited
Interface Method
isInAppConfig(): boolean

Return whether the data source is added in builder and is saved in app config.

Returns 
boolean

isSelectionView

inheritedinherited
Interface Method
isSelectionView(): boolean

Determine whether the data source is a selection view.

Returns 
boolean

ready

inheritedinherited
Interface Method
ready(): Promise<any>

Ready is resolved means the data source instance is ready for use. Please note that can not make sure all child data sources are created if a set data source is ready. To make sure all child data sources are created, please use childDataSourcesReady .

Returns 
Promise<any>

selectRecordById

inheritedinherited
Interface Method
selectRecordById(idstring, record?DataRecord): void

Select a record by ID. When select record by ID, we can pass in the record. So when the selected record is not loaded, we can add it in.

Parameters
ParameterTypeNotes
idstring

The ID to be selected. The selection will be cleared if the ID is null.

recordDataRecord
Returns 
void

selectRecords

inheritedinherited
Interface Method
selectRecords(optionsSelectOptions): Promise<Pick<QueryResult"records">>

Select records.

Parameters
ParameterType
optionsSelectOptions
Returns 
Promise<Pick<QueryResult"records">>

selectRecordsByIds

inheritedinherited
Interface Method
selectRecordsByIds(idsstring[], records?DataRecord[]): void

Select records by IDs. When select records by IDs, we can pass in the records. So when the selected records are not loaded, we can add them in.

Parameters
ParameterTypeNotes
idsstring[]

The IDs to be selected. The selection will be cleared if the IDs are null.

recordsDataRecord[]
Returns 
void

setCountStatus

optionalinheritedinherited
Interface Method
setCountStatus(statusDataSourceStatus): void

Update data source count status.

Parameters
ParameterType
statusDataSourceStatus
Returns 
void

setDataSourceJson

inheritedinherited
Interface Method
setDataSourceJson(dsJsonIMDataSourceJson): void

Update data source JSON in data source instance

Parameters
ParameterType
dsJsonIMDataSourceJson
Returns 
void

setListenSelection

inheritedinherited
Interface Method
setListenSelection(listenboolean): void

Whether listen selected records from other data sources which are derived from the same main data source. If true, will update selected record IDs of current data source info when selecting records via other derived data sources. Will also update selected record IDs when selecting records via current data source itself. If false, won't change selected record IDs when selecting records via other derived data sources. Will update selected record IDs only when selecting records via current data source itself.

Main data source and its data views will listen selected records by default, local data source does not listen selected records by default.

Parameters
ParameterType
listenboolean
Returns 
void

setRecords

inheritedinherited
Interface Method
setRecords(recordsDataRecord[]): void

Update the records in the data source object only, does not update the source data.

Parameters
ParameterType
recordsDataRecord[]
Returns 
void

setSourceRecords

inheritedinherited
Interface Method
setSourceRecords(recordsDataRecord[]): void

When current data source is created from an array of records, will save it in sourceRecords . These two methods are used to update or get the source data.

Parameters
ParameterType
recordsDataRecord[]
Returns 
void

setStatus

optionalinheritedinherited
Interface Method
setStatus(statusDataSourceStatus): void

Update data source status.

Parameters
ParameterType
statusDataSourceStatus
Returns 
void

updateSelectionInfo

inheritedinherited
Interface Method
updateSelectionInfo(optionsSelectOptions, triggerDataSourceDataSource, forceCheck?boolean): void

Update selected records in data source info if the current data source listens selection change (see setListenSelection ) or the current data source is the trigger data source (that is to say, select via it).

Before update info, will check whether these selected records match filters of the current data source firstly, and then only set the matched selected records to info. Will skip the check in some cases to improve performance if the forceCheck is not passed in or is false. For example, if the current data source is main data source (we suppose that main data source contains all records, no need to check). But if the forceCheck is true, won't skip the check.

Parameters
ParameterType
optionsSelectOptions
triggerDataSourceDataSource
forceCheckboolean
Returns 
void

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.