feat: edit routes - start

This commit is contained in:
Azgaar 2024-04-29 23:19:11 +02:00
parent 681d97b2a7
commit d6c01c8995
3 changed files with 39 additions and 40 deletions

View file

@ -791,15 +791,15 @@ function toggleAddRoute() {
function addRouteOnClick() {
unpressClickToAddButton();
const point = d3.mouse(this);
const id = getNextId("route");
elSelected = routes
const [x, y] = d3.mouse(this);
const newRoute = routes
.select("g")
.append("path")
.attr("id", id)
.attr("id", getNextId("route"))
.attr("data-new", 1)
.attr("d", `M${point[0]},${point[1]}`);
editRoute(true);
.attr("d", `M${x},${y}`);
editRoute({node: newRoute.node(), mode: "onclick"});
}
function toggleAddMarker() {