-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
track.speed_min is always 0 #208
Comments
Maybe I found a solution. Change leaflet-elevation/src/utils.js Lines 135 to 136 in 3ee745d
to export const iMin = (iVal, min = +Infinity, idx = 1) => (idx > 1) ? (iVal < min ? iVal : min) : min;
export const iAvg = (iVal, avg = 0, idx = 1) => (iVal && idx > 1) ? (( iVal + avg * (idx - 1))) / idx : avg * (idx - 1) / idx; I will made a pull request, when I'm ready. |
Hi hupe, Even better, if you can write some tests that show the correctness of what you say: leaflet-elevation/package.json Line 10 in 3ee745d
leaflet-elevation/spec/utils.test.js Lines 9 to 23 in 3ee745d
|
You can see this in your example for the 2016 Santa Rosa Marathon. When you run you don't pause, you always move. But the minimum speed is 0. I have to recap my tests, please be patient. |
You should check the instant |
Patch released in version 2.2.8 |
Hi Raruto,
I have found that the minimum speed is always 0. The cause seems to be here:
leaflet-elevation/src/handlers/speed.js
Lines 18 to 22 in 3ee745d
See your example.
I tried different things, but I can't solve the problem. Can you help me please?
Thank you very much.
The text was updated successfully, but these errors were encountered: