fix: routes id after removing all

This commit is contained in:
Azgaar 2024-08-16 13:15:00 +02:00
parent 106d5edc78
commit 9c97711a99
6 changed files with 15 additions and 10 deletions

View file

@ -97,7 +97,7 @@ function createRoute(defaultGroup) {
const points = createRoute.points;
if (points.length < 2) return tip("Add at least 2 points", false, "error");
const routeId = Math.max(...pack.routes.map(route => route.i)) + 1;
const routeId = Routes.getNextId();
const group = byId("routeCreatorGroupSelect").value;
const feature = pack.cells.f[points[0][2]];
const route = {points, group, feature, i: routeId};