diff --git a/CHANGELOG.md b/CHANGELOG.md index 968a274aee36..f73aa8c78716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Mapbox welcomes participation and contributions from everyone. * Add the ability to display heading calibration alert. ([#1509](https://github.com/mapbox/mapbox-maps-ios/pull/1509)) * Add support for sonar-like pulsing animation around 2D puck. ([#1513](https://github.com/mapbox/mapbox-maps-ios/pull/1513)) * Support view annotation lookup by an identifier. ([#1512](https://github.com/mapbox/mapbox-maps-ios/pull/1512)) +* Apply mercator scale to 3D puck also when its `modelScale` is not specified. ([#1523](https://github.com/mapbox/mapbox-maps-ios/pull/1523)) ## 10.7.0 - July 28, 2022 diff --git a/Sources/MapboxMaps/Location/Puck/Puck3D.swift b/Sources/MapboxMaps/Location/Puck/Puck3D.swift index 95ce2ccc1471..f9bca2b75cb8 100644 --- a/Sources/MapboxMaps/Location/Puck/Puck3D.swift +++ b/Sources/MapboxMaps/Location/Puck/Puck3D.swift @@ -132,7 +132,7 @@ internal final class Puck3D: Puck { } private var modelScale: Value<[Double]>? { - switch configuration.modelScale { + switch configuration.modelScale ?? .constant([1, 1, 1]) { case .constant(let scales): let maxZoom = 22.0 let minZoom = 0.5 @@ -159,7 +159,7 @@ internal final class Puck3D: Puck { } ) - default: return configuration.modelScale + case .expression: return configuration.modelScale } } } diff --git a/Tests/MapboxMapsTests/Location/Puck/Puck3DTests.swift b/Tests/MapboxMapsTests/Location/Puck/Puck3DTests.swift index 57dc583a1235..da6a440dd286 100644 --- a/Tests/MapboxMapsTests/Location/Puck/Puck3DTests.swift +++ b/Tests/MapboxMapsTests/Location/Puck/Puck3DTests.swift @@ -211,7 +211,7 @@ final class Puck3DTests: XCTestCase { func testDefaultModelScale() throws { let stubbedModelScale = 1.0 - configuration.modelScale = .constant([stubbedModelScale, stubbedModelScale, stubbedModelScale]) + configuration.modelScale = .random(.constant([stubbedModelScale, stubbedModelScale, stubbedModelScale])) recreatePuck()