animate : function(frampoint,topoint,speed = 60){
var path = topoint.geometry.paths[0];
var i = 1;
var pathTimer = function(){ //帧数
var zs = 1;
var
//获取经度
lon = frampoint.geometry.x,
//获取纬度
lat = frampoint.geometry.y;
//开始计算差值
_lon = (lon - path[i][0])/60;
_lat = (lat - path[i][1])/60; //保持一分钟60次变化帧数
var zstimer = setInterval(function(){ frampoint.geometry.x -= _lon;
frampoint.geometry.y -= _lat;
this.layer.refresh();
zs ++;
if( zs >= 60 ){
clearInterval(zstimer);
i++;
// zs = 1;
if( path[i] ) {
debugger;
pathTimer();
}
}
}.bind(this),17) // i++;
//
}.bind(this); pathTimer();
}
05-08 15:41