Explorar o código

fix displayed values

subDesTagesMitExtraKaese %!s(int64=2) %!d(string=hai) anos
pai
achega
e4ebcdaabc
Modificáronse 2 ficheiros con 2 adicións e 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;