Improve padding for multiple marker points

This commit is contained in:
Eli Ribble 2026-04-17 03:07:16 +00:00
parent bff81eb6e3
commit b85deb229f
No known key found for this signature in database
2 changed files with 18 additions and 8 deletions

View file

@ -447,7 +447,7 @@ function panToMarkers(markers: Marker[]) {
const bounds = boundsMarkers(markers);
map.value.fitBounds(
bounds,
{ padding: 10, duration: 1000 },
{ padding: 100, duration: 1000 },
{ isInternalUpdate: true },
);
console.log("fitting map to bounds", bounds);

View file

@ -88,13 +88,23 @@ const mapMarkers = computed<Marker[]>(() => {
if (!(site && site.address.location)) {
return [];
}
const markers = {
color: "#FF0000",
draggable: false,
id: "address",
location: site.address.location,
};
return [markers];
let markers = [
{
color: "#FF0000",
draggable: false,
id: "address",
location: site.address.location,
},
];
for (const feature of site.features) {
markers.push({
color: "#00FF00",
draggable: false,
id: feature.id.toString(),
location: feature.location,
});
}
return markers;
});
async function doRequestComplianceMailer(id: number) {
submitting.value = true;