From 89694564e034232a85acffe4b61a40846ba96e7f Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Tue, 23 Mar 2021 13:37:55 +0100 Subject: [PATCH] Fix for two js warnings "Failed to load tile" when reloading the page during a tile-load "Texture marked as update..." --- src/map/Map.js | 2 +- src/map/TileManager.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/Map.js b/src/map/Map.js index b83cc51..9bb8e82 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -267,7 +267,7 @@ export class Map { texture.wrapT = ClampToEdgeWrapping; texture.flipY = false; texture.flatShading = true; - texture.needsUpdate = true; + texture.image.addEventListener("load", () => texture.needsUpdate = true); this.loadedTextures.push(texture); diff --git a/src/map/TileManager.js b/src/map/TileManager.js index ad23d31..c7837b6 100644 --- a/src/map/TileManager.js +++ b/src/map/TileManager.js @@ -195,6 +195,7 @@ export class TileManager { .catch(error => { if (error.status && error.status === "empty") return; if (error.target && error.target.status === 404) return; + if (error.type && error.type === "abort") return; alert(this.events, "Failed to load tile: " + error, "warning"); })