moveFeature(event){
console.log(event)
let time = event.frameState.time;
this.distance = (this.distance + (this.speed * (time - this.lastTime)) / 1000) % 1;
this.lastTime = time;
const currentCoordinate = this.route.getCoordinateAt(
this.distance > 1 ? 2 - this.distance : this.distance
);
this.geometryMove.setCoordinates(currentCoordinate);
const vectorContext = getVectorContext(e);
vectorContext.setStyle(this.styles.featureMove);
vectorContext.drawGeometry(this.geometryMove);
this.map.render();
},
startAnimation(){
this.lastTime = Date.now();
this.lineLayer.on("postrender",this.moveFeature);
this.featureMove.setGeometry(null);
}
这段代码是在网上看到的,借鉴了一下
运行之后moveFeature这个函数里面的event是undefined不知道怎么回事