From 50294ac6337e8024f4ca3043833669544f9a211f Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Sun, 26 Feb 2023 17:51:39 +0100 Subject: [PATCH] Hide "Unimplemented type: 4" error --- src/Tile.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Tile.js b/src/Tile.js index ba207eb..d2d303f 100644 --- a/src/Tile.js +++ b/src/Tile.js @@ -30,7 +30,18 @@ class Tile { } _loadTile(buffer) { - this.tile = new VectorTile(new Protobuf(buffer)); + try { + this.tile = new VectorTile(new Protobuf(buffer)); + } catch (error) { + // Ignoring upstream issue https://github.com/rastapasta/mapscii/issues/87 + if (error.message === 'Unimplemented type: 4') { + this.tile = { + layers: [], + }; + return; + } + throw error; + } } _unzipIfNeeded(buffer) {