From 47b5e25ce67bb3de79fcc476e113d1a10113f082 Mon Sep 17 00:00:00 2001 From: Smith Date: Fri, 13 Dec 2024 15:30:19 -0800 Subject: [PATCH] psp-9632 limit the default bounds when resetting. --- .../components/common/mapFSM/machineDefinition/mapMachine.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/frontend/src/components/common/mapFSM/machineDefinition/mapMachine.ts b/source/frontend/src/components/common/mapFSM/machineDefinition/mapMachine.ts index 40e41f403c..8d1b6d7fbb 100644 --- a/source/frontend/src/components/common/mapFSM/machineDefinition/mapMachine.ts +++ b/source/frontend/src/components/common/mapFSM/machineDefinition/mapMachine.ts @@ -185,7 +185,10 @@ const mapRequestStates = { any >; const filteredBounds = geoJSON(featureCollection).getBounds(); - const validBounds = filteredBounds.isValid() ? filteredBounds : defaultBounds; + const validBounds = + filteredBounds.isValid() && defaultBounds.contains(filteredBounds) // we should not be automatically setting the bounds outside the default bounds of british columbia. + ? filteredBounds + : defaultBounds; // if the current map bounds contain the bounds of the filtered properties, use the current map bounds. if (