Powered by Zoomin Software. For more details please contactZoomin

Data Inspector Library - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

Data Inspector Library - API Reference: InteractiveDataSource | Data Inspector Library API Reference

Table of Contents
HomeData Inspector Library - API Reference...Modules@here/interactive-datasource-protocolInteractiveDataSource | Data Inspector Library API ReferenceCurrent page
Table of Contents

InteractiveDataSource | Data Inspector Library API Reference

An interactive data source.

Type parameters

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • A default constructor.

    Type parameters

    Parameters

    • tileType: (dataSource: DataSource, tileKey: TileKey) => InteractiveTileType

      A tile constructor.

        • (dataSource: DataSource, tileKey: TileKey): InteractiveTileType
        • Parameters

          • dataSource: DataSource
          • tileKey: TileKey

          Returns InteractiveTileType

    • params: InteractiveDataSourceParameters

      Parameters to configure this data source.

    Returns InteractiveDataSource<InteractiveTileType>

Properties

cacheable

cacheable: boolean = false

Set to true if the MapView can cache tiles produced by this DataSource.

isPrimary

isPrimary: boolean

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

isSelected: boolean

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

logger: ILogger

An instance of logger.

Protected m_composedTile

m_composedTile: undefined | InteractiveTileType

A tile of any level that contains objects from dataLevel tiles (a composition of lower-level tiles).

Protected Optional m_enableRefresh

m_enableRefresh: undefined | boolean

Indicates if the data source data can be refreshed. It is used only for volatile layers.

Protected m_featureFilters

m_featureFilters: FeatureFilter[] = ...

An array of feature filters.

Protected m_highlightedFeatureId

m_highlightedFeatureId: undefined | string | number

A highlighted feature ID.

Protected m_highlightedFeatureIndex

m_highlightedFeatureIndex: undefined | number

A highlighted feature index.

Protected m_highlightedFeatureType

m_highlightedFeatureType: undefined | string

A highlighted feature type.

Protected m_infoWidgetElementId

m_infoWidgetElementId: string = "info-panel"

An ID that will be used for corresponding InfoWidget element.

Protected m_intersectionAgent

m_intersectionAgent: undefined | InteractiveIntersectionAgent

An instance of intersection agent to highlight and select data source features and tiles.

Protected m_invalidPartitions

m_invalidPartitions: Set<string | number> = ...

A set of invalid partitions. Corresponding tiles are to be removed from the cache and loaded again on selection.

Protected m_isInteractiveDataSourceReady

m_isInteractiveDataSourceReady: boolean = false

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

m_levelWithData: number

A level on which the data is stored.

deprecated

Use levelsWithData.

Protected m_levelsWithData

m_levelsWithData: number[]

Levels on which the data is stored.

Protected m_partitionsToRefresh

m_partitionsToRefresh: Set<string | number> = ...

A set of partition ids or Morton codes for the tiles to be refreshed.

Protected m_partitionsToRender

m_partitionsToRender: Set<string | number> = ...

A set of partitions to be rendered.

Protected m_selectedFeatureId

m_selectedFeatureId: undefined | string | number

A selected feature ID.

Protected m_selectedFeaturePartitionId

m_selectedFeaturePartitionId: undefined | null | string | number

A selected feature partition id or Morton code.

Protected m_showGrid

m_showGrid: boolean = true

Indicates whether tile grid should be shown

Protected m_tileCache

m_tileCache: LRUCache<string | number, any>

A tile cache.

Protected m_tileCacheSize

m_tileCacheSize: number = 64

Size of the tile cache.

Protected m_tileSelectionLimit

m_tileSelectionLimit: number = ...

Tile selection limit.

params

Readonly tileType

tileType: (dataSource: DataSource, tileKey: TileKey) => InteractiveTileType

Type declaration

    • (dataSource: DataSource, tileKey: TileKey): InteractiveTileType
    • Parameters

      • dataSource: DataSource
      • tileKey: TileKey

      Returns InteractiveTileType

Readonly Static DATA_LEVEL_CHANGED

DATA_LEVEL_CHANGED: "data-level-changed" = "data-level-changed"

This event is fired when data level was changed.

