From 42ac04d6d6eb90fd01904d60b62a8b5f65b89045 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Wed, 14 Aug 2024 12:23:37 +1200 Subject: [PATCH 1/3] Fix the map switcher that setting bearing and pitch to 0. --- packages/landing/src/components/map.switcher.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/landing/src/components/map.switcher.tsx b/packages/landing/src/components/map.switcher.tsx index 5f45565d6..7d4266c37 100644 --- a/packages/landing/src/components/map.switcher.tsx +++ b/packages/landing/src/components/map.switcher.tsx @@ -78,8 +78,8 @@ export class MapSwitcher extends Component { this.map.setZoom(Math.max(location.zoom - 4, 0)); this.map.setCenter([location.lon, location.lat]); - if (Config.map.location.bearing != null) this.map.setBearing(Config.map.location.bearing); - if (Config.map.location.pitch != null) this.map.setPitch(Config.map.location.pitch); + Config.map.location.bearing == null ? this.map.setBearing(0) : this.map.setBearing(Config.map.location.bearing); + Config.map.location.pitch == null ? this.map.setPitch(0) : this.map.setPitch(Config.map.location.pitch); this.forceUpdate(); }; From d364237484363a7ce0b8b6d91b921c1c712cf73f Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 15 Aug 2024 09:22:40 +1200 Subject: [PATCH 2/3] Update packages/landing/src/components/map.switcher.tsx Co-authored-by: Blayne Chard --- packages/landing/src/components/map.switcher.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/landing/src/components/map.switcher.tsx b/packages/landing/src/components/map.switcher.tsx index 7d4266c37..79571ca0b 100644 --- a/packages/landing/src/components/map.switcher.tsx +++ b/packages/landing/src/components/map.switcher.tsx @@ -78,7 +78,7 @@ export class MapSwitcher extends Component { this.map.setZoom(Math.max(location.zoom - 4, 0)); this.map.setCenter([location.lon, location.lat]); - Config.map.location.bearing == null ? this.map.setBearing(0) : this.map.setBearing(Config.map.location.bearing); + this.map.setBearing(Config.map.location.bearing ?? 0); Config.map.location.pitch == null ? this.map.setPitch(0) : this.map.setPitch(Config.map.location.pitch); this.forceUpdate(); }; From c601b1045438ce2a94152c73b557052961f2dc0d Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 15 Aug 2024 09:22:45 +1200 Subject: [PATCH 3/3] Update packages/landing/src/components/map.switcher.tsx Co-authored-by: Blayne Chard --- packages/landing/src/components/map.switcher.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/landing/src/components/map.switcher.tsx b/packages/landing/src/components/map.switcher.tsx index 79571ca0b..f25943247 100644 --- a/packages/landing/src/components/map.switcher.tsx +++ b/packages/landing/src/components/map.switcher.tsx @@ -79,7 +79,7 @@ export class MapSwitcher extends Component { this.map.setZoom(Math.max(location.zoom - 4, 0)); this.map.setCenter([location.lon, location.lat]); this.map.setBearing(Config.map.location.bearing ?? 0); - Config.map.location.pitch == null ? this.map.setPitch(0) : this.map.setPitch(Config.map.location.pitch); + this.map.setPitch(Config.map.location.pitch ?? 0); this.forceUpdate(); };