@raruto/leaflet-elevation 1.8.9 → 1.9.0
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
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.
|
|
20
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.0/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
|
|
@@ -345,12 +345,16 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
|
|
|
345
345
|
|
|
346
346
|
// "alt" property is generated inside "leaflet"
|
|
347
347
|
if ("alt" in point) point.meta.ele = point.alt;
|
|
348
|
-
|
|
348
|
+
|
|
349
349
|
// "coordinateProperties" property is generated inside "@tmcw/toGeoJSON"
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if("
|
|
353
|
-
if("
|
|
350
|
+
let props = (properties && properties.coordinateProperties) || properties;
|
|
351
|
+
if (props) {
|
|
352
|
+
if("coordTimes" in props) point.meta.time = new Date(Date.parse(props.coordTimes[i]));
|
|
353
|
+
else if("times" in props) point.meta.time = new Date(Date.parse(props.times[i]));
|
|
354
|
+
else if("time" in props) point.meta.time = new Date(Date.parse((typeof props.time === 'object' ? props.time[i] : props.time)));
|
|
355
|
+
if ("heartRates" in props) point.meta.hr = parseInt(props.heartRates[i]);
|
|
356
|
+
else if("heartRate" in props) point.meta.hr = parseInt((typeof props.heartRate === 'object' ? props.heartRate[i] : props.heartRate));
|
|
357
|
+
else if("heart" in props) point.meta.hr = parseInt((typeof props.heart === 'object' ? props.heart[i] : props.heart));
|
|
354
358
|
// TODO: ask to "@tmcw/toGeoJSON" for "cadence" and "temperature" implementation
|
|
355
359
|
}
|
|
356
360
|
|