summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-12-15 17:52:58 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-12-15 17:52:58 +0100
commit6c8acb4f4eabb20da41b941158bf52038035699f (patch)
treeef680ba06131b77d82b6dafc3c9750b58b256c14 /templates
parentace809ebf6f38b1d4fc9f4ec59890d738b7ca583 (diff)
parent21a531eac5b953aeab14e4e8ae887695e8a4c4aa (diff)
downloadtdde25-6c8acb4f4eabb20da41b941158bf52038035699f.tar.gz
Merge remote-tracking branch 'origin/union-find'
Diffstat (limited to 'templates')
-rw-r--r--templates/index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/index.js b/templates/index.js
index b7b3b58..01e3880 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,12 @@ async function showMarkers() {
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()