Skip to content

Commit

Permalink
catch getTile createImageBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
deyihu committed Oct 13, 2024
1 parent 48278fa commit 3fbdae3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/tileget.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ export function getTile(url, options = {}) {
reject(new Error('url is null'));
return;
}
fetch(url).then(res => res.blob()).then(blob => {
createImageBitmap(blob).then(image => {
resolve(image);
});
fetch(url).then(res => res.blob()).then(blob => createImageBitmap(blob)).then(imagebit => {
resolve(imagebit);
}).catch(error => {
reject(error);
});
Expand Down

0 comments on commit 3fbdae3

Please sign in to comment.