@raruto/leaflet-elevation 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raruto/leaflet-elevation",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "A Leaflet plugin that allows to add elevation profiles using d3js",
5
5
  "main": "dist/leaflet-elevation.min.js",
6
6
  "module": "src/index.js",
package/src/control.js CHANGED
@@ -17,7 +17,7 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
17
17
  __TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.5.0/dist/togeojson.umd.js',
18
18
  __LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
19
19
  __LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
20
- __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.5/libs/leaflet-distance-marker.min.js',
20
+ __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.6/libs/leaflet-distance-marker.min.js',
21
21
 
22
22
  /*
23
23
  * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
package/src/time.js CHANGED
@@ -56,16 +56,17 @@ Elevation.addInitHook(function() {
56
56
  point.meta.time = new Date(Date.now())
57
57
  }
58
58
  }
59
+ let time = point.meta.time;
59
60
  // Handle timezone offset
60
- if (point.meta.time.getTime() - point.meta.time.getTimezoneOffset() * 60 * 1000 === 0) {
61
- point.meta.time = 0;
61
+ if (time.getTime() - time.getTimezoneOffset() * 60 * 1000 === 0) {
62
+ time = 0;
62
63
  }
63
- return point.meta.time.getTime();
64
+ return time;
64
65
  },
65
66
  update: function(time, i) {
66
67
  this.track_info.time = (this.track_info.time || 0) + Math.abs(this._data[i].time - this._data[i > 0 ? i - 1 : i].time);
67
68
  this._data[i].duration = this.track_info.time;
68
- return new Date(time);
69
+ return time;
69
70
  }
70
71
  });
71
72