@raruto/leaflet-elevation 1.8.8 → 1.9.1

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.
@@ -1793,7 +1793,7 @@
1793
1793
  __TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.5.0/dist/togeojson.umd.js',
1794
1794
  __LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
1795
1795
  __LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
1796
- __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.8/libs/leaflet-distance-marker.min.js',
1796
+ __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.1/libs/leaflet-distance-marker.min.js',
1797
1797
 
1798
1798
  /*
1799
1799
  * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
@@ -2171,10 +2171,11 @@
2171
2171
 
2172
2172
  if ("alt" in point) point.meta.ele = point.alt; // "coordinateProperties" property is generated inside "@tmcw/toGeoJSON"
2173
2173
 
2174
- if (properties.coordinateProperties) {
2175
- var props = properties.coordinateProperties;
2176
- if ("times" in props) point.meta.time = new Date(Date.parse(props.times[i]));
2177
- if ("heart" in props) point.meta.hr = parseInt(props.heart[i]); // TODO: ask to "@tmcw/toGeoJSON" for "cadence" and "temperature" implementation
2174
+ var props = properties && properties.coordinateProperties || properties;
2175
+
2176
+ if (props) {
2177
+ if ("coordTimes" in props) point.meta.time = new Date(Date.parse(props.coordTimes[i]));else if ("times" in props) point.meta.time = new Date(Date.parse(props.times[i]));else if ("time" in props) point.meta.time = new Date(Date.parse(_typeof(props.time) === 'object' ? props.time[i] : props.time));
2178
+ if ("heartRates" in props) point.meta.hr = parseInt(props.heartRates[i]);else if ("heartRate" in props) point.meta.hr = parseInt(_typeof(props.heartRate) === 'object' ? props.heartRate[i] : props.heartRate);else if ("heart" in props) point.meta.hr = parseInt(_typeof(props.heart) === 'object' ? props.heart[i] : props.heart); // TODO: ask to "@tmcw/toGeoJSON" for "cadence" and "temperature" implementation
2178
2179
  }
2179
2180
 
2180
2181
  _this6._addPoint((_point$lat = point.lat) !== null && _point$lat !== void 0 ? _point$lat : point[1], (_point$lng = point.lng) !== null && _point$lng !== void 0 ? _point$lng : point[0], (_ref = (_point$alt = point.alt) !== null && _point$alt !== void 0 ? _point$alt : point.meta.ele) !== null && _ref !== void 0 ? _ref : point[2]);
@@ -3112,19 +3113,20 @@
3112
3113
 
3113
3114
  select('.download a', this._summary._container).onclick = function (e) {
3114
3115
  e.preventDefault();
3116
+ var event = {
3117
+ downloadLink: _this20.options.downloadLink,
3118
+ confirm: saveFile.bind(_this20, _this20._downloadURL)
3119
+ };
3115
3120
 
3116
- if (e.downloadLink == 'modal' && typeof CustomEvent === "function") {
3121
+ if (_this20.options.downloadLink == 'modal' && typeof CustomEvent === "function") {
3117
3122
  document.dispatchEvent(new CustomEvent("eletrack_download", {
3118
- detail: e
3123
+ detail: event
3119
3124
  }));
3120
- } else if (e.downloadLink == 'link' || e.downloadLink === true) {
3121
- e.confirm();
3125
+ } else if (_this20.options.downloadLink == 'link' || _this20.options.downloadLink === true) {
3126
+ event.confirm();
3122
3127
  }
3123
3128
 
3124
- _this20._fireEvt('eletrack_download', {
3125
- downloadLink: _this20.options.downloadLink,
3126
- confirm: saveFile.bind(_this20, _this20._downloadURL)
3127
- });
3129
+ _this20._fireEvt('eletrack_download', event);
3128
3130
  };
3129
3131
  }
3130
3132
  },