Skip to content

Commit

Permalink
make geometries override centerLocation and zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
bjosttveit committed Sep 3, 2024
1 parent 6132561 commit 343bd85
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/layout/Map/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ export function getMapStartingView(
zoom: 16,
bounds: undefined,
};
} else if (centerLocationValid || customZoom) {
return {
center: centerLocationValid ? locationToTuple(customCenterLocation) : locationToTuple(DefaultCenterLocation),
zoom: customZoom ?? DefaultZoom,
bounds: undefined,
};
} else if (geometryBounds) {
return {
center: undefined,
Expand All @@ -97,8 +91,8 @@ export function getMapStartingView(
};
} else {
return {
center: locationToTuple(DefaultCenterLocation),
zoom: DefaultZoom,
center: centerLocationValid ? locationToTuple(customCenterLocation) : locationToTuple(DefaultCenterLocation),
zoom: customZoom ?? DefaultZoom,
bounds: undefined,
};
}
Expand Down

0 comments on commit 343bd85

Please sign in to comment.