From: Robert Kaiser Date: Fri, 7 Nov 2014 01:56:26 +0000 (+0100) Subject: do not count segment jumps in track length and duration X-Git-Tag: producution~22 X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=8f63227ba50180ec312ec822c09bb789fb0be3f2;p=lantea.git do not count segment jumps in track length and duration --- diff --git a/js/map.js b/js/map.js index f9ce632..f6b9d86 100644 --- a/js/map.js +++ b/js/map.js @@ -745,7 +745,9 @@ function calcTrackDuration() { var tDuration = 0; if (gTrack.length > 1) { for (var i = 1; i < gTrack.length; i++) { - tDuration += (gTrack[i].time - gTrack[i-1].time); + if (!gTrack[i].beginSegment) { + tDuration += (gTrack[i].time - gTrack[i-1].time); + } } } return Math.round(tDuration / 1000); // The timestamps are in ms but we return seconds. @@ -756,7 +758,9 @@ function calcTrackLength() { var tLength = 0; if (gTrack.length > 1) { for (var i = 1; i < gTrack.length; i++) { - tLength += getPointDistance(gTrack[i-1].coords, gTrack[i].coords); + if (!gTrack[i].beginSegment) { + tLength += getPointDistance(gTrack[i-1].coords, gTrack[i].coords); + } } } return tLength; diff --git a/manifest.appcache b/manifest.appcache index 64cfc96..1726e68 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2014-11-02 +# 2014-11-06 index.html manifest.webapp js/map.js