CameraStateTransition
public protocol CameraStateTransition : AnyObject
Protocol, which is used to execute camera related transitions, based on data provided
via CameraOptions
in ViewportDataSource
.
By default Navigation SDK for iOS provides default implementation of CameraStateTransition
in NavigationCameraStateTransition
.
-
Initializer of
NavigationViewportDataSource
object.Declaration
Swift
init(_ mapView: MapView)
Parameters
mapView
MapView
object, on instance of which camera related transitions will be performed. -
Method, which performs camera transition to the
NavigationCameraState.following
state.Declaration
Swift
func transitionToFollowing(_ cameraOptions: CameraOptions, completion: @escaping (() -> Void))
Parameters
cameraOptions
Instance of
CameraOptions
, which describes viewpoint of theMapView
.completion
Completion handler, which is called after performing transition.
-
Method, which performs camera transition to the
NavigationCameraState.overview
state.Declaration
Swift
func transitionToOverview(_ cameraOptions: CameraOptions, completion: @escaping (() -> Void))
Parameters
cameraOptions
Instance of
CameraOptions
, which describes viewpoint of theMapView
.completion
Completion handler, which is called after performing transition.
-
Method, which performs camera update, when already in the
NavigationCameraState.overview
state orNavigationCameraState.following
state.Declaration
Swift
func update(to cameraOptions: CameraOptions, state: NavigationCameraState)
Parameters
cameraOptions
Instance of
CameraOptions
, which describes viewpoint of theMapView
.state
Instance of
NavigationCameraState
, which describes the current state ofNavigationCamera
. -
Method, which cancels current transition.
Declaration
Swift
func cancelPendingTransition()