Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mapsios 271 puck 3d default scale #1523

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Sources/MapboxMaps/Location/Puck/Puck3D.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -159,7 +159,7 @@ internal final class Puck3D: Puck {
}
)

default: return configuration.modelScale
case .expression: return configuration.modelScale
}
}
}
2 changes: 1 addition & 1 deletion Tests/MapboxMapsTests/Location/Puck/Puck3DTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down