SceneLayerDataSource

Interface

SceneLayerDataSource is created from a single scene layer of scene service or webscene.

Inheritance: SceneLayerDataSourceQueriableDataSourceJSAPILayerMixinItemMixin

Properties

Hide inherited properties
PropertyTypeNotes
belongToDataSource
 inherited 

The data source which this data source derives from.

count
 inherited 
number

The total records count depends on the current query

dataViewId
 inherited 
string

The data view ID configured in Json.

id
 inherited 
string

The data source ID.

isDataSourceSet
 inherited 
boolean

Whether a data source contains child data sources. A dataset data source should create all its child data sources before ready() is resolved.

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.

SceneLayer
localId
 inherited 
string

The local ID of the data source.

order
 inherited 
number

Order in the parent data source.

parentDataSource
 inherited 

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

SceneLayer

The type of the data source

string

The data source URL

belongToDataSource

optionalinherited
Interface Property
belongToDataSource: DataSource

The data source which this data source derives from.

count

optionalinherited
Interface Property
count: number

The total records count depends on the current query

dataViewId

optionalinherited
Interface Property
dataViewId: string

The data view ID configured in Json.

id

inherited
Interface Property
id: string

The data source ID.

Inherited from QueriableDataSource.id

isDataSourceSet

inherited
Interface Property
isDataSourceSet: boolean

Whether a data source contains child data sources. A dataset data source should create all its child data sources before ready() is resolved.

isDataView

inherited
Interface Property
isDataView: 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
Interface Property
isLocal: boolean

True means the data source is a local data source.

layer

optional
Interface Property
layer: SceneLayer

localId

optionalinherited
Interface Property
localId: string

The local ID of the data source.

order

optionalinherited
Interface Property
order: number

Order in the parent data source.

parentDataSource

inherited
Interface Property
parentDataSource: DataSource

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

type

Interface Property
type: SceneLayer

The type of the data source

url

Interface Property
url: string

The data source URL

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.

buildRecord(feature)

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

changeGDBVersion(gdbVersion)
void

Change the layer GDB version.

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.

clearSourceRecords()
 inherited 
void

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

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

getAllChildDataSources()
 inherited 

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

Return the derived data views and local data sources.

getAutoRefreshInterval()
 inherited 
number

If the return value > 0, auto refresh is enabled.

getChildDataSource(jimuChildId)
 inherited 

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

getChildDataSources()
 inherited 

Return child data sources of a parent data source.

Get the user config query parameters.

getCountStatus()
 inherited 

Return data source count status.

getCurrentQueryParams(excludeOption?)

Get the current query parameters. The current query parameters contain all applied queries.

getDataSourceJson()
 inherited 
IMDataSourceJson

The data source JSON object in app config.

getDataView(dataViewId)

Get data view by data view ID.

Override parent interface to get correct type.

string

Return the current GDB version.

GeometryType
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.

getListenSelection()
 inherited 
boolean

Return whether listen selection.

getLocalDataSource(localId)
 inherited 

Get local data source by local ID.

getLocalDataSources()
 inherited 

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

Return the main data source.

getMaxRecordCount()
 inherited 
number

Null means there is no record count limit, and will return all records from the service.

getRealQueryPages(pageSize, page)
 inherited 
number[]

Get real query page depends on the widget's request page.

getRealQueryParams(query, flag, options?)

When do query/load, we do not fire the query request directly. Instead, we'll consider the data source's config/current query parameter.

  • For load: we'll merge the configured query parameter if it has, and all widget applied queries.
  • For query, we'll merge the current query parameter and the configured query parameter it has.
getRecord(index)
 inherited 

Get record by index

getRecordById(id)
 inherited 

Get record by ID

getRecords()
 inherited 

Get records

getRecordsByPage(page, pageSize)
 inherited 

The page size here defines the records this method returns, which are not the actual query pageSize. Will use a fixed pageSize to query and cache data.

getRecordsByPageWithSelection(page, pageSize)
 inherited 

If selected records are not loaded in the current data source, will concat them to the end of records array. See getRecordsWithSelection for details.

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.

getRemoteQueryParams()
 inherited 

Get the query parameters configured in remote (not in exb).

getRootDataSource()
 inherited 

Return the root data source.

getRuntimeQueryParams(excludeWidgetId?)
 inherited 

Get the queries applied in runtime. If the excludeWidgetId is passed in, the queries of this widget will be excluded.

getSchema()
 inherited 

The schema returned here is the merged result of the configured schema and the fetched schema.

getSelectedRecordIds()
 inherited 
string[]

Get selected record IDs

