BaiduMap_IOSSDK_v6.6.3_Docs  6.6.3
BMKMapAnimation.h
浏览该文件的文档.
1 //
2 // BMKMapAnimation.h
3 // MapComponent
4 //
5 // Created by zhaoxiangru on 2024/3/12.
6 // Copyright © 2024 Baidu. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import <CoreLocation/CLLocation.h>
11 #import "BMKInterpolator.h"
12 #import "BMKPolyline.h"
13 
14 NS_ASSUME_NONNULL_BEGIN
15 @class BMKMapAnimation;
16 typedef enum : NSUInteger {
28  BMKAnimationFillAfter = 2, // @Default
30 
31 typedef enum : NSInteger {
47 typedef enum : NSUInteger {
52 
56 typedef enum : NSUInteger {
60 
61 
63 @protocol BMKMapAnimationDelegate <NSObject>
64 
65 - (void)animation:(BMKMapAnimation *)animation status:(BMKAnimationStatus)st;
66 
67 @end
68 
69 @interface BMKMapAnimation : NSObject
71 @property(nonatomic, assign) BMKAnimationFillMode fillMode;
73 @property(nonatomic, assign) BMKAnimationRepeatMode repeatMode;
74 @property (nonatomic, strong) NSString *extParam; // 给端上做透传的参数,引擎不处理
75 
77 @property(nonatomic, assign) NSInteger startDelay;
78 @property(nonatomic, assign) NSInteger startTime;
79 @property(nonatomic, assign) NSInteger duration;
81 @property(nonatomic, assign) NSInteger repeatCount;
82 @property(nonatomic, weak) id<BMKMapAnimationDelegate> delegate;
83 @property(nonatomic, strong) BMKInterpolator *interpolator;
84 
85 @property(nonatomic, readonly) BOOL isStarted;
86 @property(nonatomic, readonly) BOOL isComplete;
87 
88 - (BOOL)reset;
89 
90 - (BOOL)pause;
91 
92 - (BOOL)resume;
93 
94 - (BOOL)cancel;
95 
96 - (BOOL)start;
97 @end
98 
100 @property(nonatomic, readonly) float fromAlpha;
101 @property(nonatomic, readonly) float toAlpha;
102 
103 - (instancetype)initWithFromAlpha:(float)from to:(float)to;
104 @end
105 
107 @property(nonatomic, readonly) float fromDegrees;
108 @property(nonatomic, readonly) float toDegrees;
109 
110 - (instancetype)initWithFromDegrees:(float)from to:(float)to;
111 @end
112 
115 @property(nonatomic, readonly) CGSize from;
117 @property(nonatomic, readonly) CGSize to;
118 
119 - (instancetype)initWithFromSizeScale:(CGSize)fromSizeScale to:(CGSize)toSizeScale;
120 
121 @end
122 
124 @property(nonatomic, readonly) CLLocationCoordinate2D from;
125 @property(nonatomic, readonly) CLLocationCoordinate2D to;
126 
127 - (instancetype)initWithFromPoint:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to;
128 @end
129 
130 @class BMKPolyline;
131 @class BMKMapTrackAnimation;
133 @protocol BMKMapTrackAnimationDelegate <NSObject>
134 
135 - (void)animation:(nullable BMKMapTrackAnimation *)animation position:(CLLocationCoordinate2D)pt angle:(float)angle fraction:(float)fraction;
136 
137 @end
138 @interface BMKMapTrackAnimation : BMKMapAnimation // 轨迹动画
139 @property(nonatomic, weak) id<BMKMapTrackAnimationDelegate> trackDelegate;
141 @property (nonatomic, readonly) CGFloat fromTrackPosRadio;
142 @property (nonatomic, readonly) CGFloat toTrackPosRadio;
144 @property (nonatomic, readonly) CLLocationCoordinate2D fromTrackPos;
145 @property (nonatomic, readonly) CLLocationCoordinate2D toTrackPos;
146 
148 - (BOOL)setTrackPosRadio:(float)from to:(float)to;
150 - (BOOL)setTrackPosRadio:(float)to;
152 - (BOOL)setTrackPos:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to;
154 - (BOOL)setTrackPos:(CLLocationCoordinate2D)to;
156 - (BOOL)setTrackLine:(BMKPolyline *)trackLine;
157 @end
158 
159 
161 // 添加动画组成员,orderType为动画执行顺序类型,注意:当第一个add的类型是BMKAnimationSetOrderTypeThen时等同于是BMKAnimationSetOrderTypeWith
162 - (void)addAnimation:(BMKMapAnimation *)animation addAnimationSetOrderType:(BMKAnimationSetOrderType)orderType;
163 @end
164 
165 NS_ASSUME_NONNULL_END
BMKAnimationStatusEnd
@ BMKAnimationStatusEnd
Definition: BMKMapAnimation.h:49
BMKMapAnimation::startDelay
NSInteger startDelay
When this Animation should start, in milliseconds from the start time of the root AnimationSet
Definition: BMKMapAnimation.h:77
-[BMKMapAnimation resume]
BOOL resume()
-[BMKMapAnimation pause]
BOOL pause()
BMKMapAnimation::fillMode
BMKAnimationFillMode fillMode
默认BMKAnimationFillAfter
Definition: BMKMapAnimation.h:71
-[BMKMapAnimation reset]
BOOL reset()
BMKMapAnimation::isComplete
BOOL isComplete
Definition: BMKMapAnimation.h:86
BMKAnimationSetOrderTypeThen
@ BMKAnimationSetOrderTypeThen
Definition: BMKMapAnimation.h:58
BMKPolyline
此类用于定义一段折线
Definition: BMKPolyline.h:16
BMKAnimationFillBefore
@ BMKAnimationFillBefore
Definition: BMKMapAnimation.h:20
BMKMapAnimation
Definition: BMKMapAnimation.h:70
BMKAnimationRepeatRestart
@ BMKAnimationRepeatRestart
Definition: BMKMapAnimation.h:37
BMKAnimationStatus
BMKAnimationStatus
Definition: BMKMapAnimation.h:47
BMKInterpolator.h
-[BMKMapAnimation cancel]
BOOL cancel()
BMKMapAnimation::repeatCount
NSInteger repeatCount
动画重复次数,不包含默认的一次,默认值为0,动画仅开始执行一次后立即结束;设置为1时,动画开始执行1次后会再重复1次,共2次;设置为负数时,动画将一直执行
Definition: BMKMapAnimation.h:81
BMKMapAnimation::delegate
id< BMKMapAnimationDelegate > delegate
Definition: BMKMapAnimation.h:82
BMKInterpolator
Definition: BMKInterpolator.h:54
BMKMapAnimation::repeatMode
BMKAnimationRepeatMode repeatMode
默认BMKAnimationRepeatRestart
Definition: BMKMapAnimation.h:73
BMKMapAlphaAnimation
Definition: BMKMapAnimation.h:100
BMKMapRotateAnimation
Definition: BMKMapAnimation.h:107
BMKAnimationFillFirst
@ BMKAnimationFillFirst
Definition: BMKMapAnimation.h:24
BMKAnimationReleatReserse
@ BMKAnimationReleatReserse
Definition: BMKMapAnimation.h:42
BMKMapAnimation::duration
NSInteger duration
Definition: BMKMapAnimation.h:79
BMKMapAnimationDelegate-p
动画状态回调
Definition: BMKMapAnimation.h:63
BMKMapTrackAnimation
Definition: BMKMapAnimation.h:139
BMKMapAnimation::isStarted
BOOL isStarted
Definition: BMKMapAnimation.h:85
BMKMapTrackAnimationDelegate-p
动画状态回调
Definition: BMKMapAnimation.h:133
BMKAnimationFillMode
BMKAnimationFillMode
Definition: BMKMapAnimation.h:16
BMKPolyline.h
BMKMapAnimation::extParam
NSString * extParam
Definition: BMKMapAnimation.h:74
BMKAnimationRepeat
@ BMKAnimationRepeat
Definition: BMKMapAnimation.h:50
BMKAnimationSetOrderType
BMKAnimationSetOrderType
Definition: BMKMapAnimation.h:56
BMKAnimationFillAfter
@ BMKAnimationFillAfter
Definition: BMKMapAnimation.h:28
BMKMapAnimation::startTime
NSInteger startTime
Definition: BMKMapAnimation.h:78
BMKAnimationSetOrderTypeWith
@ BMKAnimationSetOrderTypeWith
Definition: BMKMapAnimation.h:57
BMKMapAnimationSet
Definition: BMKMapAnimation.h:161
BMKAnimationStatusStart
@ BMKAnimationStatusStart
Definition: BMKMapAnimation.h:48
BMKMapTranslateAnimation
Definition: BMKMapAnimation.h:124
BMKMapScaleAnimation
Definition: BMKMapAnimation.h:114
BMKAnimationRepeatMode
BMKAnimationRepeatMode
Definition: BMKMapAnimation.h:31
-[BMKMapAnimation start]
BOOL start()
BMKMapAnimation::interpolator
BMKInterpolator * interpolator
Definition: BMKMapAnimation.h:83