From 1afff10fa0418647f35fdfc1ec95bff92e37ec11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 6 Jan 2021 18:51:34 +0100 Subject: remove demo-code --- server.py | 19 ------------------- templates/index.js | 23 ----------------------- 2 files changed, 42 deletions(-) diff --git a/server.py b/server.py index 8055e63..7790a61 100644 --- a/server.py +++ b/server.py @@ -19,17 +19,6 @@ def index(): return read_html('templates/index.html') -@get('/show-area') -def show_area(): - rect = dict() - # FIXME: Don't hardcode bikes maybe? Maybe just remove this altogether - for (k, node) in enumerate( - store.select_nodes_in_rectangle(nodes['bike'], 58.3984, 58.3990, - 15.5733, 15.576)): - rect[node.id] = node.coord_tuple() - return json.dumps(rect) - - @get('/favicon.ico') def favicon(): with open("data/favicon.ico", "rb") as image: @@ -39,14 +28,6 @@ def favicon(): return image_bytes -@get('/show-unconnected-nodes') -def show_unconnected_nodes(): - print(f"Showing {len(unconnected_nodes)} unconnected nodes") - return json.dumps({ - node.id: node.coord_tuple() for node in unconnected_nodes['bike'] - }) - - @post('/shortest-path') def shortest_path(body): body = json.loads(body) diff --git a/templates/index.js b/templates/index.js index 1422fe6..2fbab55 100644 --- a/templates/index.js +++ b/templates/index.js @@ -47,26 +47,3 @@ function handleMapClick ({latlng}){ } map.on('click', handleMapClick) - - -function showMarker(){ - var marker = L.marker([58.3984, 15.5733]).addTo(map) -} -showMarker() - -async function showMarkers() { - res = await fetch('/show-area'); - res = await res.json(); - for (let key in res) { - var marker = L.marker(res[key]).addTo(map) - } -} -showMarkers() - -async function showUnconnectedMarkers() { - const res = await fetch('/show-unconnected-nodes').then(res => res.json()); - for (let key in res) { - var marker = L.marker(res[key]).addTo(map) - } -} -//showUnconnectedMarkers() -- cgit v1.2.1