fix: routes - don't render route with <2 points

This commit is contained in:
Azgaar 2024-08-23 18:26:12 +02:00
parent 1f280133be
commit b54f758350
4 changed files with 16 additions and 4 deletions

View file

@ -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;