InteractiveDataSource | Data Inspector Library API Reference
- Last UpdatedMay 7, 2025
- 18 minute read
Type parameters
-
InteractiveTileType: InteractiveTile
Hierarchy
-
TileDataSource<InteractiveTileType>
- InteractiveDataSource
Index
Constructors
Properties
- cacheable
- is
Primary - is
Selected - logger
- m_
composed Tile - m_
enable Refresh - m_
feature Filters - m_
highlighted Feature Id - m_
highlighted Feature Index - m_
highlighted Feature Type - m_
info Widget Element Id - m_
intersection Agent - m_
invalid Partitions - m_
is Interactive Data Source Ready - m_
level With Data - m_
levels With Data - m_
partitions ToRefresh - m_
partitions ToRender - m_
selected Feature Id - m_
selected Feature Partition Id - m_
show Grid - m_
tile Cache - m_
tile Cache Size - m_
tile Selection Limit - params
- tile
Type - DATA_
LEVEL_ CHANGED - EVENT_
ATTACHED - EVENT_
BEFORE_ TILE_ DECODE - EVENT_
BEFORE_ TILE_ RENDERED - EVENT_
CONNECTION_ ERROR - EVENT_
FEATURE_ DESELECT - EVENT_
FEATURE_ HIGHLIGHT - EVENT_
FEATURE_ SELECT - EVENT_
FEATURE_ UNHIGHLIGHT - EVENT_
TILES_ REFRESHED - EVENT_
TILE_ DECODED - EVENT_
TILE_ DESELECT - EVENT_
TILE_ GET - EVENT_
TILE_ GET_ FROM_ CACHE - EVENT_
TILE_ RENDERED - EVENT_
TILE_ SELECT - MORTON_
CODE_ FOR_ GENERIC_ PARTITION
Accessors
Methods
- add
Feature Filter - apply
Feature Filters - attach
- can
Select More Tiles - clear
Filters - clear
Selected Tiles - configure
Tile Decoder - connect
- copy
Object From Tile Into Composed Tile - create
Geometries - create
Schema Provider - data
Provider - decode
Tile - decode
Tile With Schema - deselect
Feature - deselect
Tile - dispose
- find
Features - get
Catalog Client - get
Composed Tile - get
Data Level Tile - get
Feature Object - get
Highlighted Feature Id - get
Intersection Agent - get
Logger Name - get
Objects ToRaycast - get
Selected Feature Id - get
Tile - has
Tile ToRender - highlight
Feature - initial
Schema Provider - is
Custom Schema Used - is
Tile Valid - mark
Partition Invalid - mark
Partition Valid - mark
Tile Invalid - mark
Tile Valid - on
Catalog Version Change - ready
- refresh
Tiles - remove
Feature Filter - reset
Composed Tile - reset
Data Provider - retrieve
Tile Data - schema
Provider - select
Feature - select
Tile - set
Feature Filters - set
Schema Provider - set
UpIntersection Agent - tile
Decoded - unhighlight
Feature
Constructors
constructor
-
A default constructor.
Type parameters
-
InteractiveTileType: InteractiveTile<InteractiveTileType>
Parameters
-
tileType: (dataSource: DataSource, tileKey: TileKey) => InteractiveTileType
A tile constructor.
-
-
Parameters
-
dataSource: DataSource
-
tileKey: TileKey
Returns InteractiveTileType
-
-
-
-
params: InteractiveDataSourceParameters
Parameters to configure this data source.
Returns InteractiveDataSource<InteractiveTileType>
-
Properties
cacheable
Set to true
if the MapView can cache tiles produced by this DataSource
.
isPrimary
Defines whether [[InteractiveDatasource]] is primary. If true that means that Layer used in that datasource is the basis for the comparison with other layers. So it should not be possible to remove it via Data Inspector UI.
isSelected
Defines whether [[InteractiveDatasource]] is selected. If true that means that all UI elements in DI control the visualization of that layer only. E.g. Tile grid shows tile coverage only for the selected layer.
Readonly logger
An instance of logger.
Protected m_composedTile
A tile of any level that contains objects from dataLevel
tiles (a composition of
lower-level tiles).
Protected Optional m_enableRefresh
Indicates if the data source data can be refreshed. It is used only for volatile layers.
Protected m_featureFilters
An array of feature filters.
Protected m_highlightedFeatureId
A highlighted feature ID.
Protected m_highlightedFeatureIndex
A highlighted feature index.
Protected m_highlightedFeatureType
A highlighted feature type.
Protected m_infoWidgetElementId
An ID that will be used for corresponding InfoWidget element.
Protected m_intersectionAgent
An instance of intersection agent to highlight and select data source features and tiles.
Protected m_invalidPartitions
A set of invalid partitions. Corresponding tiles are to be removed from the cache and loaded again on selection.
Protected m_isInteractiveDataSourceReady
Indicates whether interactive datasource is ready (data provider and schema provider are
connected). It is set to true
in connect()
method. It is recommended for subclasses of
InteractiveDataSource to also change this state of readiness only in connect()
method.
Protected m_levelWithData
A level on which the data is stored.
Protected m_levelsWithData
Levels on which the data is stored.
Protected m_partitionsToRefresh
A set of partition ids or Morton codes for the tiles to be refreshed.
Protected m_partitionsToRender
A set of partitions to be rendered.
Protected m_selectedFeatureId
A selected feature ID.
Protected m_selectedFeaturePartitionId
A selected feature partition id or Morton code.
Protected m_showGrid
Indicates whether tile grid should be shown
Protected m_tileCache
A tile cache.
Protected m_tileCacheSize
Size of the tile cache.
Protected m_tileSelectionLimit
Tile selection limit.
params
Readonly tileType
Type declaration
-
-
Parameters
-
dataSource: DataSource
-
tileKey: TileKey
Returns InteractiveTileType
-
-
Readonly Static DATA_LEVEL_CHANGED
This event is fired when data level was changed.
Readonly Static EVENT_ATTACHED
This event is fired when datasource is attached to MapView but is not connected yet.
Readonly Static EVENT_BEFORE_TILE_DECODE
This event is fired when the data for a tile is obtained and ready to be decoded. It can be used to track down an amount of time consumed by downloading of tile data (when used with InteractiveDataSource.EVENT_TILE_GET).
Readonly Static EVENT_BEFORE_TILE_RENDERED
This event is fired when the data for a tile has already been decoded and is ready to be rendered.
Readonly Static EVENT_CONNECTION_ERROR
This event is fired when error occurred during connection.
Readonly Static EVENT_FEATURE_DESELECT
This event is fired when a feature is being deselected.
Readonly Static EVENT_FEATURE_HIGHLIGHT
This event is fired when a feature is being selected.
Readonly Static EVENT_FEATURE_SELECT
This event is fired when a feature is being selected.
Readonly Static EVENT_FEATURE_UNHIGHLIGHT
This event is fired when a feature is being un-highlighted.
Readonly Static EVENT_TILES_REFRESHED
This event is fired when all tiles are refreshed (for volatile layers).
Readonly Static EVENT_TILE_DECODED
This event is fired when the data for a tile is decoded. It can be used to capture a moment before tile objects are being created, or to track down an amount of time consumed by decoding (when used with InteractiveDataSource.EVENT_BEFORE_TILE_DECODE).
Readonly Static EVENT_TILE_DESELECT
This event is fired when a tile is deselected to not to be requested and rendered on the next render call.
Readonly Static EVENT_TILE_GET
This event is fired when a tile is requested via the InteractiveDataSource.getTile method. It can be used to detect when the tile is requested, or to keep track of how much time specific actions (like decoding or downloading of tile data) consume. This event is fired when the data is being retrieved from the network.
Readonly Static EVENT_TILE_GET_FROM_CACHE
This event is fired when a tile is requested via the InteractiveDataSource.getTile method. This event is fired when the data is being retrieved from the cache.
Readonly Static EVENT_TILE_RENDERED
This event is fired after the tile has been rendered. The event has a bounds
property,
which is a bounding box of the rendered geometry (useful for generic partitions).
Readonly Static EVENT_TILE_SELECT
This event is fired when a tile is selected to be requested on the next render call.
Readonly Static MORTON_CODE_FOR_GENERIC_PARTITION
Dummy Morton code for Tile
instances with generic partition data.
Accessors
enable3DRendering
-
Returns
true
if 3D mode was enabled.Returns boolean
-
Enable or disable 3D mode.
Parameters
-
enabled: boolean
Returns void
-
enableRefresh
-
Indicates if data source data can be refreshed. It is used only for volatile layers.
Returns boolean
featureFilters
-
Gets an array of feature filters.
Returns FeatureFilter[]
infoWidgetElementId
-
Gets infoWidgetElementId.
Returns string
lastSelectedPartition
-
Gets a last selected partition.
Returns undefined | null | string | number
-
Sets a last selected partition.
Parameters
-
partitionId: undefined | null | string | number
Returns void
-
lastSelectedTile
-
Gets a last selected partition.
Returns undefined | null | string | number
-
Sets a last selected partition.
Parameters
-
partitionId: undefined | null | string | number
Returns void
-
levelWithData
-
Gets a level where the data is stored.
Returns number
-
Sets a level where the data is stored.
Parameters
-
level: number
Returns void
-
levelsWithData
-
Gets a level where the data is stored.
Returns number[]
-
Sets a level where the data is stored.
Parameters
-
levels: number[]
Returns void
-
selectedPartitions
-
Returns selected tiles.
Returns Set<string | number>
selectedTiles
-
Returns selected tiles.
Returns Set<string | number>
showGrid
-
Indicates whether tile grid should be shown
Returns boolean
-
Indicates whether tile grid should be shown
Parameters
-
showGrid: boolean
Returns void
-
showLayerGeometry
-
Gets whether layer geometry should be shown.
Returns boolean
-
Sets whether layer geometry should be shown.
Parameters
-
toShow: boolean
Returns void
-
tileCacheSize
-
Gets the size of the tile cache.
Returns number
tileSelectionLimit
-
Gets the tile selection limit.
Returns number
Methods
addFeatureFilter
-
Adds a feature filter. It also modifies the filter by deleting the existing one if found.
Parameters
-
featureFilter: FeatureFilter
A feature filter to add.
-
Optional execute: boolean
If set to
true
, filter is applied immediately.
Returns void
-
applyFeatureFilters
-
Applies feature filters.
Parameters
-
Optional tile: InteractiveTile
If passed, geometries of this tile are updated, otherwise, geometries of the composed tile are updated.
Returns void
-
attach
-
Parameters
-
mapView: MapView
Returns void
-
canSelectMoreTiles
-
Returns
true
if the number of currently visualized tiles doesn't exceed the tile selection limit of this data source.Returns boolean
clearFilters
-
Clears filters.
Returns void
clearSelectedTiles
-
Deselects all currently selected tiles or tiles in data levels that are no longer selected.
Parameters
-
deselectedLevelsOnly: boolean = false
If set to 'true', deselects only tiles of data levels that are no longer selected.
Returns void
-
Protected configureTileDecoder
-
Configures tile decoder with a use of provided options and default options.
Parameters
-
Optional options: DecoderOptions
configuration options
-
Optional customOptions: OptionsMap
optional, new options - shape is specific for each decoder
Returns void
-
connect
-
Returns Promise<void>
Protected copyObjectFromTileIntoComposedTile
-
Copies an object from a tile into the composed tile.
Parameters
-
tile: InteractiveTile
A source tile.
Returns void
-
Protected createGeometries
-
Creates geometries for a tile.
Parameters
-
partitionId: string | number | TileKey
A partition id or tile key.
-
decodedTile: DecodedInteractiveTile
Decoded tile data.
-
Optional tile: InteractiveTile
Returns void
-
Protected createSchemaProvider
-
Creates an instance of SchemaProvider.
Returns Promise<SchemaProvider>
dataProvider
-
Returns DataProviderAbstract
decodeTile
-
Decodes tile data after it has been downloaded.
Parameters
-
data: {} | ArrayBuffer | SharedArrayBuffer
Raw data.
-
partitionId: string | TileKey
A partition id or tile key.
-
Optional theme: Theme
Color theme used to style layer geometry.
-
Optional enableCustomColors: boolean
Indicates whether custom geometry colors from GeoJSON properties are enabled.
Returns Promise<void | DecodedInteractiveTile>
-
Protected decodeTileWithSchema
-
Generates binary payload to be transferred to decoder. It has additional metadata with schema name and proto message name.
Parameters
-
data: ArrayBufferLike
Binary data.
-
tileKey: TileKey
Tile key.
-
schemaProvider: SchemaProvider
A schema provider instance to get schema and protobuf message name.
Returns Promise<DecodedInteractiveTile>
-
deselectFeature
-
Deselects a feature. Currently, it supports a single feature selection only.
Returns void
deselectTile
-
Stops rendering of a tile. If data source is not ready yet them tile is only removed from an array of tiles to render, and these tiles are updated after data source is connected.
Parameters
-
partitionId: string | number
A partition id or tile Morton code.
Returns void
-
dispose
-
Returns void
findFeatures
-
Find features by coordinates.
Parameters
-
x: number
X coordinate.
-
y: number
Y coordinate.
Returns InteractiveTileObject[]
A tile object.
-
getCatalogClient
-
Creates a catalog instance.
Returns Promise<undefined | Catalog>
Protected getComposedTile
-
Creates and returns
Tile
that is composed of objects from the selected tiles of the data level.Parameters
-
tileKey: TileKey
A tile key of the tile to be added to the composed tile.
Returns InteractiveTileType
A composed tile with data added from the selected tiles.
-
Protected getDataLevelTile
-
Creates and returns a tile from the data layer.
Parameters
-
idOrTileKey: string | TileKey
A tile key of a tile with data.
-
useCache: boolean = true
A flag to cache the tile data. Default is
true
.
Returns InteractiveTileType
A tile with data.
-
getFeatureObject
-
Gets a feature by using an object. This method is used to determine a feature object from an intersection object that is detected by the intersection agent. Default implementation treats an object as a feature.
Parameters
-
object: Object3D
An object to determine a feature from.
Returns undefined | InteractiveTileObject
An object feature ID, or
undefined
. -
getHighlightedFeatureId
-
Returns a feature ID of the highlighted feature.
Returns undefined | string | number
getIntersectionAgent
-
Returns an instance of InteractiveIntersectionAgent that is passed as a parameter to the constructor. For more information, see InteractiveDataSourceParameters.intersectionAgent.
Returns undefined | InteractiveIntersectionAgent
Protected getLoggerName
-
Returns the name of the data source logger.
Returns string
getObjectsToRaycast
-
Returns objects to raycast.
Parameters
-
tile: InteractiveTile
A source tile.
Returns Object3D[]
An array of objects to raycast.
-
getSelectedFeatureId
-
Returns a feature ID of the selected (filtered) feature.
Returns undefined | string | number
getTile
-
Returns an instance of InteractiveTile. The tile may not contain any objects until its data is downloaded and decoded. For more information, see InteractiveDataSource.EVENT_TILE_DECODED.
Parameters
-
partitionId: string | TileKey
A partition id or tile key of the requested tile.
Returns undefined | InteractiveTileType
A tile with data.
-
hasTileToRender
-
Returns
true
if a tile is selected to be rendered, otherwise,false
.Parameters
-
partition: string | number
A partition id or tile Morton code.
Returns boolean
-
highlightFeature
-
Highlights a feature.
Parameters
-
object: InteractiveTileObject
An object to highlight.
-
featureObject: undefined | InteractiveTileObject
A feature object.
-
event: InteractiveIntersectionEvent
An intersection event.
Returns void
-
initialSchemaProvider
-
Returns initial schema provider, or
undefined
.Returns undefined | SchemaProvider
isCustomSchemaUsed
-
Returns true if a custom schema is used.
Returns boolean
Protected isTileValid
-
Returns
true
if a tile is valid and cached,false
if a tile is invalid. Invalid tiles are removed from the cache and reloaded during selection and deselection.Parameters
-
partition: string | number
A partition identifier.
Returns boolean
Validity of a tile.
-
Protected markPartitionInvalid
-
Marks a partition as invalid. As a result, the tile is removed from the cache and reloaded during selection and deselection.
Parameters
-
partition: string | number
A partition identifier, or tile Morton code.
Returns void
-
Protected markPartitionValid
-
Marks a partition as valid. As a result, the tile is cached during selection and deselection.
Parameters
-
partition: string | number
A partition identifier, or tile Morton code.
Returns void
-
Protected markTileInvalid
-
Marks a tile as invalid. As a result, the tile is removed from the cache and reloaded during selection and deselection.
Parameters
-
partition: string | number
A partition identifier.
Returns void
-
Protected markTileValid
-
Marks a tile as valid. As a result, the tile is cached during selection and deselection.
Parameters
-
partition: string | number
A partition identifier.
Returns void
-
Protected onCatalogVersionChange
-
Returns void
ready
-
Returns boolean
refreshTiles
-
Triggers a refresh of all selected tiles and clears the tile cache. It is used for the volatile layer connection.
Returns void
removeFeatureFilter
-
Removes a feature filter.
Parameters
-
featureFilter: FeatureFilter
A feature filter to remove. The
exclude
parameter is ignored.
Returns void
-
Protected resetComposedTile
-
Resets the composed tile.
Returns void
resetDataProvider
-
Resets the data provider of this data source.
Parameters
-
dataProvider: DataProviderAbstract
A new data provider.
-
clearCache: boolean = false
Set to
true
to clear the tile cache of this data source.
Returns Promise<void>
-
retrieveTileData
-
Asynchronously retrieves tile data. Calls decodeTile after data has been downloaded.
Parameters
-
id: string | TileKey
A tile key or partition id.
-
useCache: boolean = true
A flag to cache tile data. Default is
true
.
Returns void
-
schemaProvider
-
Returns an instance of SchemaProvider, or
undefined
if the catalog layer doesn't contain any schema or this data source is not connected.Returns undefined | SchemaProvider
selectFeature
-
Selects a feature.
Parameters
-
featureObject: InteractiveTileObject
A feature to select.
-
Optional event: InteractiveIntersectionEvent
An intersection event.
Returns void
-
selectTile
-
Selects a tile to be rendered. If data source is not ready yet then tile is only added to an array of tiles to render, and these tiles are updated after data source is connected.
Parameters
-
partitionId: string | number
A partition id or tile Morton code.
Returns Promise<boolean>
true
if a tile is successfully selected (it might need to download extra data),false
if not. -
setFeatureFilters
-
Sets feature filters.
Parameters
-
featureFilters: FeatureFilter[]
Feature filters to update.
-
Optional execute: boolean
If set to
true
or omitted, filters are applied immediately.
Returns void
-
setSchemaProvider
-
Sets an instance of SchemaProvider to be used by this data source. To redraw already rendered tiles with a new schema provider, use the InteractiveDataSource.refreshTiles method.
Parameters
-
schemaProvider: undefined | SchemaProvider
An instance of SchemaProvider, or
undefined
.
Returns void
-
setUpIntersectionAgent
-
Sets up an intersection agent for this data source.
Parameters
-
intersectionAgent: InteractiveIntersectionAgent
Returns void
-
tileDecoded
-
Processes decoded tile data - for example, by creating geometries.
Parameters
-
id: string | number | TileKey
A partition id or tile key.
-
decodedTile: DecodedInteractiveTile
Decoded tile data.
Returns void
-
unhighlightFeature
-
Removes highlight from a feature.
Returns void
In This Article
- Type parameters
- Hierarchy
- Index
- Constructors
- Properties
- cacheable
- isPrimary
- isSelected
- Readonly logger
- Protected m_composedTile
- Protected Optional m_enableRefresh
- Protected m_featureFilters
- Protected m_highlightedFeatureId
- Protected m_highlightedFeatureIndex
- Protected m_highlightedFeatureType
- Protected m_infoWidgetElementId
- Protected m_intersectionAgent
- Protected m_invalidPartitions
- Protected m_isInteractiveDataSourceReady
- Protected m_levelWithData
- Protected m_levelsWithData
- Protected m_partitionsToRefresh
- Protected m_partitionsToRender
- Protected m_selectedFeatureId
- Protected m_selectedFeaturePartitionId
- Protected m_showGrid
- Protected m_tileCache
- Protected m_tileCacheSize
- Protected m_tileSelectionLimit
- params
- Readonly tileType
- Readonly Static DATA_LEVEL_CHANGED
- Readonly Static EVENT_ATTACHED
- Readonly Static EVENT_BEFORE_TILE_DECODE
- Readonly Static EVENT_BEFORE_TILE_RENDERED
- Readonly Static EVENT_CONNECTION_ERROR
- Readonly Static EVENT_FEATURE_DESELECT
- Readonly Static EVENT_FEATURE_HIGHLIGHT
- Readonly Static EVENT_FEATURE_SELECT
- Readonly Static EVENT_FEATURE_UNHIGHLIGHT
- Readonly Static EVENT_TILES_REFRESHED
- Readonly Static EVENT_TILE_DECODED
- Readonly Static EVENT_TILE_DESELECT
- Readonly Static EVENT_TILE_GET
- Readonly Static EVENT_TILE_GET_FROM_CACHE
- Readonly Static EVENT_TILE_RENDERED
- Readonly Static EVENT_TILE_SELECT
- Readonly Static MORTON_CODE_FOR_GENERIC_PARTITION
- cacheable
- Accessors
- Methods
- addFeatureFilter
- applyFeatureFilters
- attach
- canSelectMoreTiles
- clearFilters
- clearSelectedTiles
- Protected configureTileDecoder
- connect
- Protected copyObjectFromTileIntoComposedTile
- Protected createGeometries
- Protected createSchemaProvider
- dataProvider
- decodeTile
- Protected decodeTileWithSchema
- deselectFeature
- deselectTile
- dispose
- findFeatures
- getCatalogClient
- Protected getComposedTile
- Protected getDataLevelTile
- getFeatureObject
- getHighlightedFeatureId
- getIntersectionAgent
- Protected getLoggerName
- getObjectsToRaycast
- getSelectedFeatureId
- getTile
- hasTileToRender
- highlightFeature
- initialSchemaProvider
- isCustomSchemaUsed
- Protected isTileValid
- Protected markPartitionInvalid
- Protected markPartitionValid
- Protected markTileInvalid
- Protected markTileValid
- Protected onCatalogVersionChange
- ready
- refreshTiles
- removeFeatureFilter
- Protected resetComposedTile
- resetDataProvider
- retrieveTileData
- schemaProvider
- selectFeature
- selectTile
- setFeatureFilters
- setSchemaProvider
- setUpIntersectionAgent
- tileDecoded
- unhighlightFeature
- addFeatureFilter
- Legend
An interactive data source.