Show markers on the signal map and bound them

This commit is contained in:
Eli Ribble 2026-03-20 19:20:11 +00:00
parent 94400aa808
commit 8c6bb7db26
No known key found for this signature in database

View file

@ -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 {