diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-12-16 11:12:24 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-12-16 11:12:24 +0100 |
| commit | ff702dfc656b289223e3700e66872c371e365a25 (patch) | |
| tree | 25f7b787775c6edf6e604c8010d4be5299fda0b2 /templates/index.js | |
| parent | 90cba31d48974f1b7f694e570f8732098359a5ea (diff) | |
| parent | 066929eab31d55573aa7038df1f0be8a6555cfe5 (diff) | |
| download | tdde25-ff702dfc656b289223e3700e66872c371e365a25.tar.gz | |
Merge remote-tracking branch 'origin/implement-mode-of-transport'
Diffstat (limited to 'templates/index.js')
| -rw-r--r-- | templates/index.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/templates/index.js b/templates/index.js index 01e3880..1422fe6 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', @@ -66,4 +69,4 @@ async function showUnconnectedMarkers() { var marker = L.marker(res[key]).addTo(map) } } -showUnconnectedMarkers() +//showUnconnectedMarkers() |
