Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for all DataProvider subclasses.

remarks

The DataProvider is an abstraction of the tile loader which is only responsible for loading the data of a specific tile, without any relation to displaying or even decoding the data.

Hierarchy

Index

Constructors

constructor

  • Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

    Returns DataProvider

Methods

addEventListener

  • addEventListener(type: string, listener: (event: Event) => void): void
  • Adds a listener to an event type.

    Parameters

    • type: string

      The type of event to listen to.

    • listener: (event: Event) => void

      The function that gets called when the event is fired.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns void

Protected Abstract connect

  • connect(): Promise<void>
  • Connect to the data source. Returns a promise to wait for successful (or failed) connection.

    Returns Promise<void>

    A promise which is resolved when the connection has been established.

dispatchEvent

  • dispatchEvent(event: { type: string }): void
  • Fire an event type.

    Parameters

    • event: { type: string }
      • [attachment: string]: any
      • type: string

    Returns void

Protected Abstract dispose

  • dispose(): void

Abstract getTile

  • getTile(tileKey: TileKey, abortSignal?: AbortSignal): Promise<ArrayBufferLike | {}>
  • Load the data of a {@link @here/map-view@Tile} asynchronously.

    Parameters

    • tileKey: TileKey

      Address of a tile.

    • Optional abortSignal: AbortSignal

      Optional AbortSignal to cancel the request.

    Returns Promise<ArrayBufferLike | {}>

    A promise delivering the data as an [[ArrayBufferLike]], or any object.

hasEventListener

  • hasEventListener(type: string, listener: (event: Event) => void): boolean
  • Checks if listener is added to an event type.

    Parameters

    • type: string

      The type of event to listen to.

    • listener: (event: Event) => void

      The function that gets called when the event is fired.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns boolean

Optional onDidInvalidate

  • onDidInvalidate(listener: () => void): () => void
  • An event which fires when this DataProvider is invalidated.

    example
    const dispose = dataProvider.onDidInvalidate?.(() => {
        console.log("invalidated");
    });

    Parameters

    • listener: () => void

      A function to call when this DataProvider is invalidated.

        • (): void
        • Returns void

    Returns () => void

    The function to call to unregister the listener from this event.

      • (): void
      • Returns void

Abstract ready

  • ready(): boolean

register

  • register(client: Object): Promise<void>
  • Registers a client to the data provider.

    Parameters

    • client: Object

      The client to register.

    Returns Promise<void>

    Promise to wait for successful (or failed) connection to the data source.

removeEventListener

  • removeEventListener(type: string, listener: (event: Event) => void): void
  • Removes a listener from an event type.

    Parameters

    • type: string

      The type of the listener that gets removed.

    • listener: (event: Event) => void

      The listener function that gets removed.

        • (event: Event): void
        • Parameters

          • event: Event

          Returns void

    Returns void

unregister

  • unregister(client: Object): void

Generated using TypeDoc