@here/harp-mapview
Version:
Functionality needed to render a map.
56 lines • 1.72 kB
TypeScript
import { DecodedTile } from "@here/harp-datasource-protocol";
/**
* The state the {@link ITileLoader}.
*/
export declare enum TileLoaderState {
Initialized = 0,
Loading = 1,
Loaded = 2,
Decoding = 3,
Ready = 4,
Canceled = 5,
Failed = 6
}
/**
* The interface for managing tile loading.
*/
export interface ITileLoader {
/**
* Current state of `TileLoader`.
*/
state: TileLoaderState;
/**
* The result of decoding the `payload`: The [[DecodedTile]].
*/
decodedTile?: DecodedTile;
/**
* `true` if [[Tile]] is still loading, `false` otherwise.
*/
readonly isFinished: boolean;
/**
* Priority given to the tile loading task. The greater the number, the higher the priority.
*/
priority: number;
/**
* Start loading and/or proceed through the various states of loading of this tile.
*
* @param client - Optional client requesting the load.
* @returns A promise which resolves the [[TileLoaderState]].
*/
loadAndDecode(client?: any): Promise<TileLoaderState>;
/**
* Return the current state in form of a promise. Caller can then wait for the promise to be
* resolved.
*
* @returns A promise which resolves the current [[TileLoaderState]].
*/
waitSettled(): Promise<TileLoaderState>;
/**
* Cancel loading of the [[Tile]].
* Cancellation token is notified, an internal state is cleaned up.
* @param client - Optional client requesting the cancelation. It's expected to match one of
* the clients that previously called {@link ITileLoader.loadAndDecode}.
*/
cancel(client?: any): void;
}
//# sourceMappingURL=ITileLoader.d.ts.map