支持动态筛选路线 并 计算 最高 及 平均 速度

This commit is contained in:
Shikong 2023-05-18 16:04:14 +08:00
parent 76dcedce51
commit 380fbbe67c

View File

@ -250,8 +250,13 @@ function toggleTraffic() {
function changeShowLines(){
console.log("options.showLines",options.showLines)
console.log("view.lines",view.lines)
drawMarkers(map,data,options,view.lines.filter((_,index)=>options.showLines.includes(index)))
drawLines(map,data,view.lines.filter((_,index)=>options.showLines.includes(index)))
let showLines = view.lines.filter((_,index)=>options.showLines.includes(index))
drawMarkers(map,data,options,showLines)
drawLines(map,data,showLines)
view.speed.max = (getMaxSpeed(showLines.flat()) * 3.6).toFixed(2);
view.speed.avg = (getAvgSpeed(showLines.flat()) * 3.6).toFixed(2);
}
AMapLoader.load({