Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

getGrade was returning the opposite of what we wanted. Changed

how we were calculating it. Works now.
  • Loading branch information...
commit 78b6a7792d295dd381047344ec8f02b6c2e8cb33 1 parent 66d87ff
@grobot grobot authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  geolib.js
View
2  geolib.js
@@ -728,7 +728,7 @@
getGrade: function(coords, digits) {
var keys = geolib.getKeys(coords[0]);
var elevation = keys.elevation;
- var rise = coords[coords.length-1][elevation] - coords[0][elevation];
+ var rise = coords[0][elevation] - coords[coords.length-1][elevation];
var run = geolib.getPathLength(coords);
var grade = (rise/run)*100;
if (typeof digits === "number") {
Please sign in to comment.
Something went wrong with that request. Please try again.