Skip to content

Commit

Permalink
deploy: 727e656
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 1, 2024
1 parent a745386 commit 5846ec5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion import.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
22 changes: 12 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -180,9 +180,8 @@
completedRoutes.features.push(e.detail);
map.getSource("finished-routes").setData(completedRoutes);
if (e.detail.geometry.type == "LineString") {
document.getElementById(
"status"
).innerText = `Added new route of length ${e.detail.properties.length_meters} meters and name ${e.detail.properties.route_name}`;
document.getElementById("status").innerText =
`Added new route of length ${e.detail.properties.length_meters} meters and name ${e.detail.properties.route_name}`;
} else {
document.getElementById("status").innerText = `Added new area`;
}
Expand Down Expand Up @@ -213,7 +212,7 @@
document.getElementById("download").onclick = () => {
downloadGeneratedFile(
"route-snapper-results.geojson",
JSON.stringify(completedRoutes)
JSON.stringify(completedRoutes),
);
};

Expand All @@ -239,12 +238,12 @@
} else {
return true;
}
}
},
);
map.getSource("finished-routes").setData(completedRoutes);

let roadName = routeSnapper.routeNameForWaypoints(
editFeature.properties.waypoints
editFeature.properties.waypoints,
);
console.log(`Editing route. Re-calculated name is ${roadName}`);

Expand All @@ -266,7 +265,7 @@
routeSnapper = new RouteSnapper(
map,
graphBytes,
document.getElementById("snap-tool")
document.getElementById("snap-tool"),
);
} catch (err) {
console.log(`Route tool broke: ${err}`);
Expand All @@ -278,7 +277,7 @@
var element = document.createElement("a");
element.setAttribute(
"href",
"data:text/plain;charset=utf-8, " + encodeURIComponent(contents)
"data:text/plain;charset=utf-8, " + encodeURIComponent(contents),
);
element.setAttribute("download", filename);
document.body.appendChild(element);
Expand All @@ -299,7 +298,10 @@
try {
let gj = JSON.parse(routeSnapper?.debugRenderGraph());
// Assume nodes (Points) are last.
map.jumpTo({ center: gj.features[gj.features.length - 1].geometry.coordinates });
map.jumpTo({
center:
gj.features[gj.features.length - 1].geometry.coordinates,
});
} catch (err) {
console.log(`Couldn't warp to new graph: ${err}`);
}
Expand Down
Binary file modified osm-to-route-snapper/pkg/osm_to_route_snapper_bg.wasm
Binary file not shown.
Binary file modified route-snapper/pkg/route_snapper_bg.wasm
Binary file not shown.

0 comments on commit 5846ec5

Please sign in to comment.