From e7e694e2c233a0737d341989dd024e6be3d661f7 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Fri, 8 Nov 2024 09:29:22 -0500 Subject: [PATCH] Update geosearch.tsx --- src/components/search/geosearch.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/search/geosearch.tsx b/src/components/search/geosearch.tsx index fa78ebb..1e5c17a 100644 --- a/src/components/search/geosearch.tsx +++ b/src/components/search/geosearch.tsx @@ -251,8 +251,8 @@ const GeoSearch = ( // GEO.ca record //map.setView(center, map.getZoom()); //setMapView(center, bounds); - console.log(L.geoJSON(data).getBounds()) - map.fitBounds(L.geoJSON(data).getBounds(), { padding: [50, 50] }); + const padding = window.innerWidth < 768 ? [20, 20] : [300, 50]; + map.fitBounds(L.geoJSON(data).getBounds(), { paddingTopLeft: [padding[0], padding[1]], paddingBottomRight: [50, 50] }); setTimeout(() => { new L.geoJSON(data).addTo(map); }, 200);