Improve padding for multiple marker points
This commit is contained in:
parent
bff81eb6e3
commit
b85deb229f
2 changed files with 18 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue