diff options
| author | Stefan Hansson <steha708@edu.liu.se> | 2020-11-16 13:55:06 +0100 |
|---|---|---|
| committer | Newbyte <steha708@liu.se> | 2020-12-15 18:23:53 +0100 |
| commit | fe0d3bcc28f723e97cfa4105bed83eb8bb85bbe5 (patch) | |
| tree | f9992628c6e82ee0175c072e4da23e22dcd1e000 /templates/index.js | |
| parent | 6c8acb4f4eabb20da41b941158bf52038035699f (diff) | |
| download | tdde25-fe0d3bcc28f723e97cfa4105bed83eb8bb85bbe5.tar.gz | |
wip
Diffstat (limited to 'templates/index.js')
| -rw-r--r-- | templates/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
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', |
