diff options
author | Chris Schlaeger <chris@linux.com> | 2015-10-26 20:22:02 +0100 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2015-10-26 20:22:02 +0100 |
commit | 75b1f25cb1e9d1360aa894e1bfca4df3548f4278 (patch) | |
tree | 6ca6661ad3830ebfa3b0cf9a6f796d3da830721f /lib | |
parent | 5590faccc2c96f5038463685407ea4e468c056c8 (diff) | |
download | postrunner-75b1f25cb1e9d1360aa894e1bfca4df3548f4278.zip |
Fixing track point generation. Bumping version.v0.0.11
Diffstat (limited to 'lib')
-rw-r--r-- | lib/postrunner/TrackView.rb | 12 | ||||
-rw-r--r-- | lib/postrunner/version.rb | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/postrunner/TrackView.rb b/lib/postrunner/TrackView.rb index 56f97c6..79018b5 100644 --- a/lib/postrunner/TrackView.rb +++ b/lib/postrunner/TrackView.rb @@ -86,15 +86,19 @@ EOT # in EPSG:4326. Generate a javascript variable with an Array of track # points. def track_points - "var pr_track_points = [\n" + + points = [] @activity.fit_activity.sessions.map do |session| session.records.map do |record| long = record.position_long lat = record.position_lat next unless long && lat - "[ #{long}, #{lat} ]" - end.join(', ') - end.join(', ') + + + points << "[ #{long}, #{lat} ]" + end + end + + "var pr_track_points = [\n" + + points.join(', ') + "\n];\n" end diff --git a/lib/postrunner/version.rb b/lib/postrunner/version.rb index 2179ea3..9ce33eb 100644 --- a/lib/postrunner/version.rb +++ b/lib/postrunner/version.rb @@ -11,5 +11,5 @@ # module PostRunner - VERSION = "0.0.10" + VERSION = "0.0.11" end |