readonly

Readonly Static EVENT_ATTACHED

EVENT_ATTACHED: "attached" = "attached"

This event is fired when datasource is attached to MapView but is not connected yet.

readonly

Readonly Static EVENT_BEFORE_TILE_DECODE

EVENT_BEFORE_TILE_DECODE: "beforetiledecode" = "beforetiledecode"

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

Readonly Static EVENT_BEFORE_TILE_RENDERED

EVENT_BEFORE_TILE_RENDERED: "beforetilerendered" = "beforetilerendered"

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

EVENT_CONNECTION_ERROR: "connection_error" = "connection_error"

This event is fired when error occurred during connection.

readonly

Readonly Static EVENT_FEATURE_DESELECT

EVENT_FEATURE_DESELECT: "featuredeselect" = "featuredeselect"

This event is fired when a feature is being deselected.

readonly

Readonly Static EVENT_FEATURE_HIGHLIGHT

EVENT_FEATURE_HIGHLIGHT: "featurehighlight" = "featurehighlight"

This event is fired when a feature is being selected.

readonly

Readonly Static EVENT_FEATURE_SELECT

EVENT_FEATURE_SELECT: "featureselect" = "featureselect"

This event is fired when a feature is being selected.

readonly

Readonly Static EVENT_FEATURE_UNHIGHLIGHT

EVENT_FEATURE_UNHIGHLIGHT: "featureunhighlight" = "featureunhighlight"

This event is fired when a feature is being un-highlighted.

readonly

Readonly Static EVENT_TILES_REFRESHED

EVENT_TILES_REFRESHED: "tilesrefreshed" = "tilesrefreshed"

This event is fired when all tiles are refreshed (for volatile layers).

readonly

Readonly Static EVENT_TILE_DECODED

EVENT_TILE_DECODED: "tiledecode" = "tiledecode"

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

Readonly Static EVENT_TILE_DESELECT

EVENT_TILE_DESELECT: "tiledeselect" = "tiledeselect"

This event is fired when a tile is deselected to not to be requested and rendered on the next render call.

readonly

Readonly Static EVENT_TILE_GET

EVENT_TILE_GET: "tileget" = "tileget"

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
example

Detect tile request:

interactiveDataSource.addEventListener(InteractiveDataSource.EVENT_TILE_GET,
   (event: InteractiveDataSourceEvent) => {
      if (event.tileKey === undefined) {
         return;
      }
      console.log("Tile ", event.tileKey.mortonCode(), " requested");
   }
);

Readonly Static EVENT_TILE_GET_FROM_CACHE

EVENT_TILE_GET_FROM_CACHE: "tilegetfromcache" = "tilegetfromcache"

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

EVENT_TILE_RENDERED: "tilerendered" = "tilerendered"

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

EVENT_TILE_SELECT: "tileselect" = "tileselect"

This event is fired when a tile is selected to be requested on the next render call.

readonly
example

Get information about selected tiles:

interactiveDataSource.addEventListener(InteractiveDataSource.EVENT_TILE_SELECT,
   (event: InteractiveDataSourceEvent) => {
      if (event.tileKey === undefined) {
         return;
      }
      console.log(interactiveDataSource.selectedPartitions);
   }
);

Readonly Static MORTON_CODE_FOR_GENERIC_PARTITION

MORTON_CODE_FOR_GENERIC_PARTITION: number = ...

Dummy Morton code for Tile instances with generic partition data.

Accessors

enable3DRendering

  • get enable3DRendering(): boolean
  • set enable3DRendering(enabled: boolean): void
  • Returns true if 3D mode was enabled.

    Returns boolean

  • Enable or disable 3D mode.

    Parameters

    • enabled: boolean

    Returns void

enableRefresh

  • get enableRefresh(): boolean
  • 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

  • get infoWidgetElementId(): string
  • Gets infoWidgetElementId.

    Returns string

lastSelectedPartition

  • get lastSelectedPartition(): undefined | null | string | number
  • set lastSelectedPartition(partitionId: undefined | null | string | number): void
  • Gets a last selected partition.

    Returns undefined | null | string | number

  • Sets a last selected partition.

    Parameters

    • partitionId: undefined | null | string | number

    Returns void

