Skip to content

Commit d4370c8

Browse files
pjleonard37Release SDK bot for Maps SDK team
andauthored
Style spec changes for LocationIndicatorLayer (#2482)
Co-authored-by: Release SDK bot for Maps SDK team <[email protected]>
1 parent addd036 commit d4370c8

File tree

6 files changed

+73
-74
lines changed

6 files changed

+73
-74
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Mapbox welcomes participation and contributions from everyone.
44

55
## main
66

7+
* `top-image`, `bearing-image`, and `shadow-image` properties on `LocationIndicatorLayer` are now paint properties instead of layout properties.
8+
79
## 11.11.0-rc.1 – 12 March, 2025
810

911
* Expose experimental API for setting ColorTheme on style imports.

Sources/MapboxMaps/Location/Puck/Puck2DRenderer.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ final class Puck2DRenderer: PuckRenderer {
114114
StyleTransition.CodingKeys.duration.rawValue: 0,
115115
StyleTransition.CodingKeys.delay.rawValue: 0]
116116

117-
newLayerLayoutProperties[.topImage] = Self.topImageId
117+
newLayerPaintProperties[.topImage] = Self.topImageId
118118
if newConfiguration.bearingImage != nil {
119-
newLayerLayoutProperties[.bearingImage] = Self.bearingImageId
119+
newLayerPaintProperties[.bearingImage] = Self.bearingImageId
120120
}
121121
if newConfiguration.shadowImage != nil {
122-
newLayerLayoutProperties[.shadowImage] = Self.shadowImageId
122+
newLayerPaintProperties[.shadowImage] = Self.shadowImageId
123123
}
124124

125125
newLayerPaintProperties[.locationTransition] = immediateTransition

Sources/MapboxMaps/Style/Generated/Layers/LocationIndicatorLayer.swift

Lines changed: 48 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/MapboxMapsTests/Location/Puck/Puck2DRendererTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,19 @@ final class Puck2DRendererTests: XCTestCase {
131131
with state: PuckRendererState<Puck2DConfiguration>,
132132
bearing: Double? = nil
133133
) -> [String: Any] {
134+
var expectedPaintLayerProperties = [LocationIndicatorLayer.PaintCodingKeys: Any]()
134135
var expectedLayoutLayerProperties = [LocationIndicatorLayer.LayoutCodingKeys: Any]()
135-
expectedLayoutLayerProperties[.topImage] = "locationIndicatorLayerTopImage"
136+
expectedPaintLayerProperties[.topImage] = "locationIndicatorLayerTopImage"
136137
if state.configuration.bearingImage != nil {
137-
expectedLayoutLayerProperties[.bearingImage] = "locationIndicatorLayerBearingImage"
138+
expectedPaintLayerProperties[.bearingImage] = "locationIndicatorLayerBearingImage"
138139
}
139140
if state.configuration.shadowImage != nil {
140-
expectedLayoutLayerProperties[.shadowImage] = "locationIndicatorLayerShadowImage"
141+
expectedPaintLayerProperties[.shadowImage] = "locationIndicatorLayerShadowImage"
141142
}
142143

143144
let resolvedScale = state.configuration.scale ?? .constant(1)
144145
let scale = try! resolvedScale.toJSON()
145146

146-
var expectedPaintLayerProperties = [LocationIndicatorLayer.PaintCodingKeys: Any]()
147147
expectedPaintLayerProperties[.location] = [state.coordinate.latitude, state.coordinate.longitude, 0]
148148
expectedPaintLayerProperties[.locationTransition] = ["duration": 0, "delay": 0]
149149
expectedPaintLayerProperties[.topImageSize] = scale
@@ -208,7 +208,7 @@ final class Puck2DRendererTests: XCTestCase {
208208
let state = updateState(with: .fullAccuracy, heading: nil, configuration: .init(topImage: nil, bearingImage: nil, shadowImage: nil))
209209

210210
var expectedProperties = makeExpectedLayerProperties(with: state)
211-
expectedProperties.removeValue(forKey: LocationIndicatorLayer.LayoutCodingKeys.bearingImage.rawValue)
211+
expectedProperties.removeValue(forKey: LocationIndicatorLayer.PaintCodingKeys.bearingImage.rawValue)
212212
let actualProperties = try XCTUnwrap(style.addPersistentLayerWithPropertiesStub.invocations.first?.parameters.properties)
213213
XCTAssertEqual(actualProperties as NSDictionary, expectedProperties as NSDictionary)
214214
}

Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/LocationIndicatorLayerIntegrationTests.swift

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)