number[]

Get selected record indexes

getSelectedRecords()
 inherited 

Get selected records

getSourceRecords()
 inherited 

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 

Return data source status.

getVersion()
 inherited 
number

Return data source version.

isInAppConfig()
 inherited 
boolean

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

load(query, options?)
Promise<DataRecord[]>

Execute the query against the service and update the internal data records, pagination is supported. When call this method, the real query is returnd by getRealQueryParams.

loadById(id, refresh?)
 inherited 
Promise<DataRecord>

Load record by ID, do not consider other queries.

loadCount(query, options?)
Promise<number>

Load the records count.

Merge queries by using AND, and return the merged result. If any query is undefined/null, it will be ignored.

query(queryProperties)
Promise<QueryResult>

Execute query against the service only, do NOT update the internal data records. The actural query parameters are generated by getRealQueryParams.

Query record by ID

queryCount(queryProperties)
Promise<QueryResult>

Query count

ready()
 inherited 
Promise<any>

Ready is resolved means the data source instance is ready for use.

selectRecordById(id, record?, forceCheck?)
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. If forceCheck is true, will check whether the record match filters of the data source or not. Will select the record only if the check is passed.

selectRecordsByIds(ids, records?, forceCheck?)
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. If forceCheck is true, will check whether these records match filters of the data source or not. Will select the records which check is passed.

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. See DataSourceEditSourceOperations.updateRecords

setSourceRecords(records)
 inherited 
void

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

setStatus(status)
 inherited 
void

Update data source status.

updateQueryParams(query, widgetId)
 inherited 
void

Update the data source query without executing the actual query.

updateSelectionInfo(ids, triggerDataSource, forceCheck?)
 inherited 
void

Update selected record IDs 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

inherited
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

optionalinherited
Interface Method
addVersion(): void

Update data source version.

Returns 
void

buildRecord

Interface Method
buildRecord(featureIFeature | Graphic): FeatureDataRecord

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

Parameters
ParameterType
feature
IFeature | Graphic
Returns 
FeatureDataRecord

changeGDBVersion

Interface Method
changeGDBVersion(gdbVersionstring): void

Change the layer GDB version.

Parameters
ParameterType
gdbVersion
string
Returns 
void

clearRecords

optionalinherited
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

inherited
Interface Method
clearSourceRecords(): void

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

Returns 
void

fetchSchema

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

optionalinherited
Interface Method
getAllChildDataSources(): DataSource[]

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

Returns 
DataSource[]

getAllDerivedDataSources

inherited
Interface Method
getAllDerivedDataSources(): DataSource[]

Return the derived data views and local data sources.

Returns 
DataSource[]

getAutoRefreshInterval

inherited
Interface Method
getAutoRefreshInterval(): number

If the return value > 0, auto refresh is enabled.

Returns 
number

getChildDataSource

optionalinherited
Interface Method
getChildDataSource(jimuChildIdstring): DataSource

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

Parameters
ParameterType
jimuChildId
string
Returns 
DataSource

getChildDataSources

optionalinherited
Interface Method
getChildDataSources(): DataSource[]

Return child data sources of a parent data source.

Returns 
DataSource[]

getConfigQueryParams

Interface Method
getConfigQueryParams(): FeatureLayerQueryParams

Get the user config query parameters.

Returns 
FeatureLayerQueryParams

getCountStatus

inherited
Interface Method
getCountStatus(): DataSourceStatus

Return data source count status.

Returns 
DataSourceStatus

getCurrentQueryParams

Interface Method
getCurrentQueryParams(excludeOption?WidgetDataSourcePair): FeatureLayerQueryParams

Get the current query parameters. The current query parameters contain all applied queries.

Parameters
ParameterType
excludeOption
WidgetDataSourcePair
Returns 
FeatureLayerQueryParams

getDataSourceJson

inherited
Interface Method
getDataSourceJson(): IMDataSourceJson

The data source JSON object in app config.

Returns 
IMDataSourceJson

getDataView

Interface Method
getDataView(dataViewIdstring): SceneLayerDataSource

Get data view by data view ID.

Parameters
ParameterType
dataViewId
string
Returns 
SceneLayerDataSource

getDataViews

Interface Method
getDataViews(): SceneLayerDataSource[]

Override parent interface to get correct type.

Returns 
SceneLayerDataSource[]

getGDBVersion

Interface Method
getGDBVersion(): string

Return the current GDB version.

Returns 
string

getGeometryType

Interface Method
getGeometryType(): GeometryType
Returns 
GeometryType

getIdField

Interface Method
getIdField(): string

