diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-19 16:19:42 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 13:39:05 +0100 |
| commit | 7f6aae6eb8f07b71c32311347ddbce92a3874c7d (patch) | |
| tree | 35dc7367d2d5d1b501950c3efdc7589187395180 /server.py | |
| parent | cdcdf5de8846b0fe1cb91cc0c6ec41f5842c7c98 (diff) | |
| download | tdde25-7f6aae6eb8f07b71c32311347ddbce92a3874c7d.tar.gz | |
show unconnected nodes on map
Diffstat (limited to 'server.py')
| -rw-r--r-- | server.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -11,7 +11,9 @@ nodes = None @get('/') def index(): global nodes - nodes = store.extract_osm_nodes("university.osm") + global unconnected_nodes + nodes, unconnected_nodes = store.extract_osm_nodes("university.osm") + return read_html('templates/index.html') @@ -23,6 +25,12 @@ def show_area(): return json.dumps(rect) +@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}) + + @post('/shortest-path') def shortest_path(body): body = json.loads(body) |
