Skip to content

TileLayer loadTileBitmap support abort #2563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ const TileLayerRenderable = function <T extends MixinConstructor>(Base: T) {
loadTile(tile: Tile['info']): Tile['image'] {
let tileImage = {} as Tile['image'];
// fixme: 无相关定义,是否实现?
if (this.loadTileBitmap) {
if (this.loadTileBitmap && isFunction(this.loadTileBitmap)) {
const onLoad = (bitmap) => {
this.onTileLoad(bitmap, tile);
};
Expand Down Expand Up @@ -677,6 +677,14 @@ const TileLayerRenderable = function <T extends MixinConstructor>(Base: T) {
tileImage.onerror = falseFn;
tileImage.src = emptyImageUrl;
}
if (this.loadTileBitmap && isFunction(this.loadTileBitmap)) {
const url = tileInfo.url;
this.loadTileBitmap(url, tileInfo, () => {

}, {
command: 'abortTile'
})
}
}

onTileLoad(tileImage: Tile['image'], tileInfo: Tile['info']): void {
Expand Down