浏览代码

fix displayed values

subDesTagesMitExtraKaese 2 年之前
父节点
当前提交
e4ebcdaabc
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      static/gps_logger/js/main.js
  2. 1 1
      static/gps_logger/js/tracks.js

+ 1 - 1
static/gps_logger/js/main.js

@@ -245,7 +245,7 @@ function show(id) {
     overview.draw();
     
     for(let t of gps.trips) {
-      $("#tracks").append("<li><input type='button' onclick='setZoom("+t.startTime*1000+","+t.endTime*1000+")' value='" + timeFormat(t.startTime, "date") + " " + (t.distance/1000).toFixed(1) + "km'</li>");
+      $("#tracks").append(`<li><input type='button' onclick='setZoom(${t.startTime*1000}, ${t.endTime*1000})' value='${timeFormat(t.startTime, "date")} ${t.name} ${(t.distance/1000).toFixed(1)}km'</li>`);
     }
   }
   

+ 1 - 1
static/gps_logger/js/tracks.js

@@ -27,7 +27,7 @@ class GPS {
           lng: median(trip.map(v => v.center.lng)),
           timestamp: median(trip.map(v => v.startTime)),
           distance: dist,
-          name: trip[0].name
+          name: median(trip.map(t => t.name))
         });
       }
       s = i;