lastSelectedTile

  • get lastSelectedTile(): undefined | null | string | number
  • set lastSelectedTile(partitionId: undefined | null | string | number): void
  • Gets a last selected partition.

    deprecated

    Use lastSelectedPartition.

    Returns undefined | null | string | number

  • Sets a last selected partition.

    deprecated

    Use lastSelectedPartition.

    Parameters

    • partitionId: undefined | null | string | number

    Returns void

levelWithData

  • get levelWithData(): number
  • set levelWithData(level: number): void
  • Gets a level where the data is stored.

    deprecated

    Use levelsWithData.

    Returns number

  • Sets a level where the data is stored.

    fires

    InteractiveDataSource.DATA_LEVEL_CHANGED

    deprecated

    Use levelsWithData.

    Parameters

    • level: number

    Returns void

levelsWithData

  • get levelsWithData(): number[]
  • set levelsWithData(levels: number[]): void
  • Gets a level where the data is stored.

    Returns number[]

  • Sets a level where the data is stored.

    fires

    InteractiveDataSource.DATA_LEVEL_CHANGED

    Parameters

    • levels: number[]

    Returns void

selectedPartitions

  • get selectedPartitions(): Set<string | number>
  • Returns selected tiles.

    Returns Set<string | number>

selectedTiles

  • get selectedTiles(): Set<string | number>
  • Returns selected tiles.

    deprecated

    Use selectedPartitions.

    Returns Set<string | number>

showGrid

  • get showGrid(): boolean
  • set showGrid(showGrid: boolean): void
  • Indicates whether tile grid should be shown

    Returns boolean

  • Indicates whether tile grid should be shown

    Parameters

    • showGrid: boolean

    Returns void

showLayerGeometry

  • get showLayerGeometry(): boolean
  • set showLayerGeometry(toShow: boolean): void
  • Gets whether layer geometry should be shown.

    Returns boolean

  • Sets whether layer geometry should be shown.

    Parameters

    • toShow: boolean

    Returns void

tileCacheSize

  • get tileCacheSize(): number
  • Gets the size of the tile cache.

    Returns number

tileSelectionLimit

  • get tileSelectionLimit(): number
  • Gets the tile selection limit.

    Returns number

Methods

addFeatureFilter

  • addFeatureFilter(featureFilter: FeatureFilter, execute?: boolean): void
  • 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

  • attach(mapView: MapView): void
  • inheritdoc

    Parameters

    • mapView: MapView

    Returns void

canSelectMoreTiles

  • canSelectMoreTiles(): boolean
  • Returns true if the number of currently visualized tiles doesn't exceed the tile selection limit of this data source.

    Returns boolean

clearFilters

  • clearFilters(): void
  • Clears filters.

    Returns void

clearSelectedTiles

  • clearSelectedTiles(deselectedLevelsOnly?: boolean): void
  • 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

  • configureTileDecoder(options?: DecoderOptions, customOptions?: OptionsMap): void
  • 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

  • connect(): Promise<void>
  • inheritdoc

    Returns Promise<void>

Protected copyObjectFromTileIntoComposedTile

  • Copies an object from a tile into the composed tile.

    Parameters

    Returns void

Protected createGeometries

  • Creates geometries for a tile.

    Parameters

    Returns void

Protected createSchemaProvider

  • Creates an instance of SchemaProvider.

    Returns Promise<SchemaProvider>

dataProvider

  • inheritdoc

    Returns DataProviderAbstract

decodeTile

  • decodeTile(data: {} | ArrayBuffer | SharedArrayBuffer, partitionId: string | TileKey, theme?: Theme, enableCustomColors?: boolean): Promise<void | DecodedInteractiveTile>
  • Decodes tile data after it has been downloaded.

    fires

    InteractiveDataSource.EVENT_BEFORE_TILE_DECODE

    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.

    deprecated

    Use this.decoder.decodeTileWithSchema

    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

  • deselectFeature(): void
  • Deselects a feature. Currently, it supports a single feature selection only.

    fires

    InteractiveDataSource.EVENT_FEATURE_DESELECT

    Returns void

