百度地圖(38)-GL 動畫


1. 這里說的動畫,可以看做是動畫片,也可以說是軌跡回放,也可以看做類似於ArcGIS的 storyMap。

 

2. 將一系列的點按照一定的順序進行漫游。

 

3. 動畫

 1   var animation = new BMapGL.ViewAnimation(keyFrames, opts);        // 初始化動畫實例
 2   animation.addEventListener('animationstart', function(e) {        // 監聽動畫開始事件
 3     console.log('start');
 4   });
 5   animation.addEventListener('animationiterations', function(e) {   // 監聽動畫迭代事件
 6     console.log('onanimationiterations');
 7   });
 8   animation.addEventListener('animationend', function(e) {        // 監聽動畫結束事件
 9     console.log('end');
10   });
11   animation.addEventListener('animationcancel', function(e) {       // 監聽動畫中途被終止事件
12     console.log('cancel');
13   });
14 
15   map.startViewAnimation(animation);         // 開始播放動畫

 

4. 使用 flyTo  和  panTo 對這些數據點進行操作,其效果都沒有Animation動畫的效果好。

 

5. 頁面顯示

6. 源碼地址

https://github.com/WhatGIS/bdMap


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM