-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPX file support. Use attributes for magic numbers. #2
base: master
Are you sure you want to change the base?
Conversation
i will check the PR asap, thanks :) |
i need a bit more of info on what fix is doing, do you mind give me a small comment on it? |
lib/workout.js
Outdated
var qs = postQueryString(params) | ||
var url = apiUrl + paths.activity.post | ||
|
||
request.post({ url: url, qs: qs }, (err, response, body) => { | ||
if (err || !regex.isOk.test(body)) | ||
{ | ||
console.log(body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this debug line should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, have removed it in my branch.
sportAttr = attributes.sport, | ||
trackAttr = attributes.track | ||
|
||
var EARTH_RADIUS_KM = 6371.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains quite a bit of logic, that i am sure its already done by some package (i think i have used in a different project. If you want we can talk about it or i can look at it to refactor on the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for me to not include this file. There might be packages to get the distance of two coordinates.
The important changes are in workout.js starting at line 59. It's not always necessary to send distance and speed, therefore it must be possible leave it empty. (workoutPoint.latitude ? workoutPoint.latitude.toFixed(8) : '') + ';' + |
I've added a new dependencie to gpx-parse, but I'm not sure if the version is ok. First time I use github and npm package manager. Hoppe you can use some of the modifications.