MapCameraAnimationFactory
public class MapCameraAnimationFactory
extension MapCameraAnimationFactory: NativeBase
extension MapCameraAnimationFactory: Hashable
Factory for creating MapCameraAnimation objects to change map’s camera over time.
-
Creates a
MapCameraAnimationto gradually update the camera properties within a specified duration from its current values to the ones defined in theMapCameraAnimationFactory.createAnimation(MapCameraUpdate, TimeInterval, Easing).cameraUpdate.MapCameraAnimationinstances created fromMapCameraUpdateFactory.compositeUpdate(...)instances are not supported. AnAnimationDelegatewill receive anAnimationState.cancelledsignal when trying to apply such animations.Declaration
Swift
public static func createAnimation(from cameraUpdate: MapCameraUpdate, duration: TimeInterval, easing: Easing) -> MapCameraAnimationParameters
cameraUpdateUpdate which should be applied to the map camera.
durationDuration of the animation. Negative duration results in no camera change when applied.
easingEasing to apply.
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation for a movement defined by the supplied
MapCameraAnimationFactory.createAnimation(MapCameraKeyframeTrack).track.Declaration
Swift
public static func createAnimation(track: MapCameraKeyframeTrack) -> MapCameraAnimationParameters
trackThe track
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation for a movement defined by the supplied list of
MapCameraAnimationFactory.createAnimation([MapCameraKeyframeTrack]).tracks. Keyframe tracks specify how the map camera properties change during the animation. For the animation to be possible, no two different tracks can affect the same map camera property. The input tracks are validated with that in mind.However, the following cases can only be detected at the time when animation is started:
- Changing altitude of camera position also changes camera look-at distance and at high altitudes, also camera look-at orientation.
- Changing tilt of camera orientation also changes camera look-at distance and camera look-at target.
- Changing bearing of camera orientation also changes camera look-at target if current tilt is not 0.
- Changing tilt or bearing of camera look-at orientation also changes camera position.
- Changing camera look-at orientation also changes camera look-at distance if tilt is not 0.
Throws
MapCameraAnimation.InstantiationErrorIndicates an instantiation issue.Declaration
Swift
public static func createAnimation(tracks: [MapCameraKeyframeTrack]) throws -> MapCameraAnimationParameters
tracksThe list of tracks
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation to move the current map camera look-at coordinates to the new position along an adaptive ballistic curve.
The beginning and end of the animation will use the current zoom.
Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
Declaration
Swift
public static func flyTo(target: GeoCoordinatesUpdate, bowFactor: Double, duration: TimeInterval) -> MapCameraAnimationParameters
targetThe coordinates of the camera destination point. Any target sub-element value that is not finite will be set to the current camera target sub-element value. Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
bowFactorA bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.
durationDuration of the flight. Negative duration results in no camera change when applied.
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation to move the current map camera look-at coordinates to the new position and orientation along an adaptive ballistic curve.
The beginning and end of the animation will use the current zoom.
Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
Declaration
Swift
public static func flyTo(target: GeoCoordinatesUpdate, orientation: GeoOrientationUpdate, bowFactor: Double, duration: TimeInterval) -> MapCameraAnimationParameters
targetThe coordinates of the camera destination point. Any target sub-element value that is not finite will be set to the current camera target sub-element value. Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
orientationThe orientation at destination.
bowFactorA bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.
durationDuration of the flight. Negative duration results in no camera change when applied.
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation to move the current map camera look-at coordinates to the new position along an adaptive ballistic curve.
The beginning of the animation will use the current zoom and the end of the animation will use the provided zoom.
Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
Declaration
Swift
public static func flyTo(target: GeoCoordinatesUpdate, zoom: MapMeasure, bowFactor: Double, duration: TimeInterval) -> MapCameraAnimationParameters
targetThe coordinates of the camera destination point. Any target sub-element value that is not finite will be set to the current camera target sub-element value. Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
zoomThe zoom at the end of the animation.
bowFactorA bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.
durationDuration of the flight. Negative duration results in no camera change when applied.
Return Value
MapCameraAnimation instance
-
Creates a MapCameraAnimation to move the current map camera look-at coordinates to the new position and orientation along an adaptive ballistic curve.
The beginning of the animation will use the current zoom and the end of the animation will use the provided zoom.
Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
Declaration
Swift
public static func flyTo(target: GeoCoordinatesUpdate, orientation: GeoOrientationUpdate, zoom: MapMeasure, bowFactor: Double, duration: TimeInterval) -> MapCameraAnimationParameters
targetThe coordinates of the camera destination point. Any target sub-element value that is not finite will be set to the current camera target sub-element value. Note: The altitude of the target point is ignored. Any subsequent camera updates and animations will consider the target point as being located on the ground.
orientationThe orientation at destination.
zoomThe zoom at the end of the animation.
bowFactorA bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.
durationDuration of the flight. Negative duration results in no camera change when applied.
Return Value
MapCameraAnimation instance