小车动画 添加时间显示
This commit is contained in:
parent
d760aff6c5
commit
3041432484
@ -40,7 +40,10 @@ export function playAnimation(map,data,line,animateRate,view,itemIndex){
|
|||||||
let lastLocation = e.passedPath[e.passedPath.length - 1];
|
let lastLocation = e.passedPath[e.passedPath.length - 1];
|
||||||
data.infoWindow.setPosition(lastLocation);
|
data.infoWindow.setPosition(lastLocation);
|
||||||
let speed = ((line[index].speed||0) * 3.6).toFixed(2)
|
let speed = ((line[index].speed||0) * 3.6).toFixed(2)
|
||||||
data.infoWindow.setContent(`<div style="width:100px;background: #fff;border-radius: 5px">${speed} km/h</div>`);
|
data.infoWindow.setContent(`<div style="width:180px;background: #fff;border-radius: 5px">
|
||||||
|
<div>${line[index].locationTime}</div>
|
||||||
|
<div>${speed} km/h</div>
|
||||||
|
</div>`);
|
||||||
map.setCenter(e.target.getPosition(),true)
|
map.setCenter(e.target.getPosition(),true)
|
||||||
})
|
})
|
||||||
data.animateMarker.on("moveend",()=>{
|
data.animateMarker.on("moveend",()=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user