標籤:
很多人應該都有類似的經曆,叫完車,想看看車離我還有多遠距離?但手機螢幕上的車不是一動不動,就是一跳一跳的漂移。
目前市面上大多產品“軌跡平滑移動”做的並不好。
市面上只有快的打車和一號專車實現了平滑移動,那麼這是怎麼做的呢?
-------------------------------------------------------------------------------------------------------
iOS軌跡平滑
點擊,查看Demo及原始碼
iOS_MovingAnnotation_Demo
annotation移動及轉向動畫 -查看Demo請開啟test.xcworkspace檔案
使用教程
- 添加MovingAnnotationSource檔案夾內代碼
- 使用介面
/*! @brief 添加動畫 @param points 軌跡點串,每個軌跡點為TracingPoint類型 @param duration 動畫時間長度,包括從上一個動畫的終止點過渡到新增動畫起始點的時間 */- (void)addTrackingAnimationForPoints:(NSArray *)points duration:(CFTimeInterval)duration;
其中,軌跡點類型為:
@interface TracingPoint : NSObject/*! @brief 軌跡經緯度 */@property (nonatomic) CLLocationCoordinate2D coordinate;/*! @brief 方向,有效範圍0~359.9度 */@property (nonatomic) CLLocationDirection course;@end
註:多次調用添加動畫介面,會按調用順序依次執行添加的動畫。 詳見工程test檔案夾。
點擊,查看Demo及原始碼
-------------------------------------------------------------------------------------------------------
Android軌跡平滑
點擊,查看Demo及原始碼
Android_Move_Example
基於高德地圖3D API做的點平滑移動效果
點擊,查看Demo及原始碼
【高德地圖SDK】如何?軌跡平滑移動?