How to use the @here/harp-mapview.TileLoaderState.Canceled 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 onError(error: Error) {
        if (this.state === TileLoaderState.Canceled) {
            // If we're canceled, we should simply ignore any state transitions and errors from
            // underlying load/decode ops.
            return;
        }
        const dataSource = this.dataSource;
        logger.error(
            `[${dataSource.name}]: failed to load tile ${this.tileKey.mortonCode()}`,
            error
        );

        this.error = error;

        this.onDone(TileLoaderState.Failed);
    }
}
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
loadAndDecode(): Promise {
        switch (this.state) {
            case TileLoaderState.Loading:
            case TileLoaderState.Loaded:
            case TileLoaderState.Decoding:
                // tile is already loading
                this.countRequests++;
                return this.donePromise!;

            case TileLoaderState.Ready:
            case TileLoaderState.Failed:
            case TileLoaderState.Initialized:
            case TileLoaderState.Canceled:
                // restart loading
                this.countRequests++;
                this.startLoading();
                return this.donePromise!;
        }
    }
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TileLoader.ts View on Github external
}
        switch (this.state) {
            case TileLoaderState.Loading:
                this.loadAbortController.abort();
                this.loadAbortController = new AbortController();
                break;

            case TileLoaderState.Decoding:
                if (this.requestController) {
                    this.requestController.abort();
                    this.requestController = undefined;
                }
                break;
        }

        this.onDone(TileLoaderState.Canceled);
    }