-
Used to set up camera specific configuration
Declaration
Swift
public internal(set) var mapCameraOptions: MapCameraOptions { get }
-
List of animators currently alive
Declaration
Swift
public var cameraAnimatorsList: [CameraAnimator] { get }
-
Undocumented
Declaration
Swift
public init(for mapView: BaseMapView, with mapCameraOptions: MapCameraOptions)
-
Creates a new
Camera
object to fit a given array of coordinates.Note: This method does not set the map’s camera to the new values. You must call
Declaration
Swift
public func camera(for coordinates: [CLLocationCoordinate2D]) -> CameraOptions
Parameters
coordinates
Array of coordinates that should fit within the new viewport.
Return Value
A
Camera
object that contains all coordinates within the viewport. -
Returns the camera that best fits the given coordinate bounds, with optional edge padding, bearing, and pitch values.
Declaration
Swift
public func camera(for coordinateBounds: CoordinateBounds, edgePadding: UIEdgeInsets = UIEdgeInsets.zero, bearing: CGFloat = 0.0, pitch: CGFloat = 0.0) -> CameraOptions
Parameters
coordinateBounds
The coordinate bounds that will be displayed within the viewport.
edgePadding
The new padding to be used by the camera. By default, this value is
UIEdgeInsets.zero
.bearing
The new bearing to be used by the camera. By default, this value is
0
.pitch
The new pitch to be used by the camera. By default, this value is
0
.Return Value
A set of options
CameraOptions
that represents properties of the Camera. -
Returns the camera that best fits the given geometry, with optional edge padding, bearing, and pitch values.
Declaration
Swift
public func camera(fitting geometry: Geometry, edgePadding: UIEdgeInsets = UIEdgeInsets.zero, bearing: CGFloat = 0.0, pitch: CGFloat = 0.0) -> CameraOptions
Parameters
geometry
The geoemtry that will be displayed within the viewport.
edgePadding
The new padding to be used by the camera. By default, this value is
UIEdgeInsets.zero
.bearing
The new bearing to be used by the camera. By default, this value is
0
.pitch
The new pitch to be used by the camera. By default, this value is
0
.Return Value
A set of options
CameraOptions
that represents properties of the Camera. -
Returns the coordinate bounds for a given
Camera
object’s viewport.Declaration
Swift
public func coordinateBounds(for camera: CameraOptions) -> CoordinateBounds
Parameters
camera
The camera that the coordinate bounds will be returned for.
Return Value
CoordinateBounds
for the givenCamera
-
Transition the map’s viewport to a new camera.
Declaration
Swift
public func setCamera(to targetCamera: CameraOptions, animated: Bool = false, duration: TimeInterval = 0, completion: ((UIViewAnimatingPosition) -> Void)? = nil)
Parameters
targetCamera
The target camera to transition to.
animated
Set to
true
if transition should be animated.false
by default.duration
Controls the duration of the animation transition. Must be greater than zero if
animated
is true.completion
The completion block to be called after an animated transition. Only called if
animated
is true. -
Undocumented
Declaration
Swift
public func cancelAnimations()
-
Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration and timing function It seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
NOTE: Keep in mind the lifecycle of the
CameraAnimator
returned by this method. If aCameraAnimator
is destroyed, before the animation is finished, the animation will be interrupted and completion handlers will be called.Declaration
Swift
public func fly(to camera: CameraOptions, duration: TimeInterval? = nil, completion: AnimationCompletion? = nil) -> CameraAnimator?
Parameters
camera
The camera options at the end of the animation. Any camera parameters that are nil will not be animated.
duration
Duration of the animation, measured in seconds. If nil, a suitable calculated duration is used.
completion
Completion handler called when the animation stops
Return Value
The optional
CameraAnimator
that will execute the FlyTo animation
-
Convenience to create a
CameraAnimator
and will add it to a list ofCameraAnimators
to track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
CameraAnimator
. If aCameraAnimator
is destroyed, before the animation is finished, the animation will be interrupted and completion handlers will be called.Declaration
Swift
public func makeCameraAnimator(duration: TimeInterval, timingParameters parameters: UITimingCurveProvider, animationOwner: AnimationOwner = .unspecified) -> CameraAnimator
Parameters
duration
The duration of the animation, in seconds.
timingParameters
The object providing the timing information. This object must adopt the
UITimingCurveProvider
protocol.animationOwner
Property that conforms to
AnimationOwnerProtocol
to represent who owns that animation.Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
CameraAnimator
and will add it to a list ofCameraAnimators
to track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
CameraAnimator
. If aCameraAnimator
is destroyed, before the animation is finished, the animation will be interrupted and completion handlers will be called.Declaration
Swift
public func makeCameraAnimator(duration: TimeInterval, curve: UIView.AnimationCurve, animationOwner: AnimationOwner = .unspecified, animations: (() -> Void)? = nil) -> CameraAnimator
Parameters
duration
The duration of the animation, in seconds.
curve
The UIKit timing curve to apply to the animation.
animationOwner
Property that conforms to
AnimationOwnerProtocol
to represent who owns that animation.animations
The block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
CameraAnimator
and will add it to a list ofCameraAnimators
to track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
CameraAnimator
. If aCameraAnimator
is destroyed, before the animation is finished, the animation will be interrupted and completion handlers will be called.Declaration
Swift
public func makeCameraAnimator(duration: TimeInterval, controlPoint1 point1: CGPoint, controlPoint2 point2: CGPoint, animationOwner: AnimationOwner = .unspecified, animations: (() -> Void)? = nil) -> CameraAnimator
Parameters
duration
The duration of the animation, in seconds.
controlPoint1
The first control point for the cubic Bézier timing curve.
controlPoint2
The second control point for the cubic Bézier timing curve.
animationOwner
Property that conforms to
AnimationOwnerProtocol
to represent who owns that animation.animations
The block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
CameraAnimator
and will add it to a list ofCameraAnimators
to track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
CameraAnimator
. If aCameraAnimator
is destroyed, before the animation is finished, the animation will be interrupted and completion handlers will be called.Declaration
Swift
public func makeCameraAnimator(duration: TimeInterval, dampingRatio ratio: CGFloat, animationOwner: AnimationOwner = .unspecified, animations: (() -> Void)? = nil) -> CameraAnimator
Parameters
duration
The duration of the animation, in seconds.
dampingRatio
The damping ratio to apply to the initial acceleration and oscillation. To smoothly decelerate the animation without oscillation, specify a value of 1. Specify values closer to 0 to create less damping and more oscillation.
animationOwner
Property that conforms to
AnimationOwnerProtocol
to represent who owns that animation.animations
The block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.