Skip to content

Commit

Permalink
Bumped padding and set max zoom level on inset map
Browse files Browse the repository at this point in the history
  • Loading branch information
sdl60660 committed Sep 22, 2021
1 parent 7decb11 commit 218fe18
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/LocatorMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
export let featureGroups;
export let activeFeatureIndex;
const maxZoom = 2.8;
let width = 0;
let container;
Expand All @@ -41,7 +43,11 @@
}
$: if (map && riverPath) {
const coordinateSet = lineString(riverPath[0].geometry.coordinates);
map.fitBounds(bbox(coordinateSet), { animate: false, padding: 10 });
map.fitBounds(bbox(coordinateSet), { animate: false, padding: 30 });
if (map.getZoom() > maxZoom) {
map.setZoom(maxZoom);
}
}
$: if (featureGroups.length > 0) {
Expand Down Expand Up @@ -102,7 +108,7 @@
// bearing: 80,
});
map.fitBounds(bounds, { animate: false, padding: 10 });
map.fitBounds(bounds, { animate: false, padding: 30 });
// map.setMaxBounds(map.getBounds());
map.on("load", () => {
Expand Down

1 comment on commit 218fe18

@vercel
Copy link

@vercel vercel bot commented on 218fe18 Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.