From 65493ffa26c2c8dcf0a9f4570cad91edf4570517 Mon Sep 17 00:00:00 2001 From: Aleksei Sapitskii <45671572+aleksproger@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:07:07 +0200 Subject: [PATCH] Deprecate camera(for:padding:bearing:pitch:) (#2033) * Deprecate camera(for:padding:bearing:pitch:) * Fix doc --- Sources/MapboxMaps/Foundation/MapboxMap.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/MapboxMaps/Foundation/MapboxMap.swift b/Sources/MapboxMaps/Foundation/MapboxMap.swift index a68b4a481be4..22c7252f15d7 100644 --- a/Sources/MapboxMaps/Foundation/MapboxMap.swift +++ b/Sources/MapboxMaps/Foundation/MapboxMap.swift @@ -476,7 +476,9 @@ public final class MapboxMap: StyleManager { /// /// - Parameters: /// - coordinateBounds: The coordinate bounds that will be displayed within the viewport. - /// - padding: The amount of padding to add to the given bounds when calculating the camera, in points. This is differnt from camera padding. + /// - padding: The amount of padding in screen points to add to the given `coordinates`. + /// This padding is not applied to the map but to the coordinates provided. + /// If you want to apply padding to the map use `camera` parameter on ``camera(for:camera:coordinatesPadding:maxZoom:offset:)`` /// - bearing: The new bearing to be used by the camera, in degrees (0°, 360°) clockwise from true north. /// - pitch: The new pitch to be used by the camera, in degrees (0°, 85°) with 0° being a top-down view. /// - maxZoom: The maximum zoom level to allow when the camera would transition to the specified bounds. @@ -504,10 +506,13 @@ public final class MapboxMap: StyleManager { /// /// - Parameters: /// - coordinates: Array of coordinates that should fit within the new viewport. - /// - padding: The amount of padding to add to the given bounds when calculating the camera, in points. This is differnt from camera padding. + /// - padding: The amount of padding in screen points to add to the given `coordinates`. + /// This padding is not applied to the map but to the coordinates provided. + /// If you want to apply padding to the map use `camera` parameter on ``camera(for:camera:coordinatesPadding:maxZoom:offset:)`` /// - bearing: The new bearing to be used by the camera, in degrees (0°, 360°) clockwise from true north. /// - pitch: The new pitch to be used by the camera, in degrees (0°, 85°) with 0° being a top-down view. /// - Returns: A `CameraOptions` that fits the provided constraints + @available(*, deprecated, message: "Use ``camera(for:camera:coordinatesPadding:maxZoom:offset:)`` instead.") public func camera(for coordinates: [CLLocationCoordinate2D], padding: UIEdgeInsets?, bearing: Double?,