Skip to content

Commit da2047f

Browse files
fixed bug in altitude graph logic
1 parent cb57ad6 commit da2047f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 32
2+
# version 33
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

js/tracker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,8 @@ function addPosition(position) {
734734
// if vehicle is not a car, record altitude
735735
if(vehicle.vehicle_type != "car") {
736736
// only record altitude values in 10minute interval
737-
if(convert_time(vehicle.curr_position.gps_time) - vehicle.alt_last >= 600000) { // 600000ms = 10minutes
737+
if(convert_time(vehicle.curr_position.gps_time) - vehicle.alt_last >= 150) { // 150s = 2.5minutes
738+
vehicle.alt_last = convert_time(vehicle.curr_position.gps_time);
738739
var alt = parseInt(vehicle.curr_position.gps_alt);
739740

740741
if(alt > vehicle.alt_max) vehicle.alt_max = alt; // larged value in the set is required for encoding later
@@ -1023,7 +1024,6 @@ function update(response) {
10231024
// limit the zoom level to 11
10241025
if(map.getZoom() > 11) map.setZoom(11);
10251026
}
1026-
console.log(i);
10271027

10281028
// pan and follow the vehicle
10291029
followVehicle(i);

0 commit comments

Comments
 (0)