Move map as bounds change on communication workspace

This commit is contained in:
Eli Ribble 2026-04-28 20:37:38 +00:00
parent 4fcb184286
commit 4ed005fb37
No known key found for this signature in database

View file

@ -245,6 +245,28 @@ onBeforeUnmount(() => {
map.value.remove();
}
});
watch(
() => props.bounds,
(newBounds) => {
if (!map.value) return;
if (map.value.loaded()) {
map.value.fitBounds(
newBounds,
{ padding: 50, duration: 1000 },
{ isInternalUpdate: true },
);
} else {
map.value.once("load", () => {
if (!map.value) return;
map.value.fitBounds(
newBounds,
{ padding: 50, duration: 0 },
{ isInternalUpdate: true },
);
});
}
},
);
watch(
() => props.cursor,
(newCursor) => {