summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRutger Broekhoff2026-08-30 14:53:20 +0200
committerRutger Broekhoff2026-08-30 14:53:20 +0200
commit5abc825cdfaa16580dd05045cdf9847ecd3fcd60 (patch)
treedc44aab0c83908f05ed2fcf7a3c85595d7a99dff
parentd6d21a9c7c5acbe5b37daa9f6307d8498bc1a97b (diff)
downloadroutemon-5abc825cdfaa16580dd05045cdf9847ecd3fcd60.tar.gz
routemon-5abc825cdfaa16580dd05045cdf9847ecd3fcd60.zip
Handle null locations in JS
-rw-r--r--web/index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/index.js b/web/index.js
index 999e333..5e7323b 100644
--- a/web/index.js
+++ b/web/index.js
@@ -143,8 +143,11 @@ async function load(gpxFile) {
143 el("code", {}, txt(sit.id)), 143 el("code", {}, txt(sit.id)),
144 txt(": " + firstComment)); 144 txt(": " + firstComment));
145 145
146 const markerLayer = L.marker(sit.location); 146 // TODO: decide what to do if the situation has no location
147 markerLayer.addTo(layerGroup).bindPopup(commentEl); 147 if (sit.location) {
148 const markerLayer = L.marker(sit.location);
149 markerLayer.addTo(layerGroup).bindPopup(commentEl);
150 }
148 151
149 sit.relevant_road_closures.forEach((rc) => { 152 sit.relevant_road_closures.forEach((rc) => {
150 rc.relevant_lss.forEach((ls) => { 153 rc.relevant_lss.forEach((ls) => {