diff --git a/Apps/Examples/Examples/All Examples/ModelLayerExample.swift b/Apps/Examples/Examples/All Examples/ModelLayerExample.swift index 72481d74cc0..e3e74200a94 100644 --- a/Apps/Examples/Examples/All Examples/ModelLayerExample.swift +++ b/Apps/Examples/Examples/All Examples/ModelLayerExample.swift @@ -39,9 +39,9 @@ final class ModelLayerExample: UIViewController, ExampleProtocol { ModelLayer(id: "model-layer-id", source: Constants.sourceId) .modelId(Exp(.get) { Constants.modelIdKey }) .modelType(.common3d) - .modelScale([40, 40, 40]) - .modelTranslation([0, 0, 0]) - .modelRotation([0, 0, 90]) + .modelScale(x: 40, y: 40, z: 40) + .modelTranslation(x: 0, y: 0, z: 0) + .modelRotation(x: 0, y: 0, z: 90) .modelOpacity(0.7) } } diff --git a/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift index 1b022b936be..19e09c02d10 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift @@ -42,7 +42,7 @@ struct AnnotationsExample: View { CircleAnnotation(centerCoordinate: airport.coordinate, isDraggable: true) .circleColor(StyleColor(flight.color)) .circleRadius(10) - .circleStrokeColor(.init(.black)) + .circleStrokeColor(.black) .circleStrokeWidth(1) .onTapGesture { alert = "Airport: \(airport.name)" @@ -92,7 +92,7 @@ struct AnnotationsExample: View { PointAnnotation(coordinate: tap.coordinate) .image(named: "intermediate-pin") .iconAnchor(.bottom) - .iconOffset([0, 12]) + .iconOffset(x: 0, y: 12) .onTapGesture { taps.removeAll(where: { $0.id == tap.id }) } diff --git a/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift b/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift index 94103df9fe4..0fb32dee8c1 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift @@ -276,9 +276,9 @@ struct ModelsComponent: MapStyleContent { ModelLayer(id: "models", source: "models-geojson") .modelId(Exp(.get) { "model" }) .modelType(.common3d) - .modelScale([40, 40, 40]) - .modelTranslation([0, 0, 0]) - .modelRotation([0, 0, 90]) + .modelScale(x: 40, y: 40, z: 40) + .modelTranslation(x: 0, y: 0, z: 0) + .modelRotation(x: 0, y: 0, z: 90) .modelOpacity(0.7) } diff --git a/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift b/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift index c80b1735c9f..fa4459a3848 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift @@ -12,7 +12,7 @@ struct FeaturesQueryExample: View { // Annotations that shows tap location. if let queryResult = model.queryResult { CircleAnnotation(centerCoordinate: queryResult.coordinate) - .circleColor(.init(.red)) + .circleColor(.red) .circleRadius(8) } } diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift index 8bdb472f439..525d925825d 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift @@ -41,8 +41,9 @@ struct PuckPlayground: View { TestLayer(id: "layer", radius: 3, color: .black, coordinate: .apple, slot: .top) if case .d3 = puckType { + let scale = puck3dSettings.modelType.initialScale * puck3dSettings.scale Puck3D(model: puck3dSettings.modelType.model, bearing: bearingType) - .modelScale(puck3dSettings.modelScale) + .modelScale(x: scale, y: scale, z: scale) .modelOpacity(opacity) .modelEmissiveStrength(puck3dSettings.emission) .slot(slot) @@ -177,7 +178,6 @@ private struct Puck3DSettings { } } var scale = 1.0 - var modelScale: [Double] { .init(repeating: scale * modelType.initialScale, count: 3) } var modelType = ModelType.sportcar var emission = 1.0 } diff --git a/CHANGELOG.md b/CHANGELOG.md index c39aab5713a..bc70cf664b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,55 @@ Mapbox welcomes participation and contributions from everyone. ## main ### Experimental API breaking changes ⚠️ -* `TransitionOptions` is now a Swift struct rather than an Objective-C class. -* Experimental `MapStyle` no longer conforms to Equatable. -* Experimental protocol `MapContent` now has associated generic type and body requirement. -* Experimental `MapContentBuilder` methods signatures have changed to work with generic `MapContent`. -* `StyleImportConfiguration` was removed from public API -* `MapStyle` now accepts single `configuration` as `JSONObject` -* `StyleImportConfiguration.standard` is no more exposed, use `MapStyle.standard()` to provide configuration for Standard style +In this release, we introduce the new [Declarative Styling API](https://docs.tilestream.net/ios/maps/api/latest/documentation/mapboxmaps/declarative-map-styling) for UIKit and SwiftUI. This change is based on `MapContent` introduced for SwiftUI; therefore, it has been restructured. The changes are compatible; however, in some rare cases, you may need to adjust your code. + +* [SwiftUI] `MapContent` now supports custom implementations, similar to SwiftUI views. The `MapContent` protocol now requires the `var body: some MapContent` implementation. +* [SwiftUI] PointAnnotation and Puck3D property-setters that consumed fixed-length arrays reworked to use named properties or platform types for better readability: +```swift +// Before +PointAnnotation() + .iconOffset([10, 20]) // x, y + .iconTextFitPadding([1, 2, 3, 4]) // top, right, bottom, left +Puck3D() + .modelScale([1, 2, 3]) // x, y, z + +// After +PointAnnotation() + .iconOffset(x: 10, y: 20) + .iconTextFitPadding(UIEdgeInsets(top: 1, left: 4, bottom: 3, right: 2)) +Puck3D() + .modelScale(x: 1, y: 2, z: 3) +``` +* `StyleImportConfiguration` was removed from public API, the `MapStyle` now contains the configuration directly. +* `TransitionOptions` is now a Swift `struct` rather than an Objective-C `class`. + +### Features ✨ and improvements 🏁 + +* All the style primitives can now be used as `MapContent` in SwiftUI. +```swift +@_spi(Experimental) MapboxMaps +Map { + LineLayer(id: "traffic") + .lineColor(.red) + .lineWidth(2) +} +``` + +* UIKit applications can now use the `setMapStyleContent` to use style primitives: +```swift +@_spi(Experimental) MapboxMaps +mapView.mapboxMap.setMapStyleContent { + LineLayer(id: "traffic") + .lineColor(.red) + .lineWidth(2) +} +``` * Allow to assign slot to 2D and 3D location indicators. * Allow observing start/stop event of `CameraAnimator` You can observe start/stop event of `CameraAnimator` by using new `CameraAnimationsManager` APIs as shown below - ``` + ```swift // Observe start event of any CameraAnimator owned by AnimationOwner.cameraAnimationsManager mapView.camera .onCameraAnimatorStarted(with: [.cameraAnimationsManager]) { cameraAnimator in @@ -32,7 +68,7 @@ Mapbox welcomes participation and contributions from everyone. .store(in: &cancelables) ``` You can also observe directly on an instance of `CameraAnimator` when using low-level camera APIs to create a custom animator - ``` + ```swift // Declare an animator that changes the map's bearing let bearingAnimator = mapView.camera.makeAnimator(duration: 4, curve: .easeInOut) { (transition) in transition.bearing.toValue = -45 @@ -49,6 +85,7 @@ Mapbox welcomes participation and contributions from everyone. * Make Puck2D and Puck3D to be positioned according to relative layer positon in declarative API instead of always top-most position. * Add codesign for XCFrameworks. + ## 11.3.0 - 10 April, 2024 ### Features ✨ and improvements 🏁 diff --git a/Sources/MapboxMaps/Annotations/Generated/CircleAnnotation.swift b/Sources/MapboxMaps/Annotations/Generated/CircleAnnotation.swift index 985a5fa986f..f26f8817526 100644 --- a/Sources/MapboxMaps/Annotations/Generated/CircleAnnotation.swift +++ b/Sources/MapboxMaps/Annotations/Generated/CircleAnnotation.swift @@ -158,7 +158,7 @@ public struct CircleAnnotation: Annotation, Equatable { } - @_documentation(visibility: public) +@_documentation(visibility: public) @_spi(Experimental) extension CircleAnnotation { /// Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. @@ -173,6 +173,12 @@ public struct CircleAnnotation: Annotation, Equatable { with(self, setter(\.circleBlur, newValue)) } + /// The fill color of the circle. + @_documentation(visibility: public) + public func circleColor(_ color: UIColor) -> Self { + circleColor(StyleColor(color)) + } + /// The fill color of the circle. @_documentation(visibility: public) public func circleColor(_ newValue: StyleColor) -> Self { @@ -191,6 +197,12 @@ public struct CircleAnnotation: Annotation, Equatable { with(self, setter(\.circleRadius, newValue)) } + /// The stroke color of the circle. + @_documentation(visibility: public) + public func circleStrokeColor(_ color: UIColor) -> Self { + circleStrokeColor(StyleColor(color)) + } + /// The stroke color of the circle. @_documentation(visibility: public) public func circleStrokeColor(_ newValue: StyleColor) -> Self { diff --git a/Sources/MapboxMaps/Annotations/Generated/PointAnnotation.swift b/Sources/MapboxMaps/Annotations/Generated/PointAnnotation.swift index 23b1a383f82..0059563245b 100644 --- a/Sources/MapboxMaps/Annotations/Generated/PointAnnotation.swift +++ b/Sources/MapboxMaps/Annotations/Generated/PointAnnotation.swift @@ -261,7 +261,7 @@ public struct PointAnnotation: Annotation, Equatable { } } - @_documentation(visibility: public) +@_documentation(visibility: public) @_spi(Experimental) extension PointAnnotation { /// Part of the icon placed closest to the anchor. @@ -278,8 +278,8 @@ public struct PointAnnotation: Annotation, Equatable { /// Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up. @_documentation(visibility: public) - public func iconOffset(_ newValue: [Double]) -> Self { - with(self, setter(\.iconOffset, newValue)) + public func iconOffset(x: Double, y: Double) -> Self { + with(self, setter(\.iconOffset, [x, y])) } /// Rotates the icon clockwise. @@ -302,8 +302,8 @@ public struct PointAnnotation: Annotation, Equatable { /// Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left. @_documentation(visibility: public) - public func iconTextFitPadding(_ newValue: [Double]) -> Self { - with(self, setter(\.iconTextFitPadding, newValue)) + public func iconTextFitPadding(_ padding: UIEdgeInsets) -> Self { + with(self, setter(\.iconTextFitPadding, [padding.top, padding.right, padding.bottom, padding.left])) } /// Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key. @@ -350,8 +350,8 @@ public struct PointAnnotation: Annotation, Equatable { /// Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. @_documentation(visibility: public) - public func textOffset(_ newValue: [Double]) -> Self { - with(self, setter(\.textOffset, newValue)) + public func textOffset(x: Double, y: Double) -> Self { + with(self, setter(\.textOffset, [x, y])) } /// Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present. @@ -378,6 +378,12 @@ public struct PointAnnotation: Annotation, Equatable { with(self, setter(\.textTransform, newValue)) } + /// The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/). + @_documentation(visibility: public) + public func iconColor(_ color: UIColor) -> Self { + iconColor(StyleColor(color)) + } + /// The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/). @_documentation(visibility: public) public func iconColor(_ newValue: StyleColor) -> Self { @@ -396,6 +402,12 @@ public struct PointAnnotation: Annotation, Equatable { with(self, setter(\.iconHaloBlur, newValue)) } + /// The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/). + @_documentation(visibility: public) + public func iconHaloColor(_ color: UIColor) -> Self { + iconHaloColor(StyleColor(color)) + } + /// The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/). @_documentation(visibility: public) public func iconHaloColor(_ newValue: StyleColor) -> Self { @@ -420,6 +432,12 @@ public struct PointAnnotation: Annotation, Equatable { with(self, setter(\.iconOpacity, newValue)) } + /// The color with which the text will be drawn. + @_documentation(visibility: public) + public func textColor(_ color: UIColor) -> Self { + textColor(StyleColor(color)) + } + /// The color with which the text will be drawn. @_documentation(visibility: public) public func textColor(_ newValue: StyleColor) -> Self { @@ -438,6 +456,12 @@ public struct PointAnnotation: Annotation, Equatable { with(self, setter(\.textHaloBlur, newValue)) } + /// The color of the text's halo, which helps it stand out from backgrounds. + @_documentation(visibility: public) + public func textHaloColor(_ color: UIColor) -> Self { + textHaloColor(StyleColor(color)) + } + /// The color of the text's halo, which helps it stand out from backgrounds. @_documentation(visibility: public) public func textHaloColor(_ newValue: StyleColor) -> Self { diff --git a/Sources/MapboxMaps/Annotations/Generated/PolygonAnnotation.swift b/Sources/MapboxMaps/Annotations/Generated/PolygonAnnotation.swift index a87471b87b0..1fa422ad8ba 100644 --- a/Sources/MapboxMaps/Annotations/Generated/PolygonAnnotation.swift +++ b/Sources/MapboxMaps/Annotations/Generated/PolygonAnnotation.swift @@ -137,7 +137,7 @@ public struct PolygonAnnotation: Annotation, Equatable { } - @_documentation(visibility: public) +@_documentation(visibility: public) @_spi(Experimental) extension PolygonAnnotation { /// Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. @@ -146,6 +146,12 @@ public struct PolygonAnnotation: Annotation, Equatable { with(self, setter(\.fillSortKey, newValue)) } + /// The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. + @_documentation(visibility: public) + public func fillColor(_ color: UIColor) -> Self { + fillColor(StyleColor(color)) + } + /// The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. @_documentation(visibility: public) public func fillColor(_ newValue: StyleColor) -> Self { @@ -158,6 +164,12 @@ public struct PolygonAnnotation: Annotation, Equatable { with(self, setter(\.fillOpacity, newValue)) } + /// The outline color of the fill. Matches the value of `fill-color` if unspecified. + @_documentation(visibility: public) + public func fillOutlineColor(_ color: UIColor) -> Self { + fillOutlineColor(StyleColor(color)) + } + /// The outline color of the fill. Matches the value of `fill-color` if unspecified. @_documentation(visibility: public) public func fillOutlineColor(_ newValue: StyleColor) -> Self { diff --git a/Sources/MapboxMaps/Annotations/Generated/PolylineAnnotation.swift b/Sources/MapboxMaps/Annotations/Generated/PolylineAnnotation.swift index 655d477c1cc..50985b5b6ec 100644 --- a/Sources/MapboxMaps/Annotations/Generated/PolylineAnnotation.swift +++ b/Sources/MapboxMaps/Annotations/Generated/PolylineAnnotation.swift @@ -167,7 +167,7 @@ public struct PolylineAnnotation: Annotation, Equatable { } - @_documentation(visibility: public) +@_documentation(visibility: public) @_spi(Experimental) extension PolylineAnnotation { /// The display of lines when joining. @@ -188,6 +188,12 @@ public struct PolylineAnnotation: Annotation, Equatable { with(self, setter(\.lineBlur, newValue)) } + /// The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color. + @_documentation(visibility: public) + public func lineBorderColor(_ color: UIColor) -> Self { + lineBorderColor(StyleColor(color)) + } + /// The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color. @_documentation(visibility: public) public func lineBorderColor(_ newValue: StyleColor) -> Self { @@ -200,6 +206,12 @@ public struct PolylineAnnotation: Annotation, Equatable { with(self, setter(\.lineBorderWidth, newValue)) } + /// The color with which the line will be drawn. + @_documentation(visibility: public) + public func lineColor(_ color: UIColor) -> Self { + lineColor(StyleColor(color)) + } + /// The color with which the line will be drawn. @_documentation(visibility: public) public func lineColor(_ newValue: StyleColor) -> Self { diff --git a/Sources/MapboxMaps/ContentBuilders/MapContent/Puck3D.swift b/Sources/MapboxMaps/ContentBuilders/MapContent/Puck3D.swift index 9130dadd5f3..b6ad89a7237 100644 --- a/Sources/MapboxMaps/ContentBuilders/MapContent/Puck3D.swift +++ b/Sources/MapboxMaps/ContentBuilders/MapContent/Puck3D.swift @@ -27,14 +27,14 @@ public struct Puck3D: MapContent, PrimitiveMapContent { /// The scale of the model. @_documentation(visibility: public) - public func modelScale(_ modelScale: [Double]) -> Puck3D { - copyAssigned(self, \.configuration.modelScale, .constant(modelScale)) + public func modelScale(x: Double, y: Double, z: Double) -> Puck3D { + copyAssigned(self, \.configuration.modelScale, .constant([x, y, z])) } /// The rotation of the model in euler angles [lon, lat, z]. @_documentation(visibility: public) - public func modelRotation(_ modelRotation: [Double]) -> Puck3D { - copyAssigned(self, \.configuration.modelRotation, .constant(modelRotation)) + public func modelRotation(x: Double, y: Double, z: Double) -> Puck3D { + copyAssigned(self, \.configuration.modelRotation, .constant([x, y, z])) } /// The opacity of the model used as the location puck diff --git a/Sources/MapboxMaps/Style/Generated/Atmosphere.swift b/Sources/MapboxMaps/Style/Generated/Atmosphere.swift index 1104d5123d5..c7f7863e5e0 100644 --- a/Sources/MapboxMaps/Style/Generated/Atmosphere.swift +++ b/Sources/MapboxMaps/Style/Generated/Atmosphere.swift @@ -148,12 +148,6 @@ extension Atmosphere { } - /// The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away. - @_documentation(visibility: public) - public func range(_ constant: [Double]) -> Self { - with(self, setter(\.range, .constant(constant))) - } - /// The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away. @_documentation(visibility: public) public func range(start: Double, end: Double) -> Self { @@ -217,12 +211,6 @@ extension Atmosphere { } - /// An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints. - @_documentation(visibility: public) - public func verticalRange(_ constant: [Double]) -> Self { - with(self, setter(\.verticalRange, .constant(constant))) - } - /// An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints. @_documentation(visibility: public) public func verticalRange(start: Double, end: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/CircleLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/CircleLayer.swift index 011fd4ca5a5..7153930216d 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/CircleLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/CircleLayer.swift @@ -484,12 +484,6 @@ public struct CircleLayer: Layer, Equatable { } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - @_documentation(visibility: public) - public func circleTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.circleTranslate, .constant(constant))) - } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. @_documentation(visibility: public) public func circleTranslate(x: Double, y: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/FillExtrusionLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/FillExtrusionLayer.swift index 733e6c33788..2a84b5168bd 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/FillExtrusionLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/FillExtrusionLayer.swift @@ -787,12 +787,6 @@ public struct FillExtrusionLayer: Layer, Equatable { } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. - @_documentation(visibility: public) - public func fillExtrusionTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.fillExtrusionTranslate, .constant(constant))) - } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. @_documentation(visibility: public) public func fillExtrusionTranslate(x: Double, y: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/FillLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/FillLayer.swift index a88244c0e77..21421d111c2 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/FillLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/FillLayer.swift @@ -360,12 +360,6 @@ public struct FillLayer: Layer, Equatable { } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - @_documentation(visibility: public) - public func fillTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.fillTranslate, .constant(constant))) - } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. @_documentation(visibility: public) public func fillTranslate(x: Double, y: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift index 84abe48ef16..9d7122b18bf 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift @@ -634,12 +634,6 @@ public struct LineLayer: Layer, Equatable { } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - @_documentation(visibility: public) - public func lineTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.lineTranslate, .constant(constant))) - } - /// The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. @_documentation(visibility: public) public func lineTranslate(x: Double, y: Double) -> Self { @@ -672,12 +666,6 @@ public struct LineLayer: Layer, Equatable { } - /// The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0]. - @_documentation(visibility: public) - public func lineTrimOffset(_ constant: [Double]) -> Self { - with(self, setter(\.lineTrimOffset, .constant(constant))) - } - /// The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0]. @_documentation(visibility: public) public func lineTrimOffset(start: Double, end: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/LocationIndicatorLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/LocationIndicatorLayer.swift index 32b0a6466b0..5416fa243aa 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/LocationIndicatorLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/LocationIndicatorLayer.swift @@ -470,13 +470,7 @@ public struct LocationIndicatorLayer: Layer, Equatable { /// An array of [latitude, longitude, altitude] position of the location indicator. @_documentation(visibility: public) - public func location(_ constant: [Double]) -> Self { - with(self, setter(\.location, .constant(constant))) - } - - /// An array of [latitude, longitude, altitude] position of the location indicator. - @_documentation(visibility: public) - public func location(coordinate: CLLocationCoordinate2D) -> Self { + public func location(_ coordinate: CLLocationCoordinate2D) -> Self { with(self, setter(\.location, .constant([coordinate.latitude, coordinate.longitude]))) } diff --git a/Sources/MapboxMaps/Style/Generated/Layers/ModelLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/ModelLayer.swift index 80a5e508268..33abd2468d9 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/ModelLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/ModelLayer.swift @@ -480,13 +480,6 @@ import UIKit } - /// Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)). - @_documentation(visibility: public) - @_spi(Experimental) - public func modelHeightBasedEmissiveStrengthMultiplier(_ constant: [Double]) -> Self { - with(self, setter(\.modelHeightBasedEmissiveStrengthMultiplier, .constant(constant))) - } - /// Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)). @_documentation(visibility: public) @_spi(Experimental) @@ -546,13 +539,6 @@ import UIKit } - /// The rotation of the model in euler angles [lon, lat, z]. - @_documentation(visibility: public) - @_spi(Experimental) - public func modelRotation(_ constant: [Double]) -> Self { - with(self, setter(\.modelRotation, .constant(constant))) - } - /// The rotation of the model in euler angles [lon, lat, z]. @_documentation(visibility: public) @_spi(Experimental) @@ -597,13 +583,6 @@ import UIKit } - /// The scale of the model. - @_documentation(visibility: public) - @_spi(Experimental) - public func modelScale(_ constant: [Double]) -> Self { - with(self, setter(\.modelScale, .constant(constant))) - } - /// The scale of the model. @_documentation(visibility: public) @_spi(Experimental) @@ -641,13 +620,6 @@ import UIKit } - /// The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets. - @_documentation(visibility: public) - @_spi(Experimental) - public func modelTranslation(_ constant: [Double]) -> Self { - with(self, setter(\.modelTranslation, .constant(constant))) - } - /// The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets. @_documentation(visibility: public) @_spi(Experimental) diff --git a/Sources/MapboxMaps/Style/Generated/Layers/RasterLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/RasterLayer.swift index 72a646ec117..cee95365bd2 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/RasterLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/RasterLayer.swift @@ -368,12 +368,6 @@ public struct RasterLayer: Layer, Equatable { } - /// When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity. - @_documentation(visibility: public) - public func rasterColorMix(_ constant: [Double]) -> Self { - with(self, setter(\.rasterColorMix, .constant(constant))) - } - /// When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity. @_documentation(visibility: public) public func rasterColorMix(red: Double, green: Double, blue: Double, offset: Double) -> Self { @@ -393,12 +387,6 @@ public struct RasterLayer: Layer, Equatable { } - /// When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. - @_documentation(visibility: public) - public func rasterColorRange(_ constant: [Double]) -> Self { - with(self, setter(\.rasterColorRange, .constant(constant))) - } - /// When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. @_documentation(visibility: public) public func rasterColorRange(min: Double, max: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/SkyLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/SkyLayer.swift index 58973801c82..acf7ed6b0d0 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/SkyLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/SkyLayer.swift @@ -202,12 +202,6 @@ public struct SkyLayer: Layer, Equatable { } - /// Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0 degree north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0 degree is directly above, at zenith, and 90 degree at the horizon. When this property is ommitted, the sun center is directly inherited from the light position. - @_documentation(visibility: public) - public func skyAtmosphereSun(_ constant: [Double]) -> Self { - with(self, setter(\.skyAtmosphereSun, .constant(constant))) - } - /// Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0 degree north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0 degree is directly above, at zenith, and 90 degree at the horizon. When this property is ommitted, the sun center is directly inherited from the light position. @_documentation(visibility: public) public func skyAtmosphereSun(azimuthal: Double, polar: Double) -> Self { @@ -253,12 +247,6 @@ public struct SkyLayer: Layer, Equatable { } - /// Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0 degree north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0 degree is directly above, at zenith, and 90 degree at the horizon. - @_documentation(visibility: public) - public func skyGradientCenter(_ constant: [Double]) -> Self { - with(self, setter(\.skyGradientCenter, .constant(constant))) - } - /// Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0 degree north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0 degree is directly above, at zenith, and 90 degree at the horizon. @_documentation(visibility: public) public func skyGradientCenter(azimuthal: Double, polar: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Layers/SymbolLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/SymbolLayer.swift index 72dd79c8ec8..8b3d682cf0e 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/SymbolLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/SymbolLayer.swift @@ -670,12 +670,6 @@ public struct SymbolLayer: Layer, Equatable { } - /// Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up. - @_documentation(visibility: public) - public func iconOffset(_ constant: [Double]) -> Self { - with(self, setter(\.iconOffset, .constant(constant))) - } - /// Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up. @_documentation(visibility: public) public func iconOffset(x: Double, y: Double) -> Self { @@ -782,13 +776,7 @@ public struct SymbolLayer: Layer, Equatable { /// Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left. @_documentation(visibility: public) - public func iconTextFitPadding(_ constant: [Double]) -> Self { - with(self, setter(\.iconTextFitPadding, .constant(constant))) - } - - /// Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left. - @_documentation(visibility: public) - public func iconTextFitPadding(padding: UIEdgeInsets) -> Self { + public func iconTextFitPadding(_ padding: UIEdgeInsets) -> Self { with(self, setter(\.iconTextFitPadding, .constant([padding.top, padding.right, padding.bottom, padding.left]))) } @@ -1020,12 +1008,6 @@ public struct SymbolLayer: Layer, Equatable { } - /// Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. - @_documentation(visibility: public) - public func textOffset(_ constant: [Double]) -> Self { - with(self, setter(\.textOffset, .constant(constant))) - } - /// Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. @_documentation(visibility: public) public func textOffset(x: Double, y: Double) -> Self { @@ -1333,12 +1315,6 @@ public struct SymbolLayer: Layer, Equatable { } - /// Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. - @_documentation(visibility: public) - public func iconTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.iconTranslate, .constant(constant))) - } - /// Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. @_documentation(visibility: public) public func iconTranslate(x: Double, y: Double) -> Self { @@ -1497,12 +1473,6 @@ public struct SymbolLayer: Layer, Equatable { } - /// Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. - @_documentation(visibility: public) - public func textTranslate(_ constant: [Double]) -> Self { - with(self, setter(\.textTranslate, .constant(constant))) - } - /// Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. @_documentation(visibility: public) public func textTranslate(x: Double, y: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift b/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift index ad948c6ea82..00b7b208932 100644 --- a/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift +++ b/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift @@ -136,12 +136,6 @@ extension DirectionalLight { } - /// Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0 degree, directly above, to 180 degree, directly below). - @_documentation(visibility: public) - public func direction(_ constant: [Double]) -> Self { - with(self, setter(\.direction, .constant(constant))) - } - /// Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0 degree, directly above, to 180 degree, directly below). @_documentation(visibility: public) public func direction(azimuthal: Double, polar: Double) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Light/FlatLight.swift b/Sources/MapboxMaps/Style/Generated/Light/FlatLight.swift index a6a25d72956..16325acd55f 100644 --- a/Sources/MapboxMaps/Style/Generated/Light/FlatLight.swift +++ b/Sources/MapboxMaps/Style/Generated/Light/FlatLight.swift @@ -143,12 +143,6 @@ extension FlatLight { } - /// Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0 degree (0 degree when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0 degree when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0 degree, directly above, to 180 degree, directly below). - @_documentation(visibility: public) - public func position(_ constant: [Double]) -> Self { - with(self, setter(\.position, .constant(constant))) - } - /// Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0 degree (0 degree when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0 degree when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0 degree, directly above, to 180 degree, directly below). @_documentation(visibility: public) public func position(radial: Double, azimuthal: Double, polar: Double) -> Self { diff --git a/Tests/MapboxMapsTests/Style/DSL/DynamicStylingTests.swift b/Tests/MapboxMapsTests/Style/DSL/DynamicStylingTests.swift index 398a84a860e..86a3e986568 100644 --- a/Tests/MapboxMapsTests/Style/DSL/DynamicStylingTests.swift +++ b/Tests/MapboxMapsTests/Style/DSL/DynamicStylingTests.swift @@ -8,14 +8,14 @@ final class DynamicStylingTests: XCTestCase { .color(StyleColor.testConstantValue()) .highColor(StyleColor.testConstantValue()) .horizonBlend(Double.testConstantValue()) - .range([Double].testConstantValue()) + .range(start: 0, end: 1) .spaceColor(StyleColor.testConstantValue()) .starIntensity(Double.testConstantValue()) XCTAssertEqual(atmosphere.color, Value.constant(.testConstantValue())) XCTAssertEqual(atmosphere.highColor, Value.constant(.testConstantValue())) XCTAssertEqual(atmosphere.horizonBlend, Value.testConstantValue()) - XCTAssertEqual(atmosphere.range, Value<[Double]>.testConstantValue()) + XCTAssertEqual(atmosphere.range, .constant([0, 1])) XCTAssertEqual(atmosphere.spaceColor, Value.constant(.testConstantValue())) XCTAssertEqual(atmosphere.starIntensity, Value.testConstantValue()) } diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/CircleLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/CircleLayerTests.swift index 00e4709b69f..6d45bad6d67 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/CircleLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/CircleLayerTests.swift @@ -150,7 +150,7 @@ final class CircleLayerTests: XCTestCase { .circleStrokeColor(StyleColor.testConstantValue()) .circleStrokeOpacity(Double.testConstantValue()) .circleStrokeWidth(Double.testConstantValue()) - .circleTranslate([Double].testConstantValue()) + .circleTranslate(x: 0, y: 1) .circleTranslateAnchor(CircleTranslateAnchor.testConstantValue()) XCTAssertEqual(layer.filter, Expression.testConstantValue()) @@ -170,7 +170,7 @@ final class CircleLayerTests: XCTestCase { XCTAssertEqual(layer.circleStrokeColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.circleStrokeOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.circleStrokeWidth, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.circleTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.circleTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.circleTranslateAnchor, Value.constant(CircleTranslateAnchor.testConstantValue())) } } diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/FillExtrusionLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/FillExtrusionLayerTests.swift index 17f0068a083..99ab776cdd3 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/FillExtrusionLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/FillExtrusionLayerTests.swift @@ -186,7 +186,7 @@ final class FillExtrusionLayerTests: XCTestCase { .fillExtrusionOpacity(Double.testConstantValue()) .fillExtrusionPattern(String.testConstantValue()) .fillExtrusionRoundedRoof(Bool.testConstantValue()) - .fillExtrusionTranslate([Double].testConstantValue()) + .fillExtrusionTranslate(x: 0, y: 1) .fillExtrusionTranslateAnchor(FillExtrusionTranslateAnchor.testConstantValue()) .fillExtrusionVerticalGradient(Bool.testConstantValue()) .fillExtrusionVerticalScale(Double.testConstantValue()) @@ -216,7 +216,7 @@ final class FillExtrusionLayerTests: XCTestCase { XCTAssertEqual(layer.fillExtrusionOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.fillExtrusionPattern, Value.constant(.name(String.testConstantValue()))) XCTAssertEqual(layer.fillExtrusionRoundedRoof, Value.constant(Bool.testConstantValue())) - XCTAssertEqual(layer.fillExtrusionTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.fillExtrusionTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.fillExtrusionTranslateAnchor, Value.constant(FillExtrusionTranslateAnchor.testConstantValue())) XCTAssertEqual(layer.fillExtrusionVerticalGradient, Value.constant(Bool.testConstantValue())) XCTAssertEqual(layer.fillExtrusionVerticalScale, Value.constant(Double.testConstantValue())) diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/FillLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/FillLayerTests.swift index 1374c29253d..66d9b6141d2 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/FillLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/FillLayerTests.swift @@ -134,7 +134,7 @@ final class FillLayerTests: XCTestCase { .fillOpacity(Double.testConstantValue()) .fillOutlineColor(StyleColor.testConstantValue()) .fillPattern(String.testConstantValue()) - .fillTranslate([Double].testConstantValue()) + .fillTranslate(x: 0, y: 1) .fillTranslateAnchor(FillTranslateAnchor.testConstantValue()) XCTAssertEqual(layer.filter, Expression.testConstantValue()) @@ -150,7 +150,7 @@ final class FillLayerTests: XCTestCase { XCTAssertEqual(layer.fillOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.fillOutlineColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.fillPattern, Value.constant(.name(String.testConstantValue()))) - XCTAssertEqual(layer.fillTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.fillTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.fillTranslateAnchor, Value.constant(FillTranslateAnchor.testConstantValue())) } } diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/LineLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/LineLayerTests.swift index 5749f0771c8..8169675556b 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/LineLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/LineLayerTests.swift @@ -174,9 +174,9 @@ final class LineLayerTests: XCTestCase { .lineOffset(Double.testConstantValue()) .lineOpacity(Double.testConstantValue()) .linePattern(String.testConstantValue()) - .lineTranslate([Double].testConstantValue()) + .lineTranslate(x: 0, y: 1) .lineTranslateAnchor(LineTranslateAnchor.testConstantValue()) - .lineTrimOffset([Double].testConstantValue()) + .lineTrimOffset(start: 0, end: 1) .lineWidth(Double.testConstantValue()) XCTAssertEqual(layer.filter, Expression.testConstantValue()) @@ -202,9 +202,9 @@ final class LineLayerTests: XCTestCase { XCTAssertEqual(layer.lineOffset, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.lineOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.linePattern, Value.constant(.name(String.testConstantValue()))) - XCTAssertEqual(layer.lineTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.lineTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.lineTranslateAnchor, Value.constant(LineTranslateAnchor.testConstantValue())) - XCTAssertEqual(layer.lineTrimOffset, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.lineTrimOffset, Value.constant([0, 1])) XCTAssertEqual(layer.lineWidth, Value.constant(Double.testConstantValue())) } } diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/LocationIndicatorLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/LocationIndicatorLayerTests.swift index 72372cda5f0..b32973cc2c6 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/LocationIndicatorLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/LocationIndicatorLayerTests.swift @@ -154,7 +154,7 @@ final class LocationIndicatorLayerTests: XCTestCase { .emphasisCircleColor(StyleColor.testConstantValue()) .emphasisCircleRadius(Double.testConstantValue()) .imagePitchDisplacement(Double.testConstantValue()) - .location([Double].testConstantValue()) + .location(CLLocationCoordinate2D(latitude: 10, longitude: 20)) .locationIndicatorOpacity(Double.testConstantValue()) .perspectiveCompensation(Double.testConstantValue()) .shadowImageSize(Double.testConstantValue()) @@ -174,7 +174,7 @@ final class LocationIndicatorLayerTests: XCTestCase { XCTAssertEqual(layer.emphasisCircleColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.emphasisCircleRadius, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.imagePitchDisplacement, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.location, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.location, Value.constant([10, 20])) XCTAssertEqual(layer.locationIndicatorOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.perspectiveCompensation, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.shadowImageSize, Value.constant(Double.testConstantValue())) diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/ModelLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/ModelLayerTests.swift index 96ac8c023f3..070503b7bc4 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/ModelLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/ModelLayerTests.swift @@ -153,14 +153,14 @@ final class ModelLayerTests: XCTestCase { .modelColorMixIntensity(Double.testConstantValue()) .modelCutoffFadeRange(Double.testConstantValue()) .modelEmissiveStrength(Double.testConstantValue()) - .modelHeightBasedEmissiveStrengthMultiplier([Double].testConstantValue()) + .modelHeightBasedEmissiveStrengthMultiplier(gradientBegin: 0, gradientEnd: 1, valueAtBegin: 2, valueAtEnd: 3, gradientCurvePower: 4) .modelOpacity(Double.testConstantValue()) .modelReceiveShadows(Bool.testConstantValue()) - .modelRotation([Double].testConstantValue()) + .modelRotation(x: 0, y: 1, z: 2) .modelRoughness(Double.testConstantValue()) - .modelScale([Double].testConstantValue()) + .modelScale(x: 0, y: 1, z: 2) .modelScaleMode(ModelScaleMode.testConstantValue()) - .modelTranslation([Double].testConstantValue()) + .modelTranslation(x: 0, y: 1, z: 2) .modelType(ModelType.testConstantValue()) XCTAssertEqual(layer.filter, Expression.testConstantValue()) @@ -176,14 +176,14 @@ final class ModelLayerTests: XCTestCase { XCTAssertEqual(layer.modelColorMixIntensity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.modelCutoffFadeRange, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.modelEmissiveStrength, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.modelHeightBasedEmissiveStrengthMultiplier, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.modelHeightBasedEmissiveStrengthMultiplier, Value.constant([0, 1, 2, 3, 4])) XCTAssertEqual(layer.modelOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.modelReceiveShadows, Value.constant(Bool.testConstantValue())) - XCTAssertEqual(layer.modelRotation, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.modelRotation, Value.constant([0, 1, 2])) XCTAssertEqual(layer.modelRoughness, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.modelScale, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.modelScale, Value.constant([0, 1, 2])) XCTAssertEqual(layer.modelScaleMode, Value.constant(ModelScaleMode.testConstantValue())) - XCTAssertEqual(layer.modelTranslation, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.modelTranslation, Value.constant([0, 1, 2])) XCTAssertEqual(layer.modelType, Value.constant(ModelType.testConstantValue())) } } diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/RasterLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/RasterLayerTests.swift index c7f0ad1ffa7..779c91b0718 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/RasterLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/RasterLayerTests.swift @@ -146,8 +146,8 @@ final class RasterLayerTests: XCTestCase { .rasterBrightnessMax(Double.testConstantValue()) .rasterBrightnessMin(Double.testConstantValue()) .rasterColor(StyleColor.testConstantValue()) - .rasterColorMix([Double].testConstantValue()) - .rasterColorRange([Double].testConstantValue()) + .rasterColorMix(red: 0, green: 1, blue: 2, offset: 3) + .rasterColorRange(min: 0, max: 1) .rasterContrast(Double.testConstantValue()) .rasterElevation(Double.testConstantValue()) .rasterEmissiveStrength(Double.testConstantValue()) @@ -167,8 +167,8 @@ final class RasterLayerTests: XCTestCase { XCTAssertEqual(layer.rasterBrightnessMax, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.rasterBrightnessMin, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.rasterColor, Value.constant(StyleColor.testConstantValue())) - XCTAssertEqual(layer.rasterColorMix, Value.constant([Double].testConstantValue())) - XCTAssertEqual(layer.rasterColorRange, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.rasterColorMix, Value.constant([0, 1, 2, 3])) + XCTAssertEqual(layer.rasterColorRange, Value.constant([0, 1])) XCTAssertEqual(layer.rasterContrast, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.rasterElevation, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.rasterEmissiveStrength, Value.constant(Double.testConstantValue())) diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/SkyLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/SkyLayerTests.swift index 0d5af4f488f..b0c6e28ad24 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/SkyLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/SkyLayerTests.swift @@ -121,10 +121,10 @@ final class SkyLayerTests: XCTestCase { .maxZoom(Double.testConstantValue()) .skyAtmosphereColor(StyleColor.testConstantValue()) .skyAtmosphereHaloColor(StyleColor.testConstantValue()) - .skyAtmosphereSun([Double].testConstantValue()) + .skyAtmosphereSun(azimuthal: 0, polar: 1) .skyAtmosphereSunIntensity(Double.testConstantValue()) .skyGradient(StyleColor.testConstantValue()) - .skyGradientCenter([Double].testConstantValue()) + .skyGradientCenter(azimuthal: 0, polar: 1) .skyGradientRadius(Double.testConstantValue()) .skyOpacity(Double.testConstantValue()) .skyType(SkyType.testConstantValue()) @@ -134,10 +134,10 @@ final class SkyLayerTests: XCTestCase { XCTAssertEqual(layer.maxZoom, Double.testConstantValue()) XCTAssertEqual(layer.skyAtmosphereColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.skyAtmosphereHaloColor, Value.constant(StyleColor.testConstantValue())) - XCTAssertEqual(layer.skyAtmosphereSun, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.skyAtmosphereSun, Value.constant([0, 1])) XCTAssertEqual(layer.skyAtmosphereSunIntensity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.skyGradient, Value.constant(StyleColor.testConstantValue())) - XCTAssertEqual(layer.skyGradientCenter, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.skyGradientCenter, Value.constant([0, 1])) XCTAssertEqual(layer.skyGradientRadius, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.skyOpacity, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.skyType, Value.constant(SkyType.testConstantValue())) diff --git a/Tests/MapboxMapsTests/Style/Generated/Layers/SymbolLayerTests.swift b/Tests/MapboxMapsTests/Style/Generated/Layers/SymbolLayerTests.swift index 1d403aef4fe..43d43fb2961 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Layers/SymbolLayerTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Layers/SymbolLayerTests.swift @@ -245,7 +245,7 @@ final class SymbolLayerTests: XCTestCase { .iconIgnorePlacement(Bool.testConstantValue()) .iconImage(String.testConstantValue()) .iconKeepUpright(Bool.testConstantValue()) - .iconOffset([Double].testConstantValue()) + .iconOffset(x: 0, y: 1) .iconOptional(Bool.testConstantValue()) .iconPadding(Double.testConstantValue()) .iconPitchAlignment(IconPitchAlignment.testConstantValue()) @@ -253,7 +253,7 @@ final class SymbolLayerTests: XCTestCase { .iconRotationAlignment(IconRotationAlignment.testConstantValue()) .iconSize(Double.testConstantValue()) .iconTextFit(IconTextFit.testConstantValue()) - .iconTextFitPadding([Double].testConstantValue()) + .iconTextFitPadding(UIEdgeInsets(top: 1, left: 2, bottom: 3, right: 4)) .symbolAvoidEdges(Bool.testConstantValue()) .symbolPlacement(SymbolPlacement.testConstantValue()) .symbolSortKey(Double.testConstantValue()) @@ -271,7 +271,7 @@ final class SymbolLayerTests: XCTestCase { .textLineHeight(Double.testConstantValue()) .textMaxAngle(Double.testConstantValue()) .textMaxWidth(Double.testConstantValue()) - .textOffset([Double].testConstantValue()) + .textOffset(x: 0, y: 1) .textOptional(Bool.testConstantValue()) .textPadding(Double.testConstantValue()) .textPitchAlignment(TextPitchAlignment.testConstantValue()) @@ -290,7 +290,7 @@ final class SymbolLayerTests: XCTestCase { .iconHaloWidth(Double.testConstantValue()) .iconImageCrossFade(Double.testConstantValue()) .iconOpacity(Double.testConstantValue()) - .iconTranslate([Double].testConstantValue()) + .iconTranslate(x: 0, y: 1) .iconTranslateAnchor(IconTranslateAnchor.testConstantValue()) .textColor(StyleColor.testConstantValue()) .textEmissiveStrength(Double.testConstantValue()) @@ -298,7 +298,7 @@ final class SymbolLayerTests: XCTestCase { .textHaloColor(StyleColor.testConstantValue()) .textHaloWidth(Double.testConstantValue()) .textOpacity(Double.testConstantValue()) - .textTranslate([Double].testConstantValue()) + .textTranslate(x: 0, y: 1) .textTranslateAnchor(TextTranslateAnchor.testConstantValue()) XCTAssertEqual(layer.filter, Expression.testConstantValue()) @@ -312,7 +312,7 @@ final class SymbolLayerTests: XCTestCase { XCTAssertEqual(layer.iconIgnorePlacement, Value.constant(Bool.testConstantValue())) XCTAssertEqual(layer.iconImage, Value.constant(.name(String.testConstantValue()))) XCTAssertEqual(layer.iconKeepUpright, Value.constant(Bool.testConstantValue())) - XCTAssertEqual(layer.iconOffset, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.iconOffset, Value.constant([0, 1])) XCTAssertEqual(layer.iconOptional, Value.constant(Bool.testConstantValue())) XCTAssertEqual(layer.iconPadding, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.iconPitchAlignment, Value.constant(IconPitchAlignment.testConstantValue())) @@ -320,7 +320,7 @@ final class SymbolLayerTests: XCTestCase { XCTAssertEqual(layer.iconRotationAlignment, Value.constant(IconRotationAlignment.testConstantValue())) XCTAssertEqual(layer.iconSize, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.iconTextFit, Value.constant(IconTextFit.testConstantValue())) - XCTAssertEqual(layer.iconTextFitPadding, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.iconTextFitPadding, Value.constant([1, 4, 3, 2])) XCTAssertEqual(layer.symbolAvoidEdges, Value.constant(Bool.testConstantValue())) XCTAssertEqual(layer.symbolPlacement, Value.constant(SymbolPlacement.testConstantValue())) XCTAssertEqual(layer.symbolSortKey, Value.constant(Double.testConstantValue())) @@ -338,7 +338,7 @@ final class SymbolLayerTests: XCTestCase { XCTAssertEqual(layer.textLineHeight, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.textMaxAngle, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.textMaxWidth, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.textOffset, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.textOffset, Value.constant([0, 1])) XCTAssertEqual(layer.textOptional, Value.constant(Bool.testConstantValue())) XCTAssertEqual(layer.textPadding, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.textPitchAlignment, Value.constant(TextPitchAlignment.testConstantValue())) @@ -357,7 +357,7 @@ final class SymbolLayerTests: XCTestCase { XCTAssertEqual(layer.iconHaloWidth, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.iconImageCrossFade, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.iconOpacity, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.iconTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.iconTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.iconTranslateAnchor, Value.constant(IconTranslateAnchor.testConstantValue())) XCTAssertEqual(layer.textColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.textEmissiveStrength, Value.constant(Double.testConstantValue())) @@ -365,7 +365,7 @@ final class SymbolLayerTests: XCTestCase { XCTAssertEqual(layer.textHaloColor, Value.constant(StyleColor.testConstantValue())) XCTAssertEqual(layer.textHaloWidth, Value.constant(Double.testConstantValue())) XCTAssertEqual(layer.textOpacity, Value.constant(Double.testConstantValue())) - XCTAssertEqual(layer.textTranslate, Value.constant([Double].testConstantValue())) + XCTAssertEqual(layer.textTranslate, Value.constant([0, 1])) XCTAssertEqual(layer.textTranslateAnchor, Value.constant(TextTranslateAnchor.testConstantValue())) } } diff --git a/scripts/api-compatibility-check/breakage_allowlist.txt b/scripts/api-compatibility-check/breakage_allowlist.txt index 4d1a7cd6b09..243455a9efa 100644 --- a/scripts/api-compatibility-check/breakage_allowlist.txt +++ b/scripts/api-compatibility-check/breakage_allowlist.txt @@ -1341,9 +1341,9 @@ Protocol Conformance Change Struct MapStyle has removed conformance to Equatable Constructor Model.init(uri:position:orientation:) has been removed -// Change TransitionOptions from Extension to Struct +// Change TransitionOptions from Extension to Struct Extension TransitionOptions has been changed to a Struct -Extension TransitionOptions has ObjC name change from MBMTransitionOptions to +Extension TransitionOptions has ObjC name change from MBMTransitionOptions to Extension TransitionOptions has removed conformance to CVarArg Extension TransitionOptions has removed conformance to CustomDebugStringConvertible Extension TransitionOptions has removed conformance to CustomStringConvertible @@ -1353,33 +1353,33 @@ Extension TransitionOptions is no longer open for subclassing // Make MapContent gereic over the Body and adjust MapContentBuilder to use opaque types -Constructor ForEvery.init(_:content:) has generic signature change from to -Constructor ForEvery.init(_:id:content:) has generic signature change from to -Func MapContentBuilder.buildBlock(_:) has generic signature change from to -Func MapContentBuilder.buildEither(first:) has generic signature change from to -Func MapContentBuilder.buildEither(second:) has generic signature change from to -Func MapContentBuilder.buildOptional(_:) has generic signature change from to -Protocol MapContent has generic signature change from to -Struct ForEvery has generic signature change from to -Constructor Map.init(initialViewport:content:) has parameter 1 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent -Constructor Map.init(initialViewport:urlOpener:content:) has parameter 2 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent -Constructor Map.init(viewport:content:) has parameter 1 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent -Constructor Map.init(viewport:urlOpener:content:) has parameter 2 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent -Func MapContentBuilder.buildBlock(_:) has parameter 0 type change from MapboxMaps.MapContent... to repeat each Content -Func MapContentBuilder.buildBlock(_:) has return type change from MapboxMaps.MapContent to MapboxMaps.TupleMapContent<(repeat each Content)> -Func MapContentBuilder.buildEither(first:) has parameter 0 type change from MapboxMaps.MapContent to First -Func MapContentBuilder.buildEither(first:) has return type change from MapboxMaps.MapContent to MapboxMaps.ConditionalMapContent -Func MapContentBuilder.buildEither(second:) has parameter 0 type change from MapboxMaps.MapContent to Second -Func MapContentBuilder.buildEither(second:) has return type change from MapboxMaps.MapContent to MapboxMaps.ConditionalMapContent -Func MapContentBuilder.buildOptional(_:) has parameter 0 type change from (MapboxMaps.MapContent)? to T? -Func MapContentBuilder.buildOptional(_:) has return type change from MapboxMaps.MapContent to MapboxMaps.OptionalMapContent -AssociatedType MapContent.Body has been added as a protocol requirement -Var MapContent.body has been added as a protocol requirement +Constructor ForEvery.init(_:content:) has generic signature change from to +Constructor ForEvery.init(_:id:content:) has generic signature change from to +Func MapContentBuilder.buildBlock(_:) has generic signature change from to +Func MapContentBuilder.buildEither(first:) has generic signature change from to +Func MapContentBuilder.buildEither(second:) has generic signature change from to +Func MapContentBuilder.buildOptional(_:) has generic signature change from to +Protocol MapContent has generic signature change from to +Struct ForEvery has generic signature change from to +Constructor Map.init(initialViewport:content:) has parameter 1 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent +Constructor Map.init(initialViewport:urlOpener:content:) has parameter 2 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent +Constructor Map.init(viewport:content:) has parameter 1 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent +Constructor Map.init(viewport:urlOpener:content:) has parameter 2 type change from () -> MapboxMaps.MapContent to () -> some MapboxMaps.MapContent +Func MapContentBuilder.buildBlock(_:) has parameter 0 type change from MapboxMaps.MapContent... to repeat each Content +Func MapContentBuilder.buildBlock(_:) has return type change from MapboxMaps.MapContent to MapboxMaps.TupleMapContent<(repeat each Content)> +Func MapContentBuilder.buildEither(first:) has parameter 0 type change from MapboxMaps.MapContent to First +Func MapContentBuilder.buildEither(first:) has return type change from MapboxMaps.MapContent to MapboxMaps.ConditionalMapContent +Func MapContentBuilder.buildEither(second:) has parameter 0 type change from MapboxMaps.MapContent to Second +Func MapContentBuilder.buildEither(second:) has return type change from MapboxMaps.MapContent to MapboxMaps.ConditionalMapContent +Func MapContentBuilder.buildOptional(_:) has parameter 0 type change from (MapboxMaps.MapContent)? to T? +Func MapContentBuilder.buildOptional(_:) has return type change from MapboxMaps.MapContent to MapboxMaps.OptionalMapContent +AssociatedType MapContent.Body has been added as a protocol requirement +Var MapContent.body has been added as a protocol requirement // Style Import API Constructor StyleImportConfiguration.init(importId:config:) has been removed -Constructor MapStyle.init(json:importConfigurations:) has been removed -Constructor MapStyle.init(uri:importConfigurations:) has been removed +Constructor MapStyle.init(json:importConfigurations:) has been removed +Constructor MapStyle.init(uri:importConfigurations:) has been removed Func StyleImportConfiguration.==(_:_:) has been removed Var StyleImportConfiguration.config has been removed Var StyleImportConfiguration.importId has been removed @@ -1396,4 +1396,17 @@ Struct StyleImportConfiguration has been renamed to Struct StyleImport // Add layer position to puck Constructor Puck3DConfiguration.init(model:modelScale:modelRotation:modelOpacity:modelCastShadows:modelReceiveShadows:modelScaleMode:modelEmissiveStrength:) has been removed Constructor Puck2DConfiguration.init(topImage:bearingImage:shadowImage:scale:showsAccuracyRing:accuracyRingColor:accuracyRingBorderColor:opacity:) has been removed -Constructor Puck3DConfiguration.init(model:modelScale:modelRotation:modelOpacity:) has been removed \ No newline at end of file +Constructor Puck3DConfiguration.init(model:modelScale:modelRotation:modelOpacity:) has been removed + +// Update Annotations and Puck3D properties syntax +Renamed Decls +Func PointAnnotation.iconOffset(_:) has been renamed to Func iconOffset(x:y:) +Func PointAnnotation.textOffset(_:) has been renamed to Func textOffset(x:y:) +Func Puck3D.modelRotation(_:) has been renamed to Func modelRotation(x:y:z:) +Func Puck3D.modelScale(_:) has been renamed to Func modelScale(x:y:z:) +Type Changes +Func PointAnnotation.iconOffset(_:) has parameter 0 type change from [Swift.Double] to Swift.Double +Func PointAnnotation.iconTextFitPadding(_:) has parameter 0 type change from [Swift.Double] to UIKit.UIEdgeInsets +Func PointAnnotation.textOffset(_:) has parameter 0 type change from [Swift.Double] to Swift.Double +Func Puck3D.modelRotation(_:) has parameter 0 type change from [Swift.Double] to Swift.Double +Func Puck3D.modelScale(_:) has parameter 0 type change from [Swift.Double] to Swift.Double