FeatureLayerDataSource

Interface

Feature layer data source is created from a single feature layer of feature service, map service or webmap/webscene.

Inheritance: FeatureLayerDataSourceQueriableDataSourceFeatureLayerGDBVersion

Properties

addSourceVersion

addSourceVersion: function

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

Type declaration
    (): void
    Returns 
    void

clearRecords optional

clearRecords: function

Only clear records, don't clear source data, version in datat source info will be added.

Type declaration
    (): void
    Returns 
    void

count optional

count: number

The total records count depends on the current query

dataViewId optional

dataViewId: string

The data view id configured in Json.

fetchSchema

fetchSchema: function

Fetch data schema from an actual data source. If it's a statistic data source, we won't fetch schema.

Type declaration
    (): Promise<ImmutableObject<DataSourceSchema>>
    Returns 
    Promise<ImmutableObject<DataSourceSchema>>

getAllDerivedDataSources

getAllDerivedDataSources: function

Return the derived data views and local data sources.

Type declaration

getAutoRefreshInterval

getAutoRefreshInterval: function

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

Type declaration
    (): number
    Returns 
    number

getConfigQueryParams

getConfigQueryParams: function

Get the user config query parameters.

getCurrentQueryParams

getCurrentQueryParams: function

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

Type declaration
    (excludeOption?WidgetDataSourcePair): QueryParams
    Parameters
    • excludeOptionWidgetDataSourcePairoptional 
    Returns 
    QueryParams

getDataSourceJson

getDataSourceJson: function

The data source JSON object in app config.

Type declaration
    (): ImmutableObject<DataSourceJson>
    Returns 
    ImmutableObject<DataSourceJson>

getDataViews

getDataViews: function

Override parent interface to get correct type.

Type declaration

getGeometryType

getGeometryType: function
Type declaration
    (): GeometryType
    Returns 
    GeometryType

getLocalDataSources

getLocalDataSources: function

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

Type declaration

getMaxRecordCount

getMaxRecordCount: function

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

Type declaration
    (): number
    Returns 
    number

getRealQueryPages

getRealQueryPages: function

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

Type declaration
    (pageSizenumber, pagenumber): number[]
    Parameters
    • pageSizenumber
    • pagenumber
    Returns 
    number[]

getRealQueryParams

getRealQueryParams: function

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.
Type declaration

getRecord

getRecord: function

Get record by index

Type declaration

getRecordById

getRecordById: function

Get record by id

Type declaration

getRecords

getRecords: function

When current data source is selection view, use useNoSelectionView to indicate whether return records in on_selection view when real selection is empty. The default value is true.

Type declaration
    (useNoSelectionView?boolean): DataRecord[]
    Parameters
    • useNoSelectionViewbooleanoptional 
    Returns 
    DataRecord[]

getRecordsByPage

getRecordsByPage: function

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.useNoSelectionView is same as parameter in getRecords.

Type declaration
    (pagenumber, pageSizenumber, useNoSelectionView?boolean): DataRecord[]
    Parameters
    • pagenumber
    • pageSizenumber
    • useNoSelectionViewbooleanoptional 
    Returns 
    DataRecord[]

getRecordsByPageWithSelection

getRecordsByPageWithSelection: function

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

Type declaration
    (pagenumber, pageSizenumber): DataRecord[]
    Parameters
    • pagenumber
    • pageSizenumber
    Returns 
    DataRecord[]

getRecordsWithSelection

getRecordsWithSelection: function

If selected records are not loaded in the current data source, will concat them to the end of records array. E.g. record 1 is selected in data view 1, record 1 is not loaded in data view 2 (record 1 actually matches query parmas of data view 2), dataView2.getRecordsWithSelection() will return all loaded records in data view 2 and record 1.

Type declaration

getRemoteQueryParams

getRemoteQueryParams: function

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

Type declaration

getRuntimeQueryParams

getRuntimeQueryParams: function

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

Type declaration

getSchema

getSchema: function

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

Type declaration
    (): ImmutableObject<DataSourceSchema>
    Returns 
    ImmutableObject<DataSourceSchema>

getSelectedFields

getSelectedFields: function

The schema contains all fields defined in the actual service. This method will return the fields user configured in the widget which generates output data source.

Type declaration
    (): string[]
    Returns 
    string[]

getSelectedRecordIds optional

getSelectedRecordIds: function

Get selected record ids

Type declaration
    (): string[]
    Returns 
    string[]

getSelectedRecordIndexes optional

getSelectedRecordIndexes: function

Get selected record indexes

Type declaration
    (): number[]
    Returns 
    number[]

getSelectedRecords optional

getSelectedRecords: function

Get selected records

Type declaration

getSourceRecords

getSourceRecords: function

Return the source records

Type declaration

getSourceVersion

getSourceVersion: function

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

Type declaration
    (): number
    Returns 
    number

id

id: string

These 3 properties are in app config. Put them here for ease of use.

isDataSourceSet

isDataSourceSet: boolean

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

isDataView

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

isLocal: boolean

True means the data source is a local data source.

load

load: function

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.

Type declaration

loadById

loadById: function

Load record by id, do not consider other queries.

Type declaration
    (idstring, refresh?boolean): Promise<DataRecord>
    Parameters
    • idstring
    • refreshbooleanoptional 
    Returns 
    Promise<DataRecord>

loadCount

loadCount: function

Load the records count.

Type declaration

mergeQueryParams

mergeQueryParams: function

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

parentDataSource

parentDataSource: DataSource

Null means it's root data source.

query

query: function

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.

Type declaration

queryById

queryById: function

Query record by id

Type declaration

queryCount

queryCount: function

Query count

Type declaration

ready

ready: function

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

Type declaration
    (): Promise<any>
    Returns 
    Promise<any>

selectRecord optional

selectRecord: function

Select record by index.

Type declaration
    (indexnumber): void
    Parameters
    • indexnumber
    Returns 
    void

selectRecordById

selectRecordById: function

When select record by id, we can pass in the records. So when the selected records are not in the data source, we can add them in.

Type declaration

selectRecordsByIds

selectRecordsByIds: function

Select records by ids

Type declaration

setDataSourceJson

setDataSourceJson: function

Update data source JSON in data source instance

Type declaration
    (dsJsonImmutableObject<DataSourceJson>): void
    Parameters
    • dsJsonImmutableObject<DataSourceJson>
    Returns 
    void

setListenSelection

setListenSelection: function

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. 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 won't listen selected records by default.

Type declaration
    (listenboolean): void
    Parameters
    • listenboolean
    Returns 
    void

setRecords

setRecords: function

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

Type declaration

setSourceRecords

setSourceRecords: function

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.

Type declaration

type

type: FeatureLayer

The type of the data source

updateQueryParams

updateQueryParams: function

Update the data source query without executing the actual query.

Type declaration

url

url: string

The data source URL

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