Skip to content

Commit

Permalink
refac(map): Update map fit on location bbox rather than generic zoom …
Browse files Browse the repository at this point in the history
…level
  • Loading branch information
wkyoshida committed Sep 9, 2024
1 parent 30d5b0c commit d0c7366
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions frontend/components/media/MediaMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,27 @@ onMounted(() => {
},
],
},
center: [parseFloat(location["lon"]), parseFloat(location["lat"])],
zoom: 15,
pitch: 20,
maxZoom: 19,
});
map.fitBounds(
[
[
parseFloat(location["boundingbox"][2]),
parseFloat(location["boundingbox"][0]),
],
[
parseFloat(location["boundingbox"][3]),
parseFloat(location["boundingbox"][1]),
],
],
{
duration: 6000,
padding: 100,
}
);
// MARK: Basic Controls
map.addControl(
Expand Down

0 comments on commit d0c7366

Please sign in to comment.