Skip to content

Commit

Permalink
Update geosearch.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-lu committed Nov 8, 2024
1 parent 0449c97 commit e7e694e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/search/geosearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7e694e

Please sign in to comment.