Skip to content

Commit feba024

Browse files
committed
Update standard & Standard Satellite config properties
1 parent ddd5550 commit feba024

File tree

6 files changed

+66
-14
lines changed

6 files changed

+66
-14
lines changed

Sources/Examples/SwiftUI Examples/StandardStyleLocationsExample.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ struct StandardStyleLocationsExample: View {
2525
showTransitLabels: model.transitLabels,
2626
showPlaceLabels: model.placeLabels,
2727
showRoadLabels: model.roadLabels,
28-
show3dObjects: model.show3DObjects)
28+
show3dObjects: model.show3DObjects,
29+
colorRoads: StyleColor(UIColor(cgColor: model.roadsColor.cgColor!)))
2930
case .standardSatellite:
3031
.standardSatellite(
3132
lightPreset: model.lightPreset,
@@ -35,7 +36,8 @@ struct StandardStyleLocationsExample: View {
3536
showPlaceLabels: model.placeLabels,
3637
showRoadLabels: model.roadLabels,
3738
showRoadsAndTransit: model.showRoadsAndTransit,
38-
showPedestrianRoads: model.showPedestrianRoads)
39+
showPedestrianRoads: model.showPedestrianRoads,
40+
colorRoads: StyleColor(UIColor(cgColor: model.roadsColor.cgColor!)))
3941
}
4042
}
4143

@@ -83,6 +85,7 @@ class StandardStyleLocationsModel: ObservableObject {
8385
@Published var style: Style = .standard
8486
@Published var theme: StandardTheme = .default
8587
@Published var font: StandardFont = .dinPro
88+
@Published var roadsColor = Color(hue: 224, saturation: 0.25, brightness: 0.8)
8689

8790
enum Style {
8891
case standard
@@ -175,6 +178,8 @@ struct StandardStyleLocationsSettings: View {
175178
}.pickerStyle(.menu)
176179
}
177180

181+
ColorPicker("Roads Color", selection: $model.roadsColor)
182+
178183
ScrollView(.horizontal, showsIndicators: false) {
179184
HStack {
180185
Text("Labels")

Sources/MapboxMaps/Foundation/Extensions/JSONObject+Extensions.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ extension JSONObject {
55
}
66
}
77

8-
mutating func encode<T>(key: String, value: T?) where T: RawRepresentable, T.RawValue == String {
8+
mutating func encode(key: String, value: String?) {
99
if let value {
10-
self[key] = .string(value.rawValue)
10+
self[key] = .string(value)
1111
}
1212
}
13+
14+
mutating func encode<T>(key: String, value: T?) where T: RawRepresentable, T.RawValue == String {
15+
encode(key: key, value: value?.rawValue)
16+
}
1317
}

Sources/MapboxMaps/Style/Generated/MapStyle+Standard.swift

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

Sources/MapboxMaps/Style/Generated/MapStyle+StandardExperimental.swift

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

Sources/MapboxMaps/Style/Generated/MapStyle+StandardSatellite.swift

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

scripts/api-compatibility-check/breakage_allowlist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,3 +2050,7 @@ Var BackgroundPitchAlignment.rawValue is now with @_documentation
20502050
Var BackgroundPitchAlignment.rawValue is now with @_spi
20512051
Var BackgroundPitchAlignment.viewport is now with @_documentation
20522052
Var BackgroundPitchAlignment.viewport is now with @_spi
2053+
2054+
#Update Standard and Standard Satellite config properties
2055+
Func MapStyle.standard(theme:lightPreset:font:showPointOfInterestLabels:showTransitLabels:showPlaceLabels:showRoadLabels:show3dObjects:) has been renamed to Func standard(theme:lightPreset:font:showPointOfInterestLabels:showTransitLabels:showPlaceLabels:showRoadLabels:showPedestrianRoads:show3dObjects:colorMotorways:colorPlaceLabelHighlight:colorPlaceLabelSelect:colorRoads:colorTrunks:themeData:)
2056+
Func MapStyle.standardSatellite(lightPreset:font:showPointOfInterestLabels:showTransitLabels:showPlaceLabels:showRoadLabels:showRoadsAndTransit:showPedestrianRoads:) has been renamed to Func standardSatellite(lightPreset:font:showPointOfInterestLabels:showTransitLabels:showPlaceLabels:showRoadLabels:showRoadsAndTransit:showPedestrianRoads:colorMotorways:colorPlaceLabelHighlight:colorPlaceLabelSelect:colorRoads:colorTrunks:)

0 commit comments

Comments
 (0)