From 8c6bb7db264a946b1e2ee640092046513de39543 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 20 Mar 2026 19:20:11 +0000 Subject: [PATCH] Show markers on the signal map and bound them --- html/template/sync/planning-root.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/html/template/sync/planning-root.html b/html/template/sync/planning-root.html index a56bc734..2f7ecf5a 100644 --- a/html/template/sync/planning-root.html +++ b/html/template/sync/planning-root.html @@ -42,17 +42,20 @@ } function updateMap(signals) { const map = document.querySelector("map-multipoint"); - const markers = signals.map((s) => + const locations = signals.map((s) => s.location); + const markers = locations.map((l) => new maplibregl.Marker({ color: "#FF0000", draggable: false, - }).setLatLng([s.location.longitude, s.location.latitude]), + }).setLngLat([l.longitude, l.latitude]), ); map.SetMarkers(markers); - bounds = getBoundingBox(markers); - map.FitBounds(bounds, { - padding: 50, - }); + const bounds = getBoundingBox(locations); + if (bounds != null) { + map.FitBounds(bounds, { + padding: 50, + }); + } } function workbench() { return {