Return the data source ID field.

Returns 
string

getInfo

inherited
Interface Method
getInfo(): IMDataSourceInfo

Return the data source info in redux store.

Returns 
IMDataSourceInfo

getLabel

inherited
Interface Method
getLabel(): string

Return data source label.

Returns 
string

getListenSelection

inherited
Interface Method
getListenSelection(): boolean

Return whether listen selection.

Returns 
boolean

getLocalDataSource

inherited
Interface Method
getLocalDataSource(localIdstring): DataSource

Get local data source by local ID.

Parameters
ParameterType
localId
string
Returns 
DataSource

getLocalDataSources

inherited
Interface Method
getLocalDataSources(): DataSource[]

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

Returns 
DataSource[]

getMainDataSource

Interface Method
getMainDataSource(): SceneLayerDataSource

Return the main data source.

Returns 
SceneLayerDataSource

getMaxRecordCount

inherited
Interface Method
getMaxRecordCount(): number

Null means there is no record count limit, and will return all records from the service.

Returns 
number

getRealQueryPages

inherited
Interface Method
getRealQueryPages(pageSizenumber, pagenumber): number[]

Get real query page depends on the widget's request page.

Parameters
ParameterType
pageSize
number
page
number
Returns 
number[]

getRealQueryParams

Interface Method
getRealQueryParams(queryany, flag"query" | "load", options?QueryOptions): FeatureLayerQueryParams

When do query/load, we do not fire the query request directly. Instead, we'll consider the data source's config/current query parameter.

  • For load: we'll merge the configured query parameter if it has, and all widget applied queries.
  • For query, we'll merge the current query parameter and the configured query parameter it has.
Parameters
ParameterType
query
any
flag
"query" | "load"
options
QueryOptions
Returns 
FeatureLayerQueryParams

getRecord

inherited
Interface Method
getRecord(indexnumber): DataRecord

Get record by index

Parameters
ParameterType
index
number
Returns 
DataRecord

getRecordById

inherited
Interface Method
getRecordById(idstring): DataRecord

Get record by ID

Parameters
ParameterType
id
string
Returns 
DataRecord

getRecords

inherited
Interface Method
getRecords(): DataRecord[]

Get records

Returns 
DataRecord[]

getRecordsByPage

inherited
Interface Method
getRecordsByPage(pagenumber, pageSizenumber): DataRecord[]

The page size here defines the records this method returns, which are not the actual query pageSize. Will use a fixed pageSize to query and cache data.

Parameters
ParameterType
page
number
pageSize
number
Returns 
DataRecord[]

getRecordsByPageWithSelection

inherited
Interface Method
getRecordsByPageWithSelection(pagenumber, pageSizenumber): DataRecord[]

If selected records are not loaded in the current data source, will concat them to the end of records array. See getRecordsWithSelection for details.

Parameters
ParameterType
page
number
pageSize
number
Returns 
DataRecord[]

getRecordsWithSelection

inherited
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[]

getRemoteQueryParams

inherited
Interface Method
getRemoteQueryParams(): QueryParams

Get the query parameters configured in remote (not in exb).

Returns 
QueryParams

getRootDataSource

inherited
Interface Method
getRootDataSource(): DataSource

Return the root data source.

Returns 
DataSource

getRuntimeQueryParams

inherited
Interface Method
getRuntimeQueryParams(excludeWidgetId?string): QueryParams

Get the queries applied in runtime. If the excludeWidgetId is passed in, the queries of this widget will be excluded.

Parameters
ParameterType
excludeWidgetId
string
Returns 
QueryParams

getSchema

inherited
Interface Method
getSchema(): IMDataSourceSchema

The schema returned here is the merged result of the configured schema and the fetched schema.

Returns 
IMDataSourceSchema

getSelectedRecordIds

optionalinherited
Interface Method
getSelectedRecordIds(): string[]

Get selected record IDs

Returns 
string[]

getSelectedRecordIndexes

optionalinherited
Interface Method
getSelectedRecordIndexes(): number[]

Get selected record indexes

Returns 
number[]

getSelectedRecords

optionalinherited
Interface Method
getSelectedRecords(): DataRecord[]

Get selected records

Returns 
DataRecord[]

getSourceRecords

inherited
Interface Method
getSourceRecords(): DataRecord[]

Return the source records

Returns 
DataRecord[]

getSourceVersion

inherited
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

inherited
Interface Method
getStatus(): DataSourceStatus

Return data source status.

Returns 
DataSourceStatus

getVersion

inherited
Interface Method
getVersion(): number

Return data source version.

Returns 
number

