summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-11-19 16:19:42 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-11-20 13:39:05 +0100
commit7f6aae6eb8f07b71c32311347ddbce92a3874c7d (patch)
tree35dc7367d2d5d1b501950c3efdc7589187395180 /templates
parentcdcdf5de8846b0fe1cb91cc0c6ec41f5842c7c98 (diff)
downloadtdde25-7f6aae6eb8f07b71c32311347ddbce92a3874c7d.tar.gz
show unconnected nodes on map
Diffstat (limited to 'templates')
-rw-r--r--templates/index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/index.js b/templates/index.js
index b7b3b58..3edbd26 100644
--- a/templates/index.js
+++ b/templates/index.js
@@ -49,7 +49,6 @@ map.on('click', handleMapClick)
function showMarker(){
var marker = L.marker([58.3984, 15.5733]).addTo(map)
}
-
showMarker()
async function showMarkers() {
@@ -59,5 +58,13 @@ async function showMarkers() {
var marker = L.marker(res[key]).addTo(map)
}
}
-
showMarkers()
+
+async function showUnconnectedMarkers() {
+ res = await fetch('/show-unconnected-nodes');
+ res = await res.json();
+ for (let key in res) {
+ var marker = L.marker(res[key]).addTo(map)
+ }
+}
+showUnconnectedMarkers()