MapCameraAnimationFactory

public class MapCameraAnimationFactory
extension MapCameraAnimationFactory: NativeBase
extension MapCameraAnimationFactory: Hashable

Factory for creating MapCameraAnimation objects to change map’s camera over time.

  • Creates a MapCameraAnimation to gradually update the camera properties within a specified duration from its current values to the ones defined in the MapCameraAnimationFactory.createAnimation(MapCameraUpdate, TimeInterval, Easing).cameraUpdate. MapCameraAnimation instances created from MapCameraUpdateFactory.compositeUpdate(...) instances are not supported. An AnimationDelegate will receive an AnimationState.cancelled signal when trying to apply such animations.

    Declaration

    Swift

    public static func createAnimation(from cameraUpdate: MapCameraUpdate, duration: TimeInterval, easing: Easing) -> MapCameraAnimation

    Parameters

    cameraUpdate

    Update which should be applied to the map camera.

    duration

    Duration of the animation. Negative duration results in no camera change when applied.

    easing

    Easing 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) -> MapCameraAnimation

    Parameters

    track

    The 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.InstantiationError Indicates an instantiation issue.

    Declaration

    Swift

    public static func createAnimation(tracks: [MapCameraKeyframeTrack]) throws -> MapCameraAnimation

    Parameters

    tracks

    The 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) -> MapCameraAnimation

    Parameters

    target

    The 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.

    bowFactor

    A bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.

    duration

    Duration 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) -> MapCameraAnimation

    Parameters

    target

    The 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.

    orientation

    The orientation at destination.

    bowFactor

    A bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.

    duration

    Duration 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) -> MapCameraAnimation

    Parameters

    target

    The 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.

    zoom

    The zoom at the end of the animation.

    bowFactor

    A bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.

    duration

    Duration 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) -> MapCameraAnimation

    Parameters

    target

    The 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.

    orientation

    The orientation at destination.

    zoom

    The zoom at the end of the animation.

    bowFactor

    A bow factor that specifies how high (bowFactor > 0) or low (bowFactor < 0) the camera will fly.

    duration

    Duration of the flight. Negative duration results in no camera change when applied.

    Return Value

    MapCameraAnimation instance