isInAppConfig

inherited
Interface Method
isInAppConfig(): boolean

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

Returns 
boolean

load

Interface Method
load(queryFeatureLayerQueryParams, options?QueryOptions): Promise<DataRecord[]>

Execute the query against the service and update the internal data records, pagination is supported. When call this method, the real query is returnd by getRealQueryParams.

Pagination: The pagination properties in the passed in query parameter may be not the same as the real query pagination that is sent to the service. The real query pagination is defined in the data source setting.

Parameters
ParameterType
query
FeatureLayerQueryParams
options
QueryOptions
Returns 
Promise<DataRecord[]>

loadById

inherited
Interface Method
loadById(idstring, refresh?boolean): Promise<DataRecord>

Load record by ID, do not consider other queries.

Parameters
ParameterType
id
string
refresh
boolean
Returns 
Promise<DataRecord>

loadCount

Interface Method
loadCount(queryFeatureLayerQueryParams, options?QueryOptions): Promise<number>

Load the records count.

Parameters
ParameterType
query
FeatureLayerQueryParams
options
QueryOptions
Returns 
Promise<number>

mergeQueryParams

Interface Method
mergeQueryParams(queriesFeatureLayerQueryParams[]): FeatureLayerQueryParams

Merge queries by using AND, and return the merged result. If any query is undefined/null, it will be ignored.

Parameters
ParameterType
queries
FeatureLayerQueryParams[]
Returns 
FeatureLayerQueryParams

query

Interface Method
query(queryPropertiesFeatureLayerQueryParams): Promise<QueryResult>

Execute query against the service only, do NOT update the internal data records. The actural query parameters are generated by getRealQueryParams.

To query count, please use queryCount.

Parameters
ParameterType
queryProperties
FeatureLayerQueryParams
Returns 
Promise<QueryResult>

queryById

Interface Method
queryById(idstring): Promise<FeatureDataRecord>

Query record by ID

Parameters
ParameterType
id
string
Returns 
Promise<FeatureDataRecord>

queryCount

Interface Method
queryCount(queryPropertiesFeatureLayerQueryParams): Promise<QueryResult>

Query count

Parameters
ParameterType
queryProperties
FeatureLayerQueryParams
Returns 
Promise<QueryResult>

ready

inherited
Interface Method
ready(): Promise<any>

Ready is resolved means the data source instance is ready for use.

Returns 
Promise<any>

selectRecordById

Interface Method
selectRecordById(idstring, record?FeatureDataRecord, forceCheck?boolean): 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. If forceCheck is true, will check whether the record match filters of the data source or not. Will select the record only if the check is passed.

Parameters
ParameterType
id
string
record
FeatureDataRecord
forceCheck
boolean
Returns 
void

selectRecordsByIds

Interface Method
selectRecordsByIds(idsstring[], records?FeatureDataRecord[], forceCheck?boolean): 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. If forceCheck is true, will check whether these records match filters of the data source or not. Will select the records which check is passed.

Parameters
ParameterType
ids
string[]
records
FeatureDataRecord[]
forceCheck
boolean
Returns 
void

setCountStatus

optionalinherited
Interface Method
setCountStatus(statusDataSourceStatus): void

Update data source count status.

Parameters
ParameterType
status
DataSourceStatus
Returns 
void

setDataSourceJson

inherited
Interface Method
setDataSourceJson(dsJsonIMDataSourceJson): void

Update data source JSON in data source instance

Parameters
ParameterType
dsJson
IMDataSourceJson
Returns 
void

setListenSelection

inherited
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
listen
boolean
Returns 
void

setRecords

inherited
Interface Method
setRecords(recordsDataRecord[]): void

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

Parameters
ParameterType
records
DataRecord[]
Returns 
void

setSourceRecords

inherited
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 use to update or get the source data.

Parameters
ParameterType
records
DataRecord[]
Returns 
void

setStatus

optionalinherited
Interface Method
setStatus(statusDataSourceStatus): void

Update data source status.

Parameters
ParameterType
status
DataSourceStatus
Returns 
void

updateQueryParams

inherited
Interface Method
updateQueryParams(queryQueryParams, widgetIdstring): void

Update the data source query without executing the actual query.

Parameters
ParameterType
query
QueryParams
widgetId
string
Returns 
void

updateSelectionInfo

optionalinherited
Interface Method
updateSelectionInfo(idsstring[], triggerDataSourceDataSource, forceCheck?boolean): void

Update selected record IDs 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 curren 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
ids
string[]
triggerDataSource
DataSource
forceCheck
boolean
Returns 
void

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