Skip to content

Commit

Permalink
fix: fixed not catching an error when drawing on the map canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Endebert committed Oct 17, 2018
1 parent 6251785 commit c578791
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/assets/Leaflet_extensions/NoGapTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export default TileLayer.extend({
// Where in the canvas should this tile go?
const offset = new Point(coords.x, coords.y).subtract(level.canvasRange.min).scaleBy(this.getTileSize());

level.ctx.drawImage(imageSource, offset.x, offset.y, tileSize.x, tileSize.y);
try {
level.ctx.drawImage(imageSource, offset.x, offset.y, tileSize.x, tileSize.y);
} catch (e) {
console.warn("drawing on canvas failed:", e);
}

// TODO: Clear the pixels of other levels' canvases where they overlap
// this newly dumped tile.
Expand Down

0 comments on commit c578791

Please sign in to comment.