deselectTile

  • deselectTile(partitionId: string | number): void
  • 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.

    fires

    InteractiveDataSource.EVENT_TILE_DESELECT

    Parameters

    • partitionId: string | number

      A partition id or tile Morton code.

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

findFeatures

  • Find features by coordinates.

    Parameters

    • x: number

      X coordinate.

    • y: number

      Y coordinate.

    Returns InteractiveTileObject[]

    A tile object.

getCatalogClient

  • getCatalogClient(): Promise<undefined | Catalog>
  • Creates a catalog instance.

    Returns Promise<undefined | Catalog>

Protected getComposedTile

  • getComposedTile(tileKey: TileKey): InteractiveTileType
  • 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

  • getDataLevelTile(idOrTileKey: string | TileKey, useCache?: boolean): InteractiveTileType
  • Creates and returns a tile from the data layer.

    fires

    InteractiveDataSource.EVENT_TILE_GET

    fires

    InteractiveDataSource.EVENT_TILE_GET_FROM_CACHE

    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

  • getHighlightedFeatureId(): undefined | string | number
  • Returns a feature ID of the highlighted feature.

    Returns undefined | string | number

getIntersectionAgent

Protected getLoggerName

  • getLoggerName(): string
  • Returns the name of the data source logger.

    Returns string

getObjectsToRaycast

  • Returns objects to raycast.

    Parameters

    Returns Object3D[]

    An array of objects to raycast.

getSelectedFeatureId

  • getSelectedFeatureId(): undefined | string | number
  • Returns a feature ID of the selected (filtered) feature.

    Returns undefined | string | number

getTile

  • getTile(partitionId: string | TileKey): undefined | InteractiveTileType
  • 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

  • hasTileToRender(partition: string | number): boolean
  • 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

initialSchemaProvider

  • Returns initial schema provider, or undefined.

    Returns undefined | SchemaProvider

isCustomSchemaUsed

  • isCustomSchemaUsed(): boolean
  • Returns true if a custom schema is used.

    Returns boolean

Protected isTileValid

  • isTileValid(partition: string | number): boolean
  • 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

  • markPartitionInvalid(partition: string | number): void
  • 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

  • markPartitionValid(partition: string | number): void
  • 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

  • markTileInvalid(partition: string | number): void
  • Marks a tile as invalid. As a result, the tile is removed from the cache and reloaded during selection and deselection.

    deprecated

    Use markPartitionInvalid instead.

    Parameters

    • partition: string | number

      A partition identifier.

    Returns void

Protected markTileValid

  • markTileValid(partition: string | number): void
  • Marks a tile as valid. As a result, the tile is cached during selection and deselection.

    deprecated

    Use markPartitionValid instead.

    Parameters

    • partition: string | number

      A partition identifier.

    Returns void

Protected onCatalogVersionChange

  • onCatalogVersionChange(): void
  • Returns void

ready

  • ready(): boolean
  • inheritdoc

    Returns boolean

refreshTiles

  • refreshTiles(): void
  • 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

  • resetComposedTile(): void
  • 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

  • retrieveTileData(id: string | TileKey, useCache?: boolean): void
  • 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

selectTile

  • selectTile(partitionId: string | number): Promise<boolean>
  • 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.

    fires

    InteractiveDataSource.EVENT_TILE_SELECT

    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

  • setFeatureFilters(featureFilters: FeatureFilter[], execute?: boolean): void
  • 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

setUpIntersectionAgent

  • Sets up an intersection agent for this data source.

    Parameters

    Returns void

tileDecoded

  • Processes decoded tile data - for example, by creating geometries.

    fires

    InteractiveDataSource.EVENT_TILE_DECODED

    Parameters

    • id: string | number | TileKey

      A partition id or tile key.

    • decodedTile: DecodedInteractiveTile

      Decoded tile data.

    Returns void

unhighlightFeature

  • unhighlightFeature(): void

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Class
  • Class with type parameter
  • Property
  • Method
  • Accessor
  • Interface
  • Interface with type parameter
  • Protected property
  • Protected method
  • Enumeration
  • Static property
In This Article
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert