CameraActions

public protocol CameraActions

A protocol that defines camera actions.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Returns visible region of the map.

    Declaration

    Swift

    var visibleRegion: VisibleRegion { get }
  • Returns current camera properties.

    Declaration

    Swift

    var cameraProperties: CameraProperties { get }
  • Returns the camera tracking mode in the Map.

    Declaration

    Swift

    var cameraTrackingMode: CameraTrackingMode { get set }
  • Adds observer that will be notified with camera event.

    Declaration

    Swift

    func addCameraEventObserver(_ observer: CameraEventObservable)

    Parameters

    observer

    The observer to add.

  • Removes a previously registered observer.

    Declaration

    Swift

    func removeCameraEventObserver(_ observer: CameraEventObservable)

    Parameters

    observer

    The observer to remove.

  • Updates the camera using an animation over the given duration.

    Declaration

    Swift

    func applyCamera(_ update: CameraUpdate, animationDuration: TimeInterval, completion: ((Bool) -> ())?)

    Parameters

    update

    The camera options that will be applied.

    animationDuration

    The animation duration.

    completion

    The completion that will be executed when animation ends or interrupted.

  • Moves the camera without animation.

    Declaration

    Swift

    func moveCamera(_ update: CameraUpdate)

    Parameters

    update

    The camera update that will be applied.

  • Stops camera update that is in progress.

    Declaration

    Swift

    func stopAnimation()

CameraActions

  • applyCamera(_:completion:) Extension method

    Updates the camera using an animation over a one-second duration.

    Declaration

    Swift

    public func applyCamera(_ update: CameraUpdate, completion: ((Bool) -> ())?)

    Parameters

    update

    The camera update that will be applied.

    completion

    The completion that will be executed when animation ends or interrupted.

  • Updates the camera using an animation over the given duration.

    Declaration

    Swift

    public func applyCamera(_ update: CameraUpdate, animationDuration: TimeInterval)

    Parameters

    update

    The camera update that will be applied.

    animationDuration

    The animation duration.

  • applyCamera(_:) Extension method

    Updates the camera using an animation over a one-second duration.

    Declaration

    Swift

    public func applyCamera(_ update: CameraUpdate)

    Parameters

    options

    The camera update that will be applied.