@raruto/leaflet-elevation 1.7.3 → 1.7.4
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 +5 -2
- package/dist/leaflet-elevation.js +115 -96
- package/dist/leaflet-elevation.js.map +1 -1
- package/dist/leaflet-elevation.min.js +1 -1
- package/dist/leaflet-elevation.min.js.map +1 -1
- package/libs/leaflet-gpxgroup.js +5 -2
- package/libs/leaflet-gpxgroup.min.js +10 -10
- package/package.json +1 -1
- package/src/control.js +3 -1
- package/src/options.js +1 -0
- package/src/utils.js +33 -19
package/README.md
CHANGED
|
@@ -158,10 +158,10 @@ _For a working example see one of the following demos:_
|
|
|
158
158
|
// Toggle "leaflet-distance-markers" integration
|
|
159
159
|
distanceMarkers: false,
|
|
160
160
|
|
|
161
|
-
// Display track waypoints
|
|
161
|
+
// Display track waypoints: true || "markers" || "dots" || false
|
|
162
162
|
waypoints: true,
|
|
163
163
|
|
|
164
|
-
//
|
|
164
|
+
// Toggle custom waypoint icons: true || { associative array of <sym> tags } || false
|
|
165
165
|
wptIcons: {
|
|
166
166
|
'': L.divIcon({
|
|
167
167
|
className: 'elevation-waypoint-marker',
|
|
@@ -171,6 +171,9 @@ _For a working example see one of the following demos:_
|
|
|
171
171
|
}),
|
|
172
172
|
},
|
|
173
173
|
|
|
174
|
+
// Toggle waypoint labels
|
|
175
|
+
wptLabels: true,
|
|
176
|
+
|
|
174
177
|
// Render chart profiles as Canvas or SVG Paths
|
|
175
178
|
preferCanvas: true
|
|
176
179
|
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
lazy: true
|
|
174
174
|
}, control.options.distanceMarkers);
|
|
175
175
|
var wptIcons = control.options.wptIcons;
|
|
176
|
+
var wptLabels = control.options.wptLabels;
|
|
176
177
|
var layer = L.geoJson(data, {
|
|
177
178
|
distanceMarkers: distanceMarkers,
|
|
178
179
|
style: function style(feature) {
|
|
@@ -185,39 +186,53 @@
|
|
|
185
186
|
return style;
|
|
186
187
|
},
|
|
187
188
|
pointToLayer: function pointToLayer(feature, latlng) {
|
|
189
|
+
var _prop$desc, _prop$name, _prop$sym;
|
|
190
|
+
|
|
188
191
|
if (!control.options.waypoints) return;
|
|
189
192
|
var prop = feature.properties;
|
|
190
|
-
var desc = prop.desc ?
|
|
191
|
-
var name = prop.name ?
|
|
192
|
-
var sym = (prop.sym ?
|
|
193
|
-
|
|
194
|
-
if (!
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
193
|
+
var desc = (_prop$desc = prop.desc) !== null && _prop$desc !== void 0 ? _prop$desc : '';
|
|
194
|
+
var name = (_prop$name = prop.name) !== null && _prop$name !== void 0 ? _prop$name : '';
|
|
195
|
+
var sym = ((_prop$sym = prop.sym) !== null && _prop$sym !== void 0 ? _prop$sym : name).replace(' ', '-').replace('"', '').replace("'", '').toLowerCase(); // Handle waypoint lables (markers and dots)
|
|
196
|
+
|
|
197
|
+
if (!wptLabels) {
|
|
198
|
+
name = '';
|
|
199
|
+
desc = '';
|
|
200
|
+
} // Handle chart waypoints (dots)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
if ([true, "dots"].includes(control.options.waypoints)) {
|
|
204
|
+
control._registerCheckPoint({
|
|
205
|
+
latlng: latlng,
|
|
206
|
+
label: name
|
|
207
|
+
}, true);
|
|
208
|
+
} // Handle map waypoints (markers)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
if ([true, "markers"].includes(control.options.waypoints) && wptIcons != false) {
|
|
212
|
+
// generate and cache appropriate icon symbol
|
|
213
|
+
if (!wptIcons.hasOwnProperty(sym)) {
|
|
214
|
+
wptIcons[sym] = L.divIcon(L.extend({}, wptIcons[""].options, {
|
|
215
|
+
html: '<i class="elevation-waypoint-icon ' + sym + '"></i>'
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
203
218
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
219
|
+
var marker = L.marker(latlng, {
|
|
220
|
+
icon: wptIcons[sym]
|
|
221
|
+
});
|
|
207
222
|
|
|
208
|
-
|
|
223
|
+
if (name || desc) {
|
|
224
|
+
marker.bindPopup("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : '')).openPopup();
|
|
225
|
+
}
|
|
209
226
|
|
|
210
|
-
|
|
211
|
-
latlng: latlng,
|
|
212
|
-
label: name
|
|
213
|
-
}, true);
|
|
227
|
+
control._addMarker(marker);
|
|
214
228
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
229
|
+
control.fire('waypoint_added', {
|
|
230
|
+
point: marker,
|
|
231
|
+
element: latlng,
|
|
232
|
+
properties: prop
|
|
233
|
+
});
|
|
234
|
+
return marker;
|
|
235
|
+
}
|
|
221
236
|
},
|
|
222
237
|
onEachFeature: function onEachFeature(feature, layer) {
|
|
223
238
|
if (feature.geometry && feature.geometry.type == 'Point') return; // Standard GeoJSON
|
|
@@ -2087,6 +2102,7 @@
|
|
|
2087
2102
|
iconAnchor: [8, 30]
|
|
2088
2103
|
})
|
|
2089
2104
|
},
|
|
2105
|
+
wptLabels: true,
|
|
2090
2106
|
xAttr: "dist",
|
|
2091
2107
|
xLabel: "km",
|
|
2092
2108
|
xTicks: undefined,
|
|
@@ -2166,9 +2182,11 @@
|
|
|
2166
2182
|
this._updateChart();
|
|
2167
2183
|
},
|
|
2168
2184
|
_clearChart: function _clearChart() {
|
|
2185
|
+
var _this2 = this;
|
|
2186
|
+
|
|
2169
2187
|
if (this._events && this._events.elechart_updated) {
|
|
2170
2188
|
this._events.elechart_updated.forEach(function (e) {
|
|
2171
|
-
return
|
|
2189
|
+
return _this2.off('elechart_updated', e.fn, e.ctx);
|
|
2172
2190
|
});
|
|
2173
2191
|
}
|
|
2174
2192
|
|
|
@@ -2293,9 +2311,10 @@
|
|
|
2293
2311
|
// this._updateChart = _.debounce(this._updateChart, 300, this);
|
|
2294
2312
|
// this._updateSummary = _.debounce(this._updateSummary, 300, this);
|
|
2295
2313
|
// }
|
|
2296
|
-
// Leaflet canvas renderer colors
|
|
2297
2314
|
|
|
2298
2315
|
|
|
2316
|
+
if (this.options.wptIcons === true) this.options.wptIcons = Options.wptIcons; // Leaflet canvas renderer colors
|
|
2317
|
+
|
|
2299
2318
|
L.extend(Colors, this.options.colors || {});
|
|
2300
2319
|
},
|
|
2301
2320
|
|
|
@@ -2346,14 +2365,14 @@
|
|
|
2346
2365
|
* Load data from a remote url.
|
|
2347
2366
|
*/
|
|
2348
2367
|
loadFile: function loadFile(url) {
|
|
2349
|
-
var
|
|
2368
|
+
var _this3 = this;
|
|
2350
2369
|
|
|
2351
2370
|
fetch(url).then(function (response) {
|
|
2352
2371
|
return response.text();
|
|
2353
2372
|
}).then(function (data) {
|
|
2354
|
-
|
|
2373
|
+
_this3._downloadURL = url; // TODO: handle multiple urls?
|
|
2355
2374
|
|
|
2356
|
-
|
|
2375
|
+
_this3.loadData(data, {
|
|
2357
2376
|
lazy: false,
|
|
2358
2377
|
defer: false
|
|
2359
2378
|
});
|
|
@@ -2380,7 +2399,7 @@
|
|
|
2380
2399
|
* Load raw XML data.
|
|
2381
2400
|
*/
|
|
2382
2401
|
loadXML: function loadXML(data) {
|
|
2383
|
-
var
|
|
2402
|
+
var _this4 = this;
|
|
2384
2403
|
|
|
2385
2404
|
Elevation._togeojsonLazyLoader = lazyLoader(this.__TOGEOJSON, typeof toGeoJSON !== 'function' || !this.options.lazyLoadJS, Elevation._togeojsonLazyLoader).then(function () {
|
|
2386
2405
|
var xml = new DOMParser().parseFromString(data, "text/xml");
|
|
@@ -2395,11 +2414,11 @@
|
|
|
2395
2414
|
|
|
2396
2415
|
if (name[0]) {
|
|
2397
2416
|
geojson.name = name[0].innerHTML;
|
|
2398
|
-
} else if (
|
|
2399
|
-
geojson.name =
|
|
2417
|
+
} else if (_this4._downloadURL) {
|
|
2418
|
+
geojson.name = _this4._downloadURL.split('/').pop().split('#')[0].split('?')[0];
|
|
2400
2419
|
}
|
|
2401
2420
|
|
|
2402
|
-
return
|
|
2421
|
+
return _this4.loadGeoJSON(geojson, _this4);
|
|
2403
2422
|
});
|
|
2404
2423
|
},
|
|
2405
2424
|
|
|
@@ -2407,7 +2426,7 @@
|
|
|
2407
2426
|
* Wait for chart container visible before download data.
|
|
2408
2427
|
*/
|
|
2409
2428
|
loadLazy: function loadLazy(data, opts) {
|
|
2410
|
-
var
|
|
2429
|
+
var _this5 = this;
|
|
2411
2430
|
|
|
2412
2431
|
opts = L.extend({}, this.options.loadData, opts);
|
|
2413
2432
|
var elem = opts.lazy.parentNode ? opts.lazy : this.placeholder;
|
|
@@ -2415,10 +2434,10 @@
|
|
|
2415
2434
|
waitHolder(elem).then(function () {
|
|
2416
2435
|
opts.lazy = false;
|
|
2417
2436
|
|
|
2418
|
-
|
|
2437
|
+
_this5.loadData(data, opts);
|
|
2419
2438
|
|
|
2420
|
-
|
|
2421
|
-
return
|
|
2439
|
+
_this5.once('eledata_loaded', function () {
|
|
2440
|
+
return _this5.placeholder.parentNode.removeChild(elem);
|
|
2422
2441
|
});
|
|
2423
2442
|
});
|
|
2424
2443
|
},
|
|
@@ -2428,7 +2447,7 @@
|
|
|
2428
2447
|
* Called on control.addTo(map).
|
|
2429
2448
|
*/
|
|
2430
2449
|
onAdd: function onAdd(map) {
|
|
2431
|
-
var
|
|
2450
|
+
var _this6 = this;
|
|
2432
2451
|
|
|
2433
2452
|
this._map = map;
|
|
2434
2453
|
|
|
@@ -2448,27 +2467,27 @@
|
|
|
2448
2467
|
}
|
|
2449
2468
|
|
|
2450
2469
|
Elevation._d3LazyLoader = lazyLoader(this.__D3, (typeof d3 === "undefined" ? "undefined" : _typeof(d3)) !== 'object' || !this.options.lazyLoadJS, Elevation._d3LazyLoader).then(function () {
|
|
2451
|
-
|
|
2470
|
+
_this6._initButton(container);
|
|
2452
2471
|
|
|
2453
|
-
|
|
2472
|
+
_this6._initChart(container);
|
|
2454
2473
|
|
|
2455
|
-
|
|
2474
|
+
_this6._initSummary(container);
|
|
2456
2475
|
|
|
2457
|
-
|
|
2476
|
+
_this6._initMarker(map);
|
|
2458
2477
|
|
|
2459
|
-
|
|
2478
|
+
_this6._initLayer(map);
|
|
2460
2479
|
|
|
2461
|
-
map.on('zoom viewreset zoomanim',
|
|
2480
|
+
map.on('zoom viewreset zoomanim', _this6._hideMarker, _this6).on('resize', _this6._resetView, _this6).on('resize', _this6._resizeChart, _this6).on('rotate', _this6._rotateMarker, _this6).on('mousedown', _this6._resetDrag, _this6);
|
|
2462
2481
|
|
|
2463
|
-
on(map.getContainer(), 'mousewheel',
|
|
2482
|
+
on(map.getContainer(), 'mousewheel', _this6._resetDrag, _this6);
|
|
2464
2483
|
|
|
2465
|
-
on(map.getContainer(), 'touchstart',
|
|
2484
|
+
on(map.getContainer(), 'touchstart', _this6._resetDrag, _this6);
|
|
2466
2485
|
|
|
2467
|
-
|
|
2486
|
+
_this6.on('eledata_added eledata_loaded', _this6._updateChart, _this6).on('eledata_added eledata_loaded', _this6._updateSummary, _this6);
|
|
2468
2487
|
|
|
2469
|
-
|
|
2488
|
+
_this6._updateChart();
|
|
2470
2489
|
|
|
2471
|
-
|
|
2490
|
+
_this6._updateSummary();
|
|
2472
2491
|
});
|
|
2473
2492
|
return container;
|
|
2474
2493
|
},
|
|
@@ -2513,7 +2532,7 @@
|
|
|
2513
2532
|
* Parsing data either from GPX or GeoJSON and update the diagram data
|
|
2514
2533
|
*/
|
|
2515
2534
|
_addData: function _addData(d) {
|
|
2516
|
-
var
|
|
2535
|
+
var _this7 = this;
|
|
2517
2536
|
|
|
2518
2537
|
if (!d) {
|
|
2519
2538
|
return;
|
|
@@ -2530,7 +2549,7 @@
|
|
|
2530
2549
|
|
|
2531
2550
|
case 'MultiLineString':
|
|
2532
2551
|
each(geom.coordinates, function (coords) {
|
|
2533
|
-
return
|
|
2552
|
+
return _this7._addGeoJSONData(coords);
|
|
2534
2553
|
});
|
|
2535
2554
|
|
|
2536
2555
|
break;
|
|
@@ -2542,7 +2561,7 @@
|
|
|
2542
2561
|
|
|
2543
2562
|
if (d.type === "FeatureCollection") {
|
|
2544
2563
|
each(d.features, function (feature) {
|
|
2545
|
-
return
|
|
2564
|
+
return _this7._addData(feature);
|
|
2546
2565
|
});
|
|
2547
2566
|
}
|
|
2548
2567
|
|
|
@@ -2555,14 +2574,14 @@
|
|
|
2555
2574
|
* Parsing of GeoJSON data lines and their elevation in z-coordinate
|
|
2556
2575
|
*/
|
|
2557
2576
|
_addGeoJSONData: function _addGeoJSONData(coords) {
|
|
2558
|
-
var
|
|
2577
|
+
var _this8 = this;
|
|
2559
2578
|
|
|
2560
2579
|
each(coords, function (point) {
|
|
2561
|
-
|
|
2580
|
+
_this8._addPoint(point[1], point[0], point[2]);
|
|
2562
2581
|
|
|
2563
|
-
|
|
2582
|
+
_this8._fireEvt("elepoint_added", {
|
|
2564
2583
|
point: point,
|
|
2565
|
-
index:
|
|
2584
|
+
index: _this8._data.length - 1
|
|
2566
2585
|
});
|
|
2567
2586
|
});
|
|
2568
2587
|
|
|
@@ -2576,14 +2595,14 @@
|
|
|
2576
2595
|
* Parsing function for GPX data and their elevation in z-coordinate
|
|
2577
2596
|
*/
|
|
2578
2597
|
_addGPXData: function _addGPXData(coords) {
|
|
2579
|
-
var
|
|
2598
|
+
var _this9 = this;
|
|
2580
2599
|
|
|
2581
2600
|
each(coords, function (point) {
|
|
2582
|
-
|
|
2601
|
+
_this9._addPoint(point.lat, point.lng, typeof point.alt !== "undefined" ? point.alt : point.meta.ele);
|
|
2583
2602
|
|
|
2584
|
-
|
|
2603
|
+
_this9._fireEvt("elepoint_added", {
|
|
2585
2604
|
point: point,
|
|
2586
|
-
index:
|
|
2605
|
+
index: _this9._data.length - 1
|
|
2587
2606
|
});
|
|
2588
2607
|
});
|
|
2589
2608
|
|
|
@@ -2734,17 +2753,17 @@
|
|
|
2734
2753
|
this._fireEvt("elechart_init");
|
|
2735
2754
|
},
|
|
2736
2755
|
_initLayer: function _initLayer() {
|
|
2737
|
-
var
|
|
2756
|
+
var _this10 = this;
|
|
2738
2757
|
|
|
2739
2758
|
this._layers.on('layeradd layerremove', function (e) {
|
|
2740
2759
|
var layer = e.layer;
|
|
2741
2760
|
var node = layer.getElement && layer.getElement();
|
|
2742
2761
|
|
|
2743
|
-
toggleClass(node,
|
|
2762
|
+
toggleClass(node, _this10.options.polyline.className + ' ' + _this10.options.theme, e.type == 'layeradd');
|
|
2744
2763
|
|
|
2745
|
-
toggleEvent(layer, "mousemove",
|
|
2764
|
+
toggleEvent(layer, "mousemove", _this10._mousemoveLayerHandler.bind(_this10), e.type == 'layeradd');
|
|
2746
2765
|
|
|
2747
|
-
toggleEvent(layer, "mouseout",
|
|
2766
|
+
toggleEvent(layer, "mouseout", _this10._mouseoutHandler.bind(_this10), e.type == 'layeradd');
|
|
2748
2767
|
});
|
|
2749
2768
|
},
|
|
2750
2769
|
_initMarker: function _initMarker(map) {
|
|
@@ -2918,10 +2937,10 @@
|
|
|
2918
2937
|
* Add a waypoint marker to the diagram
|
|
2919
2938
|
*/
|
|
2920
2939
|
_registerCheckPoint: function _registerCheckPoint(props) {
|
|
2921
|
-
var
|
|
2940
|
+
var _this11 = this;
|
|
2922
2941
|
|
|
2923
2942
|
this.on("elechart_updated", function () {
|
|
2924
|
-
return
|
|
2943
|
+
return _this11._chart._registerCheckPoint(props);
|
|
2925
2944
|
});
|
|
2926
2945
|
},
|
|
2927
2946
|
|
|
@@ -2929,10 +2948,10 @@
|
|
|
2929
2948
|
* Add chart profile to diagram
|
|
2930
2949
|
*/
|
|
2931
2950
|
_registerAreaPath: function _registerAreaPath(props) {
|
|
2932
|
-
var
|
|
2951
|
+
var _this12 = this;
|
|
2933
2952
|
|
|
2934
2953
|
this.on("elechart_init", function () {
|
|
2935
|
-
return
|
|
2954
|
+
return _this12._chart._registerAreaPath(props);
|
|
2936
2955
|
});
|
|
2937
2956
|
},
|
|
2938
2957
|
|
|
@@ -2940,10 +2959,10 @@
|
|
|
2940
2959
|
* Add chart grid to diagram
|
|
2941
2960
|
*/
|
|
2942
2961
|
_registerAxisGrid: function _registerAxisGrid(props) {
|
|
2943
|
-
var
|
|
2962
|
+
var _this13 = this;
|
|
2944
2963
|
|
|
2945
2964
|
this.on("elechart_axis", function () {
|
|
2946
|
-
return
|
|
2965
|
+
return _this13._chart._registerAxisGrid(props);
|
|
2947
2966
|
});
|
|
2948
2967
|
},
|
|
2949
2968
|
|
|
@@ -2951,10 +2970,10 @@
|
|
|
2951
2970
|
* Add chart axis to diagram
|
|
2952
2971
|
*/
|
|
2953
2972
|
_registerAxisScale: function _registerAxisScale(props) {
|
|
2954
|
-
var
|
|
2973
|
+
var _this14 = this;
|
|
2955
2974
|
|
|
2956
2975
|
this.on("elechart_axis", function () {
|
|
2957
|
-
return
|
|
2976
|
+
return _this14._chart._registerAxisScale(props);
|
|
2958
2977
|
});
|
|
2959
2978
|
},
|
|
2960
2979
|
|
|
@@ -2962,14 +2981,14 @@
|
|
|
2962
2981
|
* Add chart or marker tooltip info
|
|
2963
2982
|
*/
|
|
2964
2983
|
_registerFocusLabel: function _registerFocusLabel(props) {
|
|
2965
|
-
var
|
|
2984
|
+
var _this15 = this;
|
|
2966
2985
|
|
|
2967
2986
|
if (props.chart) {
|
|
2968
2987
|
var label = L.extend({}, props, {
|
|
2969
2988
|
value: props.chart
|
|
2970
2989
|
});
|
|
2971
2990
|
this.on("elechart_init", function () {
|
|
2972
|
-
return
|
|
2991
|
+
return _this15._chart._registerFocusLabel(label);
|
|
2973
2992
|
});
|
|
2974
2993
|
}
|
|
2975
2994
|
|
|
@@ -2979,7 +2998,7 @@
|
|
|
2979
2998
|
});
|
|
2980
2999
|
|
|
2981
3000
|
this.on("elechart_marker", function () {
|
|
2982
|
-
return
|
|
3001
|
+
return _this15._marker._registerFocusLabel(_label);
|
|
2983
3002
|
});
|
|
2984
3003
|
}
|
|
2985
3004
|
},
|
|
@@ -2988,10 +3007,10 @@
|
|
|
2988
3007
|
* Add summary info to diagram
|
|
2989
3008
|
*/
|
|
2990
3009
|
_registerSummary: function _registerSummary(props) {
|
|
2991
|
-
var
|
|
3010
|
+
var _this16 = this;
|
|
2992
3011
|
|
|
2993
3012
|
this.on('elechart_summary', function () {
|
|
2994
|
-
return
|
|
3013
|
+
return _this16._summary._registerSummary(props);
|
|
2995
3014
|
});
|
|
2996
3015
|
},
|
|
2997
3016
|
|
|
@@ -3098,7 +3117,7 @@
|
|
|
3098
3117
|
* Toggle chart data on legend click
|
|
3099
3118
|
*/
|
|
3100
3119
|
_toggleChartHandler: function _toggleChartHandler(e) {
|
|
3101
|
-
var
|
|
3120
|
+
var _this17 = this;
|
|
3102
3121
|
|
|
3103
3122
|
var path = e.path,
|
|
3104
3123
|
name = e.name,
|
|
@@ -3108,7 +3127,7 @@
|
|
|
3108
3127
|
this._layers.eachLayer(function (layer) {
|
|
3109
3128
|
var node = layer.getElement && layer.getElement();
|
|
3110
3129
|
|
|
3111
|
-
toggleClass(node,
|
|
3130
|
+
toggleClass(node, _this17.options.polyline.className + ' ' + _this17.options.theme, _this17._chartEnabled);
|
|
3112
3131
|
}); // toggle option value (eg. altitude = { 'disabled' || 'disabled' })
|
|
3113
3132
|
|
|
3114
3133
|
|
|
@@ -3182,7 +3201,7 @@
|
|
|
3182
3201
|
* Update chart summary.
|
|
3183
3202
|
*/
|
|
3184
3203
|
_updateSummary: function _updateSummary() {
|
|
3185
|
-
var
|
|
3204
|
+
var _this18 = this;
|
|
3186
3205
|
|
|
3187
3206
|
this._summary.reset();
|
|
3188
3207
|
|
|
@@ -3197,9 +3216,9 @@
|
|
|
3197
3216
|
select('.download a', this.summaryDiv).onclick = function (e) {
|
|
3198
3217
|
e.preventDefault();
|
|
3199
3218
|
|
|
3200
|
-
|
|
3201
|
-
downloadLink:
|
|
3202
|
-
confirm: saveFile.bind(
|
|
3219
|
+
_this18._fireEvt('eletrack_download', {
|
|
3220
|
+
downloadLink: _this18.options.downloadLink,
|
|
3221
|
+
confirm: saveFile.bind(_this18, _this18._downloadURL)
|
|
3203
3222
|
});
|
|
3204
3223
|
};
|
|
3205
3224
|
}
|
|
@@ -3263,7 +3282,7 @@
|
|
|
3263
3282
|
}
|
|
3264
3283
|
});
|
|
3265
3284
|
this.on('eledata_loaded', function (e) {
|
|
3266
|
-
var
|
|
3285
|
+
var _this19 = this;
|
|
3267
3286
|
|
|
3268
3287
|
var map = this._map;
|
|
3269
3288
|
var layer = e.layer;
|
|
@@ -3274,7 +3293,7 @@
|
|
|
3274
3293
|
}
|
|
3275
3294
|
|
|
3276
3295
|
map.once('layeradd', function (e) {
|
|
3277
|
-
return
|
|
3296
|
+
return _this19.options.autofitBounds && _this19.fitBounds(layer.getBounds());
|
|
3278
3297
|
});
|
|
3279
3298
|
|
|
3280
3299
|
if (L.Browser.mobile) {
|
|
@@ -3283,28 +3302,28 @@
|
|
|
3283
3302
|
// leaflet-geometryutil
|
|
3284
3303
|
Elevation._geomutilLazyLoader = lazyLoader(this.__LGEOMUTIL, typeof L.GeometryUtil !== 'function' || !this.options.lazyLoadJS, Elevation._geomutilLazyLoader).then(function () {
|
|
3285
3304
|
// leaflet-almostover
|
|
3286
|
-
if (
|
|
3287
|
-
Elevation._almostoverLazyLoader = lazyLoader(
|
|
3305
|
+
if (_this19.options.almostOver) {
|
|
3306
|
+
Elevation._almostoverLazyLoader = lazyLoader(_this19.__LALMOSTOVER, typeof L.Handler.AlmostOver !== 'function' || !_this19.options.lazyLoadJS, Elevation._almostoverLazyLoader).then(function () {
|
|
3288
3307
|
map.addHandler('almostOver', L.Handler.AlmostOver);
|
|
3289
3308
|
|
|
3290
3309
|
if (L.GeometryUtil && map.almostOver && map.almostOver.enabled()) {
|
|
3291
3310
|
map.almostOver.addLayer(layer);
|
|
3292
3311
|
map.on('almost:move', function (e) {
|
|
3293
|
-
return
|
|
3312
|
+
return _this19._mousemoveLayerHandler(e);
|
|
3294
3313
|
}).on('almost:out', function (e) {
|
|
3295
|
-
return
|
|
3314
|
+
return _this19._mouseoutHandler(e);
|
|
3296
3315
|
});
|
|
3297
3316
|
}
|
|
3298
3317
|
});
|
|
3299
3318
|
} // leaflet-distance-markers
|
|
3300
3319
|
|
|
3301
3320
|
|
|
3302
|
-
if (
|
|
3303
|
-
Elevation._distanceMarkersLazyLoader = lazyLoader(
|
|
3304
|
-
return
|
|
3321
|
+
if (_this19.options.distanceMarkers) {
|
|
3322
|
+
Elevation._distanceMarkersLazyLoader = lazyLoader(_this19.__LDISTANCEM, typeof L.DistanceMarkers !== 'function' || !_this19.options.lazyLoadJS, Elevation._distanceMarkersLazyLoader).then(function () {
|
|
3323
|
+
return _this19.options.polyline && layer.addTo(map);
|
|
3305
3324
|
});
|
|
3306
3325
|
} else {
|
|
3307
|
-
if (
|
|
3326
|
+
if (_this19.options.polyline) layer.addTo(map);
|
|
3308
3327
|
}
|
|
3309
3328
|
});
|
|
3310
3329
|
}
|