Explorar el Código

fix displayed values

subDesTagesMitExtraKaese hace 2 años
padre
commit
e4ebcdaabc
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  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;