Skip to content
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

Changing the speed unit has no effect #18

Closed
claustres opened this issue Nov 16, 2017 · 3 comments
Closed

Changing the speed unit has no effect #18

claustres opened this issue Nov 16, 2017 · 3 comments

Comments

@claustres
Copy link
Contributor

Value is always in m/s and m/s is always displayed in the UI even if the speedUnit: 'kt' option is set.

This is linked to the fact that the merge of PR #8 in commit 38fe1a4 was not completly right, see 38fe1a4#commitcomment-25654602.

The correct code as seen in my fork is the following:

if(gridValue && !isNaN(gridValue[0]) && !isNaN(gridValue[1]) && gridValue[2]) {
  htmlOut = "<strong>"+ this.options.velocityType +" Direction: </strong>"+  self.vectorToDegrees(gridValue[0],gridValue[1],this.options.angleConvention).toFixed(2) + "°" +
            ", <strong>"+ this.options.velocityType +" Speed: </strong>" + self.vectorToSpeed(gridValue[0],gridValue[1],this.options.speedUnit).toFixed(2) + this.options.speedUnit;
}

Since on my side the merge has been correct on my master it is not easy to create a specific PR for this, would you mind reporting it directly in your master branch ?

Thanks.

@SFSailor
Copy link

Good fix. I did an "include" to make this work with my app.

danwild added a commit that referenced this issue Dec 18, 2017
@danwild
Copy link
Contributor

danwild commented Dec 18, 2017

Thanks, fixed in cd565bd.

@danwild danwild closed this as completed Dec 18, 2017
@SFSailor
Copy link

SFSailor commented Dec 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants