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 {