fix(collections): the collection map opens on all of its places

The map framed its first view for the browser window instead of its own box and then skipped the fit, so a list of cafes across Europe opened on northern France. It now fits the places in its own box with room for the label bar and the controls, fits again when the set of places changes, keeps a view the user moved, opens a single place at town level and keeps a list across the date line on its short arc.
This commit is contained in:
Maurice
2026-10-25 03:12:18 +00:00
parent 44cefc2fe2
commit 3681db6cd4
13 changed files with 470 additions and 39 deletions
+2 -2
View File
@@ -944,7 +944,7 @@ describe('MapViewGL', () => {
/>,
)
await act(async () => {})
expect(glMap.fitBounds).toHaveBeenCalledOnce()
expect(glMap.fitBounds.mock.calls).toEqual([[expect.anything(), expect.objectContaining({ duration: 0 })]])
glMap.fitBounds.mockClear()
const mapConstructions = (maplibregl.Map as any).mock.calls.length
const retainedCenter = { lng: 135.8, lat: 35.2 }
@@ -979,7 +979,7 @@ describe('MapViewGL', () => {
/>,
)
await act(async () => {})
expect(glMap.fitBounds).toHaveBeenCalledOnce()
expect(glMap.fitBounds.mock.calls).toEqual([[expect.anything(), expect.objectContaining({ duration: 400 })]])
})
it('keeps selection fit and the pending route-arrival refit for semantic changes', async () => {