MaplyViewControllerAnimationState

Objective-C

@interface MaplyViewControllerAnimationState : NSObject

Swift

class MaplyViewControllerAnimationState : NSObject

Animation State used by the MaplyViewControllerAnimationDelegate.

You fill out one of these when you’re implementing the animation delegate. Return it and the view controller will set the respective values to match.

  • Heading is calculated from due north If not set or set to MAXFLOAT, this is ignored

    Declaration

    Objective-C

    @property (nonatomic) double heading;

    Swift

    var heading: Double { get set }
  • Height above the map

    Declaration

    Objective-C

    @property (nonatomic) double height;

    Swift

    var height: Double { get set }
  • pos

    Position to move to on the map

    Declaration

    Objective-C

    @property (nonatomic) MaplyCoordinateD pos;

    Swift

    var pos: MaplyCoordinateD { get set }
  • If set, this is a point on the screen where pos should be. By default this is (-1,-1) meaning the screen position is just the middle. Otherwise, this is where the position should wind up on the screen, if it can.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint screenPos;

    Swift

    var screenPos: CGPoint { get set }
  • Interpolate a new state between the given states A and B.

    This does a simple interpolation (lat/lon, not great circle) between the two animation states.

    Declaration

    Objective-C

    + (nonnull MaplyViewControllerAnimationState *)
        Interpolate:(double)t
               from:(MaplyViewControllerAnimationState *_Nonnull)stateA
                 to:(MaplyViewControllerAnimationState *_Nonnull)stateB;

    Swift

    class func interpolate(_ t: Double, from stateA: MaplyViewControllerAnimationState, to stateB: MaplyViewControllerAnimationState) -> MaplyViewControllerAnimationState