Class DataSourceAbstract

Derive a class from DataSource to contribute data and geometries to the MapView.

Hierarchy

Constructors

Properties

addGroundPlane: boolean = false

Whether the datasource should have a ground plane (this plane covers the tile entirely and has the minimum possible renderOrder), this can be required in some cases when fallback parent tiles need to be covered by the children, otherwise the content will overlap. Default is false

allowOverlappingTiles: boolean = true
cacheable: boolean = false

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

dataSourceOrder: number = 0

Overrides the default rendering order of this DataSource.

Remarks

When dataSourceOrder is defined, all the objects created by this DataSource will be rendered on top of the objects created by other DataSources with lower dataSourceOrder values.

Default Value

undefined

enablePicking: boolean = true
enabled: boolean = true

Set to true if this DataSource is enabled; false otherwise.

languages?: string[]

An array of ISO 639-1 language codes.

maxDataLevel: number = 20

The maximum zoom level at which data is available.

maxDisplayLevel: number = 20

The maximum zoom level at which DataSource is displayed.

minDataLevel: number = 1

The minimum zoom level at which data is available.

minDisplayLevel: number = 1

The minimum zoom level at which DataSource is displayed.

name: string

The unique name of a DataSource instance.

useGeometryLoader: boolean = false

Set to true if the loader should be used to get the tile contents.

Accessors

  • get minGeometryHeight(): number
  • Minimum geometry height below ground level this DataSource can produce. A negative number specifies a value below ground level.

    Used in first stage of frustum culling before Tile.minGeometryHeight data is available.

    Returns number

    Default

    0.
    
  • set minGeometryHeight(value): void
  • Parameters

    • value: number

    Returns void

  • get storageLevelOffset(): number
  • The difference between storage level and display level of tile.

    Storage level offset is a value applied (added) to current zoom level giving a final tile level being displayed. This way we may differentiate current zoom level from the storage level that is displayed, giving fine grained control over the tiles being decoded an displayed.

    Returns number

  • set storageLevelOffset(levelOffset): void
  • Setup the relative offset between storage level and display level of tile.

    Parameters

    • levelOffset: number

      Difference between zoom level and display level.

    Returns void

Methods

  • This method is called when the DataSource is added to a MapView. Override this method to provide any custom initialization, such as, to establish a network connection, or to initialize complex data structures.

    Returns Promise<void>

  • Gets the state of the given feature id.

    Parameters

    • featureId: string | number

      The id of the feature. Id numbers are deprecated in favor of strings.

    Returns undefined | ValueMap

  • Boolean which says whether a DataSource produces tiles that fully cover the tile, i.e. tiles underneath are completely hidden. Must be overridden for DataSource's that don't have a ground plane, but which still fully cover the tile, e.g. web tiles.

    Returns boolean

  • Removes the state associated to the given feature.

    Parameters

    • featureId: string | number

      The id of the feature. Id numbers are deprecated in favor of strings.

    Returns void

  • Enables or disables overlay of geometry on elevation. It must be overloaded by data sources supporting this feature.

    Parameters

    • enable: boolean

    Returns void

  • Sets the state of the given feature id.

    dataSource.setFeatureState(featureId, { enabled: true });
    

    Parameters

    • featureId: string | number

      The id of the feature. Id numbers are deprecated in favor of strings.

    • state: ValueMap

      The new state of the feature.

    Returns void

  • Used to configure the languages used by the DataSource according to priority; the first language in the array has the highest priority.

    Parameters

    • Optional languages: string[]

      An array of ISO 639-1 language codes.

    Returns void

  • Used to express different country point of view (political view).

    Parameters

    • Optional pov: string

      The country code which point of view should be presented in lower-case ISO 3166-1 alpha-2 format.

    Returns void

    Note

    Set to undefined (or empty string) if you want to reset to default point of view.

  • This method is called by the MapView to determine if the content of the surrounding tiles must be preloaded.

    Returns boolean

    true if the MapView should try to preload tiles surrounding the visible tiles; false otherwise. The default is false.

  • Returns true if MapView should render the text elements with the given @xyzmaps/harp-geoutils#TileKey and zoom level.

    Parameters

    • zoomLevel: number

      The zoom level.

    • tileKey: TileKey

      The unique identifier for a map tile.

    Returns boolean

    true if the text elements created for the given @xyzmaps/harp-geoutils#TileKey should be rendered.

    Remarks

    This is an additional check for the tiles that are already selected for rendering so the default implementation returns true.

Generated using TypeDoc