本文介绍图形动画

先上代码

/* arcgis动画计算参数
*  graphic 动画图形
*  paths   动画轨迹路径
*/ 
let animate = function(pointGraphic,paths,line){
    this.line   = line;
    this.timer  = null;
    this.paths  = paths;                     //路径
    this.index  = 0;                         //像素帧下标
    this.speed  = 60;                        //速度
    this.status = 0;                         //状态   // 0 停止  // 1 运动
    this._animate      = [];                 //监听动画的事件集
    this.pointGraphic  = pointGraphic;       //唯一像素图片
    this.analysisPaths = [];                 //像素帧
    this.init.apply(this,arguments);
}

animate.prototype = {
    // 初始化函数
    init (param){
        // 开始处理分析路径
        this.analysisPath()
    },

// 开始动画
play (index){
    debugger;
    if( this.status == 1 ){
        return //禁止重复播放
    }
    this.status = 1;
    index && ( this.index = index )
    this.animate();
},

// 暂停动画
此内容 登录注册 后可见
说点什么吧...