From fe0d3bcc28f723e97cfa4105bed83eb8bb85bbe5 Mon Sep 17 00:00:00 2001 From: Stefan Hansson Date: Mon, 16 Nov 2020 13:55:06 +0100 Subject: wip --- templates/index.html | 13 ++++++++++++- templates/index.js | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/index.html b/templates/index.html index b29f84f..00e6208 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,6 +8,17 @@
+
+ Mode of transport: +
+ + +
+
+ + +
+
Place marker for:
@@ -47,4 +58,4 @@ {{ templates/index.js }} - \ No newline at end of file + diff --git a/templates/index.js b/templates/index.js index 01e3880..42f8398 100644 --- a/templates/index.js +++ b/templates/index.js @@ -19,7 +19,10 @@ async function postShortestPath(event){ if(!lat1 || !lng1 || !lat2 || !lng2) return alert('Formatting Error: Coordinates are not float values.') - req = {lat1, lng1, lat2, lng2} // Dictionary auto-keys + const transport_mode_elem = document.getElementById("transport-mode-bike") + const transport_mode = transport_mode_elem.checked ? "bike" : "car" + + req = {lat1, lng1, lat2, lng2, transport_mode} // Dictionary auto-keys res = await fetch('/shortest-path', { method:'POST', -- cgit v1.2.1