feat: extend agent-driven map workbench

This commit is contained in:
2026-07-20 19:57:35 +08:00
parent 86e9b08235
commit 7fbd8a5618
63 changed files with 4506 additions and 457 deletions
+6 -6
View File
@@ -50,7 +50,7 @@ describe("workbench camera padding", () => {
});
describe("fitNetworkBounds", () => {
it("preserves the original global extent for initial and home views", () => {
it("uses the configured global extent for initial and home views", () => {
const { fitBounds, map } = createMap();
fitNetworkBounds(map, WATER_NETWORK_GLOBAL_VIEW);
@@ -58,13 +58,13 @@ describe("fitNetworkBounds", () => {
expect(fitBounds).toHaveBeenCalledTimes(1);
const [bounds, options] = fitBounds.mock.calls[0] ?? [];
expect(bounds[0][0]).toBeCloseTo(121.735034, 6);
expect(bounds[0][1]).toBeCloseTo(30.846365, 6);
expect(bounds[1][0]).toBeCloseTo(121.970518, 6);
expect(bounds[1][1]).toBeCloseTo(30.994738, 6);
expect(bounds[0][0]).toBeCloseTo(120.634831, 6);
expect(bounds[0][1]).toBeCloseTo(27.957404, 6);
expect(bounds[1][0]).toBeCloseTo(120.763461, 6);
expect(bounds[1][1]).toBeCloseTo(28.023994, 6);
expect(options).toMatchObject({
duration: 600,
maxZoom: 12,
maxZoom: 13,
padding: { top: 48, right: 48, bottom: 48, left: 48 }
});
expect(options).not.toHaveProperty("zoom");