summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Paul <info@jaller.de>2023-02-26 17:51:39 +0100
committerChristian Paul <info@jaller.de>2023-02-26 17:51:39 +0100
commit50294ac6337e8024f4ca3043833669544f9a211f (patch)
tree922de0bd7b0223eb317b81f04aacc7b2a087d305
parent4fe9a60a0c9da952dadc5214a9ca5c68c447fdf8 (diff)
Hide "Unimplemented type: 4" errorhide-type-4-error
-rw-r--r--src/Tile.js13
1 files changed, 12 insertions, 1 deletions
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) {