【高德地圖SDK】如何?軌跡平滑移動?

來源:互聯網
上載者:User

標籤:

很多人應該都有類似的經曆,叫完車,想看看車離我還有多遠距離?但手機螢幕上的車不是一動不動,就是一跳一跳的漂移。

目前市面上大多產品“軌跡平滑移動”做的並不好。

市面上只有快的打車和一號專車實現了平滑移動,那麼這是怎麼做的呢?



-------------------------------------------------------------------------------------------------------

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】如何?軌跡平滑移動?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.