diff --git a/index.html b/index.html index 9cd182ac..42db850c 100644 --- a/index.html +++ b/index.html @@ -7988,7 +7988,7 @@ - + @@ -8057,7 +8057,7 @@ - + diff --git a/modules/io/load.js b/modules/io/load.js index 85ac2982..81786374 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -651,6 +651,17 @@ async function parseLoadedData(data, mapVersion) { p.removed = true; // remove incorrect province }); + pack.routes.forEach(({i, points}) => { + if (!points || points.length < 2) { + ERROR && + console.error( + "Data integrity check. Route", + i, + "has less than 2 points. Route will be ignored on layer rendering" + ); + } + }); + { const markerIds = []; let nextId = last(pack.markers)?.i + 1 || 0; diff --git a/modules/ui/layers.js b/modules/ui/layers.js index 39bc39d3..23fc836d 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -1636,7 +1636,8 @@ function drawRoutes() { const routePaths = {}; for (const route of pack.routes) { - const {i, group} = route; + const {i, group, points} = route; + if (!points || points.length < 2) continue; if (!routePaths[group]) routePaths[group] = []; routePaths[group].push(``); } diff --git a/versioning.js b/versioning.js index 368a4924..79db692e 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.99.06"; // generator version, update each time +const version = "1.99.07"; // generator version, update each time { document.title += " v" + version;