@raruto/leaflet-elevation 1.8.6 → 1.8.7
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/README.md +1 -1
- package/dist/leaflet-elevation.js +120 -120
- package/dist/leaflet-elevation.js.map +1 -1
- package/dist/leaflet-elevation.min.js +2 -2
- package/dist/leaflet-elevation.min.js.map +1 -1
- package/package.json +1 -1
- package/src/control.js +63 -55
- package/src/index.js +10 -8
package/README.md
CHANGED
|
@@ -258,7 +258,7 @@ _Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui), [QGIS Inte
|
|
|
258
258
|
**Compatibile with:**
|
|
259
259
|
[](http://leafletjs.com/reference.html)
|
|
260
260
|
[](https://www.npmjs.com/package/d3)
|
|
261
|
-
[](https://www.npmjs.com/package/@tmcw/togeojson)
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
---
|
|
@@ -1790,10 +1790,10 @@
|
|
|
1790
1790
|
__mileFactor: 0.621371,
|
|
1791
1791
|
__footFactor: 3.28084,
|
|
1792
1792
|
__D3: 'https://unpkg.com/d3@6.5.0/dist/d3.min.js',
|
|
1793
|
-
__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.
|
|
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.
|
|
1796
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.7/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
|
|
@@ -2110,6 +2110,10 @@
|
|
|
2110
2110
|
if (!d) {
|
|
2111
2111
|
return;
|
|
2112
2112
|
}
|
|
2113
|
+
/**
|
|
2114
|
+
* Standard GeoJSON --> doesn't handle "time", "heart", …
|
|
2115
|
+
*/
|
|
2116
|
+
|
|
2113
2117
|
|
|
2114
2118
|
var geom = d.geometry;
|
|
2115
2119
|
|
|
@@ -2137,47 +2141,47 @@
|
|
|
2137
2141
|
return _this5._addData(feature);
|
|
2138
2142
|
});
|
|
2139
2143
|
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Extended GeoJSON --> rely on leaflet implementation
|
|
2146
|
+
*/
|
|
2147
|
+
|
|
2140
2148
|
|
|
2141
2149
|
if (d._latlngs) {
|
|
2142
|
-
this.
|
|
2150
|
+
this._addGeoJSONData(d._latlngs, d.feature && d.feature.properties);
|
|
2143
2151
|
}
|
|
2144
2152
|
},
|
|
2145
2153
|
|
|
2146
2154
|
/*
|
|
2147
2155
|
* Parsing of GeoJSON data lines and their elevation in z-coordinate
|
|
2148
2156
|
*/
|
|
2149
|
-
_addGeoJSONData: function _addGeoJSONData(coords) {
|
|
2157
|
+
_addGeoJSONData: function _addGeoJSONData(coords, properties) {
|
|
2150
2158
|
var _this6 = this;
|
|
2151
2159
|
|
|
2152
|
-
|
|
2153
|
-
|
|
2160
|
+
coords.forEach(function (point, i) {
|
|
2161
|
+
var _point$meta, _point$lat, _point$lng, _ref, _point$alt;
|
|
2154
2162
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2163
|
+
// Inspired by L.GPX layer properties
|
|
2164
|
+
point.meta = (_point$meta = point.meta) !== null && _point$meta !== void 0 ? _point$meta : {
|
|
2165
|
+
time: null,
|
|
2166
|
+
ele: null,
|
|
2167
|
+
hr: null,
|
|
2168
|
+
cad: null,
|
|
2169
|
+
atemp: null
|
|
2170
|
+
}; // "alt" property is generated inside "leaflet"
|
|
2160
2171
|
|
|
2161
|
-
|
|
2162
|
-
coords: coords,
|
|
2163
|
-
index: this._data.length - 1
|
|
2164
|
-
});
|
|
2165
|
-
},
|
|
2172
|
+
if ("alt" in point) point.meta.ele = point.alt; // "coordinateProperties" property is generated inside "@tmcw/toGeoJSON"
|
|
2166
2173
|
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
each(coords, function (point) {
|
|
2174
|
-
var _point$alt;
|
|
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
|
|
2178
|
+
}
|
|
2175
2179
|
|
|
2176
|
-
|
|
2180
|
+
_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]);
|
|
2177
2181
|
|
|
2178
|
-
|
|
2182
|
+
_this6._fireEvt("elepoint_added", {
|
|
2179
2183
|
point: point,
|
|
2180
|
-
index:
|
|
2184
|
+
index: _this6._data.length - 1
|
|
2181
2185
|
});
|
|
2182
2186
|
});
|
|
2183
2187
|
|
|
@@ -2192,9 +2196,9 @@
|
|
|
2192
2196
|
*/
|
|
2193
2197
|
_addPoint: function _addPoint(x, y, z) {
|
|
2194
2198
|
if (this.options.reverseCoords) {
|
|
2195
|
-
var
|
|
2196
|
-
x =
|
|
2197
|
-
y =
|
|
2199
|
+
var _ref2 = [y, x];
|
|
2200
|
+
x = _ref2[0];
|
|
2201
|
+
y = _ref2[1];
|
|
2198
2202
|
}
|
|
2199
2203
|
|
|
2200
2204
|
this._data.push({
|
|
@@ -2237,35 +2241,43 @@
|
|
|
2237
2241
|
}
|
|
2238
2242
|
}
|
|
2239
2243
|
},
|
|
2244
|
+
|
|
2245
|
+
/**
|
|
2246
|
+
* Initialize "L.AlmostOver" integration
|
|
2247
|
+
*/
|
|
2240
2248
|
_initAlmostOverHandler: function _initAlmostOverHandler(map, layer) {
|
|
2241
|
-
var
|
|
2249
|
+
var _this7 = this;
|
|
2242
2250
|
|
|
2243
2251
|
if (!map || !this.options.almostOver) return;
|
|
2244
2252
|
this.lazyLoad(this.__LGEOMUTIL).then(function () {
|
|
2245
|
-
return
|
|
2253
|
+
return _this7.lazyLoad(_this7.__LALMOSTOVER);
|
|
2246
2254
|
}).then(function () {
|
|
2247
2255
|
map.addHandler('almostOver', L.Handler.AlmostOver);
|
|
2248
2256
|
|
|
2249
2257
|
if (L.GeometryUtil && map.almostOver && map.almostOver.enabled()) {
|
|
2250
2258
|
map.almostOver.addLayer(layer);
|
|
2251
2259
|
map.on('almost:move', function (e) {
|
|
2252
|
-
return
|
|
2260
|
+
return _this7._mousemoveLayerHandler(e);
|
|
2253
2261
|
}).on('almost:out', function (e) {
|
|
2254
|
-
return
|
|
2262
|
+
return _this7._mouseoutHandler(e);
|
|
2255
2263
|
});
|
|
2256
2264
|
}
|
|
2257
2265
|
});
|
|
2258
2266
|
},
|
|
2267
|
+
|
|
2268
|
+
/**
|
|
2269
|
+
* Initialize "L.DistanceMarkers" integration
|
|
2270
|
+
*/
|
|
2259
2271
|
_initDistanceMarkers: function _initDistanceMarkers(map, layer) {
|
|
2260
|
-
var
|
|
2272
|
+
var _this8 = this;
|
|
2261
2273
|
|
|
2262
2274
|
if (!map) return;
|
|
2263
2275
|
|
|
2264
2276
|
if (this.options.distanceMarkers) {
|
|
2265
2277
|
this.lazyLoad(this.__LGEOMUTIL).then(function () {
|
|
2266
|
-
return
|
|
2278
|
+
return _this8.lazyLoad(_this8.__LDISTANCEM);
|
|
2267
2279
|
}).then(function () {
|
|
2268
|
-
return
|
|
2280
|
+
return _this8.options.polyline && layer.addTo(map);
|
|
2269
2281
|
});
|
|
2270
2282
|
} else if (this.options.polyline) {
|
|
2271
2283
|
layer.addTo(map);
|
|
@@ -2292,6 +2304,29 @@
|
|
|
2292
2304
|
return this.eleDiv = eleDiv;
|
|
2293
2305
|
},
|
|
2294
2306
|
|
|
2307
|
+
/**
|
|
2308
|
+
* Initialize "L.AlmostOver" and "L.DistanceMarkers"
|
|
2309
|
+
*/
|
|
2310
|
+
_initMapIntegrations: function _initMapIntegrations(control, layer) {
|
|
2311
|
+
var map = control._map;
|
|
2312
|
+
|
|
2313
|
+
if (control._map) {
|
|
2314
|
+
map.once('layeradd', function (e) {
|
|
2315
|
+
return control.options.autofitBounds && control.fitBounds(layer.getBounds());
|
|
2316
|
+
});
|
|
2317
|
+
|
|
2318
|
+
if (!L.Browser.mobile) {
|
|
2319
|
+
control._initAlmostOverHandler(map, layer);
|
|
2320
|
+
|
|
2321
|
+
control._initDistanceMarkers(map, layer);
|
|
2322
|
+
} else if (control.options.polyline) {
|
|
2323
|
+
layer.addTo(map);
|
|
2324
|
+
}
|
|
2325
|
+
} else {
|
|
2326
|
+
console.warn("Undefined elevation map object");
|
|
2327
|
+
}
|
|
2328
|
+
},
|
|
2329
|
+
|
|
2295
2330
|
/*
|
|
2296
2331
|
* Collapse current chart control.
|
|
2297
2332
|
*/
|
|
@@ -2343,17 +2378,17 @@
|
|
|
2343
2378
|
* @link https://github.com/Raruto/leaflet-elevation/issues/81#issuecomment-713477050
|
|
2344
2379
|
*/
|
|
2345
2380
|
_fixTooltipSize: function _fixTooltipSize() {
|
|
2346
|
-
var
|
|
2381
|
+
var _this9 = this;
|
|
2347
2382
|
|
|
2348
2383
|
this.on('elechart_init', function () {
|
|
2349
|
-
return
|
|
2350
|
-
if (
|
|
2351
|
-
|
|
2384
|
+
return _this9.once('elechart_change elechart_hover', function (e) {
|
|
2385
|
+
if (_this9._chartEnabled) {
|
|
2386
|
+
_this9._chart._showDiagramIndicator(e.data, e.xCoord);
|
|
2352
2387
|
|
|
2353
|
-
|
|
2388
|
+
_this9._chart._showDiagramIndicator(e.data, e.xCoord);
|
|
2354
2389
|
}
|
|
2355
2390
|
|
|
2356
|
-
|
|
2391
|
+
_this9._updateMarker(e.data);
|
|
2357
2392
|
});
|
|
2358
2393
|
});
|
|
2359
2394
|
},
|
|
@@ -2434,17 +2469,17 @@
|
|
|
2434
2469
|
this._fireEvt("elechart_init");
|
|
2435
2470
|
},
|
|
2436
2471
|
_initLayer: function _initLayer() {
|
|
2437
|
-
var
|
|
2472
|
+
var _this10 = this;
|
|
2438
2473
|
|
|
2439
2474
|
this._layers.on('layeradd layerremove', function (e) {
|
|
2440
2475
|
var layer = e.layer;
|
|
2441
2476
|
var node = layer.getElement && layer.getElement();
|
|
2442
2477
|
|
|
2443
|
-
toggleClass(node,
|
|
2478
|
+
toggleClass(node, _this10.options.polyline.className + ' ' + _this10.options.theme, e.type == 'layeradd');
|
|
2444
2479
|
|
|
2445
|
-
toggleEvent(layer, "mousemove",
|
|
2480
|
+
toggleEvent(layer, "mousemove", _this10._mousemoveLayerHandler.bind(_this10), e.type == 'layeradd');
|
|
2446
2481
|
|
|
2447
|
-
toggleEvent(layer, "mouseout",
|
|
2482
|
+
toggleEvent(layer, "mouseout", _this10._mouseoutHandler.bind(_this10), e.type == 'layeradd');
|
|
2448
2483
|
});
|
|
2449
2484
|
},
|
|
2450
2485
|
_initMarker: function _initMarker(map) {
|
|
@@ -2516,15 +2551,15 @@
|
|
|
2516
2551
|
* Retrieve data from a remote url (HTTP).
|
|
2517
2552
|
*/
|
|
2518
2553
|
_loadFile: function _loadFile(url) {
|
|
2519
|
-
var
|
|
2554
|
+
var _this11 = this;
|
|
2520
2555
|
|
|
2521
2556
|
fetch(url).then(function (response) {
|
|
2522
2557
|
return response.text();
|
|
2523
2558
|
}).then(function (data) {
|
|
2524
|
-
|
|
2559
|
+
_this11._downloadURL = url; // TODO: handle multiple urls?
|
|
2525
2560
|
|
|
2526
|
-
|
|
2527
|
-
return geojson &&
|
|
2561
|
+
_this11._parseFromString(data).then(function (geojson) {
|
|
2562
|
+
return geojson && _this11._loadLayer(geojson);
|
|
2528
2563
|
});
|
|
2529
2564
|
}).catch(function (err) {
|
|
2530
2565
|
return console.warn(err);
|
|
@@ -2596,53 +2631,16 @@
|
|
|
2596
2631
|
}
|
|
2597
2632
|
},
|
|
2598
2633
|
onEachFeature: function onEachFeature(feature, layer) {
|
|
2599
|
-
if (feature.geometry && feature.geometry.type
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
point.meta = {
|
|
2606
|
-
time: null,
|
|
2607
|
-
ele: null,
|
|
2608
|
-
hr: null,
|
|
2609
|
-
cad: null,
|
|
2610
|
-
atemp: null
|
|
2611
|
-
};
|
|
2612
|
-
if ("alt" in point) point.meta.ele = point.alt;
|
|
2613
|
-
|
|
2614
|
-
if (feature.properties) {
|
|
2615
|
-
var prop = feature.properties;
|
|
2616
|
-
if ("coordTimes" in prop) point.meta.time = new Date(Date.parse(prop.coordTimes[i]));else if ("times" in prop) point.meta.time = new Date(Date.parse(prop.times[i]));else if ("time" in prop) point.meta.time = new Date(Date.parse(_typeof(prop.time) === 'object' ? prop.time[i] : prop.time));
|
|
2617
|
-
if ("heartRates" in prop) point.meta.hr = parseInt(prop.heartRates[i]);else if ("heartRate" in prop) point.meta.hr = parseInt(_typeof(prop.heartRate) === 'object' ? prop.heartRate[i] : prop.heartRate); // TODO: cadence, temperature
|
|
2618
|
-
}
|
|
2619
|
-
});
|
|
2620
|
-
|
|
2621
|
-
control.addData(layer); // NB make use of "_addGPXData"
|
|
2622
|
-
|
|
2623
|
-
control.track_info = L.extend({}, control.track_info, {
|
|
2624
|
-
name: geojson.name
|
|
2625
|
-
});
|
|
2634
|
+
if (feature.geometry && feature.geometry.type != 'Point') {
|
|
2635
|
+
control.addData(layer);
|
|
2636
|
+
control.track_info = L.extend({}, control.track_info, {
|
|
2637
|
+
name: geojson.name
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2626
2640
|
}
|
|
2627
2641
|
});
|
|
2628
2642
|
control.lazyLoad(control.__D3).then(function () {
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
if (map) {
|
|
2632
|
-
map.once('layeradd', function (e) {
|
|
2633
|
-
return control.options.autofitBounds && control.fitBounds(layer.getBounds());
|
|
2634
|
-
});
|
|
2635
|
-
|
|
2636
|
-
if (!L.Browser.mobile) {
|
|
2637
|
-
control._initAlmostOverHandler(map, layer);
|
|
2638
|
-
|
|
2639
|
-
control._initDistanceMarkers(map, layer);
|
|
2640
|
-
} else if (control.options.polyline) {
|
|
2641
|
-
layer.addTo(map);
|
|
2642
|
-
}
|
|
2643
|
-
} else {
|
|
2644
|
-
console.warn("Undefined elevation map object");
|
|
2645
|
-
}
|
|
2643
|
+
control._initMapIntegrations(control, layer);
|
|
2646
2644
|
|
|
2647
2645
|
control._fireEvt("eledata_loaded", {
|
|
2648
2646
|
data: geojson,
|
|
@@ -2748,21 +2746,21 @@
|
|
|
2748
2746
|
* Attempt to parse raw response data (GeoJSON or XML > GeoJSON)
|
|
2749
2747
|
*/
|
|
2750
2748
|
_parseFromString: function _parseFromString(data) {
|
|
2751
|
-
var
|
|
2749
|
+
var _this12 = this;
|
|
2752
2750
|
|
|
2753
2751
|
return new Promise(function (resolve) {
|
|
2754
|
-
return
|
|
2752
|
+
return _this12.lazyLoad(_this12.__TOGEOJSON).then(function () {
|
|
2755
2753
|
var geojson;
|
|
2756
2754
|
|
|
2757
2755
|
try {
|
|
2758
|
-
geojson =
|
|
2756
|
+
geojson = _this12._parseFromXMLString(data.trim());
|
|
2759
2757
|
} catch (e) {
|
|
2760
|
-
geojson =
|
|
2758
|
+
geojson = _this12._parseFromGeoJSONString(data.toString());
|
|
2761
2759
|
}
|
|
2762
2760
|
|
|
2763
2761
|
if (geojson) {
|
|
2764
|
-
geojson =
|
|
2765
|
-
geojson =
|
|
2762
|
+
geojson = _this12._prepareMultiLineStrings(geojson);
|
|
2763
|
+
geojson = _this12._prepareAdditionalProperties(geojson);
|
|
2766
2764
|
}
|
|
2767
2765
|
|
|
2768
2766
|
resolve(geojson);
|
|
@@ -2841,10 +2839,10 @@
|
|
|
2841
2839
|
* Add a point of interest over the diagram
|
|
2842
2840
|
*/
|
|
2843
2841
|
_registerCheckPoint: function _registerCheckPoint(props) {
|
|
2844
|
-
var
|
|
2842
|
+
var _this13 = this;
|
|
2845
2843
|
|
|
2846
2844
|
this.on("elechart_updated", function () {
|
|
2847
|
-
return
|
|
2845
|
+
return _this13._chart._registerCheckPoint(props);
|
|
2848
2846
|
});
|
|
2849
2847
|
},
|
|
2850
2848
|
|
|
@@ -2852,10 +2850,10 @@
|
|
|
2852
2850
|
* Add chart profile to diagram
|
|
2853
2851
|
*/
|
|
2854
2852
|
_registerAreaPath: function _registerAreaPath(props) {
|
|
2855
|
-
var
|
|
2853
|
+
var _this14 = this;
|
|
2856
2854
|
|
|
2857
2855
|
this.on("elechart_init", function () {
|
|
2858
|
-
return
|
|
2856
|
+
return _this14._chart._registerAreaPath(props);
|
|
2859
2857
|
});
|
|
2860
2858
|
},
|
|
2861
2859
|
|
|
@@ -2863,10 +2861,10 @@
|
|
|
2863
2861
|
* Add chart grid to diagram
|
|
2864
2862
|
*/
|
|
2865
2863
|
_registerAxisGrid: function _registerAxisGrid(props) {
|
|
2866
|
-
var
|
|
2864
|
+
var _this15 = this;
|
|
2867
2865
|
|
|
2868
2866
|
this.on("elechart_axis", function () {
|
|
2869
|
-
return
|
|
2867
|
+
return _this15._chart._registerAxisGrid(props);
|
|
2870
2868
|
});
|
|
2871
2869
|
},
|
|
2872
2870
|
|
|
@@ -2874,10 +2872,10 @@
|
|
|
2874
2872
|
* Add chart axis to diagram
|
|
2875
2873
|
*/
|
|
2876
2874
|
_registerAxisScale: function _registerAxisScale(props) {
|
|
2877
|
-
var
|
|
2875
|
+
var _this16 = this;
|
|
2878
2876
|
|
|
2879
2877
|
this.on("elechart_axis", function () {
|
|
2880
|
-
return
|
|
2878
|
+
return _this16._chart._registerAxisScale(props);
|
|
2881
2879
|
});
|
|
2882
2880
|
},
|
|
2883
2881
|
|
|
@@ -2885,14 +2883,14 @@
|
|
|
2885
2883
|
* Add chart or marker tooltip info
|
|
2886
2884
|
*/
|
|
2887
2885
|
_registerTooltip: function _registerTooltip(props) {
|
|
2888
|
-
var
|
|
2886
|
+
var _this17 = this;
|
|
2889
2887
|
|
|
2890
2888
|
if (props.chart) {
|
|
2891
2889
|
var label = L.extend({}, props, {
|
|
2892
2890
|
value: props.chart
|
|
2893
2891
|
});
|
|
2894
2892
|
this.on("elechart_init", function () {
|
|
2895
|
-
return
|
|
2893
|
+
return _this17._chart._registerTooltip(label);
|
|
2896
2894
|
});
|
|
2897
2895
|
}
|
|
2898
2896
|
|
|
@@ -2902,7 +2900,7 @@
|
|
|
2902
2900
|
});
|
|
2903
2901
|
|
|
2904
2902
|
this.on("elechart_marker", function () {
|
|
2905
|
-
return
|
|
2903
|
+
return _this17._marker._registerTooltip(_label);
|
|
2906
2904
|
});
|
|
2907
2905
|
}
|
|
2908
2906
|
},
|
|
@@ -2911,10 +2909,10 @@
|
|
|
2911
2909
|
* Add summary info to diagram
|
|
2912
2910
|
*/
|
|
2913
2911
|
_registerSummary: function _registerSummary(props) {
|
|
2914
|
-
var
|
|
2912
|
+
var _this18 = this;
|
|
2915
2913
|
|
|
2916
2914
|
this.on('elechart_summary', function () {
|
|
2917
|
-
return
|
|
2915
|
+
return _this18._summary._registerSummary(props);
|
|
2918
2916
|
});
|
|
2919
2917
|
},
|
|
2920
2918
|
|
|
@@ -3019,7 +3017,7 @@
|
|
|
3019
3017
|
* Toggle chart data on legend click
|
|
3020
3018
|
*/
|
|
3021
3019
|
_toggleChartHandler: function _toggleChartHandler(e) {
|
|
3022
|
-
var
|
|
3020
|
+
var _this19 = this;
|
|
3023
3021
|
|
|
3024
3022
|
var path = e.path,
|
|
3025
3023
|
name = e.name,
|
|
@@ -3029,7 +3027,7 @@
|
|
|
3029
3027
|
this._layers.eachLayer(function (layer) {
|
|
3030
3028
|
var node = layer.getElement && layer.getElement();
|
|
3031
3029
|
|
|
3032
|
-
toggleClass(node,
|
|
3030
|
+
toggleClass(node, _this19.options.polyline.className + ' ' + _this19.options.theme, _this19._chartEnabled);
|
|
3033
3031
|
}); // toggle option value (eg. altitude = { 'disabled' || 'disabled' })
|
|
3034
3032
|
|
|
3035
3033
|
|
|
@@ -3103,7 +3101,7 @@
|
|
|
3103
3101
|
* Update chart summary.
|
|
3104
3102
|
*/
|
|
3105
3103
|
_updateSummary: function _updateSummary() {
|
|
3106
|
-
var
|
|
3104
|
+
var _this20 = this;
|
|
3107
3105
|
|
|
3108
3106
|
this._summary.reset();
|
|
3109
3107
|
|
|
@@ -3126,9 +3124,9 @@
|
|
|
3126
3124
|
e.confirm();
|
|
3127
3125
|
}
|
|
3128
3126
|
|
|
3129
|
-
|
|
3130
|
-
downloadLink:
|
|
3131
|
-
confirm: saveFile.bind(
|
|
3127
|
+
_this20._fireEvt('eletrack_download', {
|
|
3128
|
+
downloadLink: _this20.options.downloadLink,
|
|
3129
|
+
confirm: saveFile.bind(_this20, _this20._downloadURL)
|
|
3132
3130
|
});
|
|
3133
3131
|
};
|
|
3134
3132
|
}
|
|
@@ -3851,6 +3849,8 @@
|
|
|
3851
3849
|
this.loadGeoJSON = this.load;
|
|
3852
3850
|
this.loadXML = this.load;
|
|
3853
3851
|
this.loadFile = this.load;
|
|
3852
|
+
this._addGPXData = this._addGeoJSONData;
|
|
3853
|
+
this._registerFocusLabel = this._registerTooltip;
|
|
3854
3854
|
});
|
|
3855
3855
|
|
|
3856
3856
|
L.control.elevation = function (options) {
|