Skip to content

Commit

Permalink
Fix image.decode() return
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Dec 21, 2024
1 parent 1a779a8 commit 7dd8aae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ const source = new Source({
loader(z, x, y, {signal}) {
const image = new Image();
image.src = `${z}/${x}/${y}.png`};
return image.decode();
return image.decode().then(() => createImageBitmap(image));
}
});
```
Expand All @@ -710,7 +710,7 @@ const source = new Source({
bbox: extent.join(','),
});
image.src = `map?crs=[EPSG:3857]&scale-denominator=1&${query.toString()}`;
return {image: image.decode(), pixelRatio: 1};
return {image: image.decode().then(() => createImageBitmap(image)), pixelRatio: 1};
}
});
```
Expand Down

0 comments on commit 7dd8aae

Please sign in to comment.