Closed hupe13 closed 2 years ago
Hi hupe,
When I change in leaflet-elevation.js the lines 910, 917 and 918 from "map" to "this._map" the error is gone and I get a map with an elevation chart. It looks different than before, but it works.
please make use of line permalinks to src
files when describing an issue (this way anyone reading it now and in the future can understand exactly what you are referring to).
But more errors must exist. Many of the users (including me) have multiple maps on one page, this does not work.
Yep, version 2.x has undergone a lot of code refactoring (and unfortunately I don't have much time to devote to testing). In order to solve this problem faster I suggest you propose yourself a pull that adds an example that loads two maps (that way at least we have some material to work on).
Or the acceleration of my test data is "Infinity" (with version 1.7.6 it is correct).
If I'm not mistaken you are referring to the values calculated by the following functions (if you get infinity I assume that a numerical value is never calculated), essentially these functions iteratively update the max / min value every time a new point is added to the chart (during initial data loading):
To help you in debugging, I point out below the points in the code where they are called:
This last portion creates and assigns the value track_info.acceleration_max
and track_info.acceleration_min
(it may seem convoluted but on this point I have tried to maintain a minimum of compatibility with the nomenclature of the previous versions).
The developer console does not show any errors. And I don't know what could be wrong.
When in doubt, see what your computed data contains (eg. console.log(controlElevation._data);
):
Have a nice day, Raruto
PS anyway take a look at this whole function too because I guess the bug could be hiding in there
Or it's just a matter of wrong logic:
(iVal, max) => (iVal > max ? iVal : max) || -Infinity;
For example:
0 || Infinity
--> Infinity
undefined || Infinity
--> Infinity
But:
0 ?? Infinity
--> 0
undefined ?? Infinity
--> Infinity
When the setting for time
is false, the charts for acceleration and speed do not work, the values are always "0".
I have detected the parameter hotline
, but only false
and "elevation"
work. With "elevation"
the track is nice and colorful. It may be that I don't have the right example for it, but with "slope"
and the others the track is always red .
When the setting for time is false, the charts for acceleration and speed do not work, the values are always "0".
I have detected the parameter hotline, but only false and "elevation" work. With "elevation" the track is nice and colorful. It may be that I don't have the right example for it, but with "slope" and the others the track is always red .
Hi hupe, I don't quite understand what this has to do with the problem described above (please try to open only one issue per problem, otherwise it becomes difficult for everyone to follow the thread)
Have a nice day, Raruto
Sorry, you are right, I will open new issues. When I solved all my problems with version 2.1.0, I will make a pull request, if necessary.
Ok, don't bother asking questions when in doubt 😉
Raruto
Of course I will ask ..., I have many questions (see above).
Hi Raruto,
testing version 2.1.0 I get an error:
When I change in leaflet-elevation.js the lines 910, 917 and 918 from "map" to "this._map" the error is gone and I get a map with an elevation chart. It looks different than before, but it works.
But more errors must exist. Many of the users (including me) have multiple maps on one page, this does not work. Or the acceleration of my test data is "Infinity" (with version 1.7.6 it is correct). The developer console does not show any errors. And I don't know what could be wrong.
Thank you very much.