From 30d5b0c4ea340bd9bc68b4b4d956b17640e12877 Mon Sep 17 00:00:00 2001 From: wkyoshida Date: Sun, 8 Sep 2024 22:59:34 -0300 Subject: [PATCH 1/4] refac(map): Update `maxZoom` at map-level rather than per-layer --- frontend/components/media/MediaMap.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/components/media/MediaMap.vue b/frontend/components/media/MediaMap.vue index e82c14abf..3c3b7d2aa 100644 --- a/frontend/components/media/MediaMap.vue +++ b/frontend/components/media/MediaMap.vue @@ -205,14 +205,12 @@ onMounted(() => { type: "raster", source: "raster-tiles", minzoom: 0, - maxzoom: 24, }, { id: "cycle-layer", type: "raster", source: "cycle-raster-tiles", minzoom: 0, - maxzoom: 20, layout: { visibility: "none", }, @@ -222,6 +220,7 @@ onMounted(() => { center: [parseFloat(location["lon"]), parseFloat(location["lat"])], zoom: 15, pitch: 20, + maxZoom: 19, }); // MARK: Basic Controls From d0c7366e5c0b0d1db9d10490eb6439ec6937c654 Mon Sep 17 00:00:00 2001 From: wkyoshida Date: Sun, 8 Sep 2024 23:07:10 -0300 Subject: [PATCH 2/4] refac(map): Update map fit on location bbox rather than generic zoom level --- frontend/components/media/MediaMap.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/components/media/MediaMap.vue b/frontend/components/media/MediaMap.vue index 3c3b7d2aa..dd9cefcfe 100644 --- a/frontend/components/media/MediaMap.vue +++ b/frontend/components/media/MediaMap.vue @@ -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( From b13ed47a1f4ff8803be88787c08e66b6c674336d Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Wed, 27 Nov 2024 02:19:29 +0100 Subject: [PATCH 3/4] Remove animation for now and reset maxZoom --- frontend/components/media/MediaMap.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/components/media/MediaMap.vue b/frontend/components/media/MediaMap.vue index dd9cefcfe..01c5192e2 100644 --- a/frontend/components/media/MediaMap.vue +++ b/frontend/components/media/MediaMap.vue @@ -218,7 +218,7 @@ onMounted(() => { ], }, pitch: 20, - maxZoom: 19, + maxZoom: 20, }); map.fitBounds( @@ -233,8 +233,7 @@ onMounted(() => { ], ], { - duration: 6000, - padding: 100, + padding: 120, } ); From b0e5dd37d4a9f1c676c965968c33481e4dc7ed66 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Wed, 27 Nov 2024 02:22:54 +0100 Subject: [PATCH 4/4] Set duration to 0 to remove animation --- frontend/components/media/MediaMap.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/components/media/MediaMap.vue b/frontend/components/media/MediaMap.vue index 01c5192e2..71b22cfb7 100644 --- a/frontend/components/media/MediaMap.vue +++ b/frontend/components/media/MediaMap.vue @@ -233,6 +233,7 @@ onMounted(() => { ], ], { + duration: 0, padding: 120, } );