How to use the @here/harp-mapview.TileLoaderState.Ready function in @here/harp-mapview

To help you get started, we’ve selected a few @here/harp-mapview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
protected onLoaded(payload: ArrayBufferLike | {}) {
        this.state = TileLoaderState.Loaded;
        this.payload = payload;

        if ((payload as ArrayBufferLike).byteLength !== undefined) {
            if ((payload as ArrayBufferLike).byteLength === 0) {
                this.onDone(TileLoaderState.Ready);
                return;
            }
        }
        // Object is empty
        if ((payload as {}) === {}) {
            this.onDone(TileLoaderState.Ready);
            return;
        }

        // TBD: we might suspend decode if tile is not visible ... ?
        this.startDecodeTile();
    }
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
protected onLoaded(payload: ArrayBufferLike | {}) {
        this.state = TileLoaderState.Loaded;
        this.payload = payload;

        if ((payload as ArrayBufferLike).byteLength !== undefined) {
            if ((payload as ArrayBufferLike).byteLength === 0) {
                this.onDone(TileLoaderState.Ready);
                return;
            }
        }
        // Object is empty
        if ((payload as {}) === {}) {
            this.onDone(TileLoaderState.Ready);
            return;
        }

        // TBD: we might suspend decode if tile is not visible ... ?
        this.startDecodeTile();
    }
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
.then(tileInfo => {
                if (requestController.signal.aborted) {
                    // our flow is cancelled, silently return
                    return;
                }
                this.tileInfo = tileInfo;

                this.onDone(TileLoaderState.Ready);
            })
            .catch(error => {
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileDataSource.ts View on Github external
tileLoader.loadAndDecode().then(loaderState => {
                if (loaderState === TileLoaderState.Ready) {
                    resolve(tileLoader.tileInfo);
                } else {
                    reject(
                        new Error(`TileDataSource#getInfoTile wrong final state: ${loaderState}`)
                    );
                }
            });
        });
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
get isFinished(): boolean {
        return (
            this.state === TileLoaderState.Ready ||
            this.state === TileLoaderState.Canceled ||
            this.state === TileLoaderState.Failed
        );
    }