@raruto/leaflet-elevation 1.9.4 → 2.0.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/README.md +8 -7
- package/dist/leaflet-elevation.css +51 -161
- package/dist/leaflet-elevation.js +1622 -3767
- package/dist/leaflet-elevation.js.map +1 -1
- package/dist/leaflet-elevation.min.css +1 -1
- package/dist/leaflet-elevation.min.js +1 -3
- package/dist/leaflet-elevation.min.js.map +1 -1
- package/images/checkered.png +0 -0
- package/libs/leaflet-distance-marker.js +17 -18
- package/libs/leaflet-distance-marker.min.js +1 -1
- package/libs/leaflet-gpxgroup.js +2 -2
- package/libs/leaflet-ruler.css +42 -0
- package/libs/leaflet-ruler.js +183 -0
- package/libs/leaflet-ruler.min.css +1 -0
- package/libs/leaflet-ruler.min.js +1 -0
- package/package.json +9 -11
- package/src/chart.js +156 -143
- package/src/components.js +55 -76
- package/src/control.js +503 -345
- package/src/handlers/acceleration.js +64 -0
- package/src/handlers/acceleration.min.js +1 -0
- package/src/handlers/altitude.js +76 -0
- package/src/handlers/altitude.min.js +1 -0
- package/src/handlers/cadence.js +54 -0
- package/src/handlers/distance.js +45 -0
- package/src/handlers/distance.min.js +1 -0
- package/src/handlers/heart.js +53 -0
- package/src/handlers/slope.js +79 -0
- package/src/handlers/slope.min.js +1 -0
- package/src/handlers/speed.js +66 -0
- package/src/handlers/speed.min.js +1 -0
- package/src/handlers/time.js +103 -0
- package/src/handlers/time.min.js +1 -0
- package/src/index.css +51 -161
- package/src/index.js +0 -24
- package/src/marker.js +11 -14
- package/src/options.js +20 -28
- package/src/summary.js +14 -4
- package/src/utils.js +74 -102
- package/src/acceleration.js +0 -108
- package/src/altitude.js +0 -120
- package/src/distance.js +0 -78
- package/src/slope.js +0 -113
- package/src/speed.js +0 -110
- package/src/time.js +0 -124
package/README.md
CHANGED
|
@@ -23,23 +23,24 @@ _For a working example see one of the following demos:_
|
|
|
23
23
|
- [loading individual .gpx tracks](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-tracks.html)
|
|
24
24
|
- [loading multiple .gpx tracks (hover to toggle)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hoverable-tracks.html)
|
|
25
25
|
- [loading multiple .gpx tracks (click to toggle)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-charts.html)
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [translating plugin labels (leaflet-i18n)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_i18n-strings.html)
|
|
26
|
+
- [translating plugin labels](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_i18n-strings.html)
|
|
27
|
+
- [using custom colors](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-theme.html)
|
|
28
|
+
- [using .gpx extensions (cadence + heart)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_extended-ui.html)
|
|
30
29
|
- [using .gpx waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_gpx-waypoints.html)
|
|
31
30
|
- [using .geojson waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-waypoints.html)
|
|
32
31
|
|
|
32
|
+
|
|
33
33
|
<br/>
|
|
34
34
|
|
|
35
35
|
- [autohide map](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-map.html)
|
|
36
36
|
- [autohide chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-chart.html)
|
|
37
37
|
- [collapsible button](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_close-button.html)
|
|
38
|
-
- [custom colors](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-theme.html)
|
|
39
38
|
- [custom summary](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-summary.html)
|
|
40
39
|
- [follow marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_follow-marker.html)
|
|
40
|
+
- [layer almostover](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_almost-over.html)
|
|
41
41
|
- [slope chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_slope-chart.html)
|
|
42
42
|
- [speed chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_speed-chart.html)
|
|
43
|
+
- [walking marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_dynamic-runner.html)
|
|
43
44
|
|
|
44
45
|
---
|
|
45
46
|
|
|
@@ -174,7 +175,7 @@ _For a working example see one of the following demos:_
|
|
|
174
175
|
};
|
|
175
176
|
|
|
176
177
|
// Instantiate map (leaflet-ui).
|
|
177
|
-
var map =
|
|
178
|
+
var map = L.map('map', { mapTypeId: 'terrain', center: [41.4583, 12.7059], zoom: 5 });
|
|
178
179
|
|
|
179
180
|
// Instantiate elevation control.
|
|
180
181
|
var controlElevation = L.control.elevation(elevation_options).addTo(map);
|
|
@@ -250,7 +251,7 @@ _Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui), [QGIS Inte
|
|
|
250
251
|
**Compatibile with:**
|
|
251
252
|
[](http://leafletjs.com/reference.html)
|
|
252
253
|
[](https://www.npmjs.com/package/d3)
|
|
253
|
-
[](https://www.npmjs.com/package/@tmcw/togeojson)
|
|
254
255
|
|
|
255
256
|
|
|
256
257
|
---
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.elevation-control.elevation .background {
|
|
31
|
-
background-color: rgba(70, 130, 180, 0.2);
|
|
31
|
+
background-color: var(--ele-bg, rgba(70, 130, 180, 0.2));
|
|
32
32
|
border-radius: 5px;
|
|
33
33
|
overflow: visible;
|
|
34
34
|
display: block;
|
|
@@ -36,15 +36,20 @@
|
|
|
36
36
|
user-select: none;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.elevation-control.elevation .axis .tick,
|
|
40
|
+
.elevation-control.elevation .axis .domain {
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
.elevation-control.elevation .axis line,
|
|
40
45
|
.elevation-control.elevation .axis path {
|
|
41
|
-
stroke: #2D1130;
|
|
46
|
+
stroke: var(--ele-axis, #2D1130);
|
|
42
47
|
stroke-width: 1;
|
|
43
48
|
fill: none;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
.elevation-control.elevation .grid .tick line {
|
|
47
|
-
stroke: #EEE;
|
|
52
|
+
stroke: var(--ele-grid, #EEE);
|
|
48
53
|
stroke-width: 1px;
|
|
49
54
|
shape-rendering: crispEdges;
|
|
50
55
|
}
|
|
@@ -68,14 +73,14 @@
|
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
.elevation-control.elevation .area {
|
|
71
|
-
fill: #4682B4;
|
|
72
|
-
stroke: #000;
|
|
76
|
+
fill: var(--ele-area, #4682B4);
|
|
77
|
+
stroke: var(--ele-stroke, #000);
|
|
73
78
|
stroke-width: 1.2;
|
|
74
79
|
paint-order: stroke fill;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
.elevation-detached .elevation-control.elevation .area {
|
|
78
|
-
fill-opacity: 0.8;
|
|
83
|
+
fill-opacity: var(--ele-alpha, 0.8);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
.elevation-control.elevation .horizontal-drag-line {
|
|
@@ -104,7 +109,7 @@
|
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
.elevation-control.elevation .mouse-focus-line {
|
|
107
|
-
stroke: #
|
|
112
|
+
stroke: #000;
|
|
108
113
|
stroke-width: 1;
|
|
109
114
|
pointer-events: none;
|
|
110
115
|
}
|
|
@@ -128,7 +133,7 @@
|
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
.elevation-control.elevation .brush .selection {
|
|
131
|
-
fill: rgba(23, 74, 117, 0.4);
|
|
136
|
+
fill: var(--ele-brush, rgba(23, 74, 117, 0.4));
|
|
132
137
|
stroke: none;
|
|
133
138
|
fill-opacity: unset;
|
|
134
139
|
}
|
|
@@ -207,7 +212,7 @@
|
|
|
207
212
|
}
|
|
208
213
|
|
|
209
214
|
.elevation-control.elevation .elevation-toggle-icon {
|
|
210
|
-
background: url(../images/elevation.svg) no-repeat center center;
|
|
215
|
+
background: var(--ele-icon, url(../images/elevation-lime.svg)) no-repeat center center;
|
|
211
216
|
}
|
|
212
217
|
|
|
213
218
|
.elevation-control.elevation.elevation-expanded .elevation-toggle-icon.close-button {
|
|
@@ -241,7 +246,7 @@
|
|
|
241
246
|
.leaflet-elevation-pane .height-focus,
|
|
242
247
|
.leaflet-overlay-pane .height-focus {
|
|
243
248
|
stroke: #000;
|
|
244
|
-
fill: #FFF;
|
|
249
|
+
fill: var(--ele-area, #FFF);
|
|
245
250
|
}
|
|
246
251
|
|
|
247
252
|
.leaflet-elevation-pane .height-focus.line,
|
|
@@ -260,200 +265,85 @@
|
|
|
260
265
|
stroke-width: 2px;
|
|
261
266
|
}
|
|
262
267
|
|
|
263
|
-
.elevation-waypoint-icon:before
|
|
264
|
-
|
|
268
|
+
.elevation-waypoint-icon:before,
|
|
269
|
+
.elevation-position-icon:before {
|
|
265
270
|
content: "";
|
|
266
271
|
width: 100%;
|
|
267
272
|
height: 100%;
|
|
268
273
|
display: inline-block;
|
|
269
274
|
}
|
|
270
275
|
|
|
276
|
+
.elevation-waypoint-icon:before {
|
|
277
|
+
background: url(../images/elevation-pushpin.svg) no-repeat center center / contain;
|
|
278
|
+
}
|
|
279
|
+
|
|
271
280
|
.elevation-position-icon:before {
|
|
272
281
|
background: url(../images/elevation-position.svg) no-repeat center center / contain;
|
|
273
|
-
content: "";
|
|
274
|
-
width: 100%;
|
|
275
|
-
height: 100%;
|
|
276
|
-
display: inline-block;
|
|
277
282
|
}
|
|
278
283
|
|
|
279
284
|
.elevation-polyline {
|
|
285
|
+
stroke: var(--ele-poly, var(--ele-area, #000));
|
|
280
286
|
filter: drop-shadow(1px 1px 0 #FFF) drop-shadow(-1px -1px 0 #FFF) drop-shadow(1px -1px 0 #FFF) drop-shadow(-1px 1px 0 #FFF);
|
|
281
287
|
}
|
|
282
288
|
|
|
283
|
-
.elevation-placeholder {
|
|
284
|
-
margin: auto;
|
|
285
|
-
height: auto;
|
|
286
|
-
width: 100%;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.elevation-placeholder~* {
|
|
290
|
-
display: none !important;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
289
|
/* LIME THEME //////////////////////////////////////////////// */
|
|
294
290
|
|
|
295
|
-
.lime-theme
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
.lime-theme.elevation-control.elevation .grid .tick line {
|
|
305
|
-
stroke: #CCC;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.lime-theme.elevation-control.elevation .brush .selection {
|
|
309
|
-
fill: rgba(99, 126, 11, 0.4);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.lime-theme.elevation-control.elevation .elevation-toggle-icon {
|
|
313
|
-
background: url(../images/elevation-lime.svg) no-repeat center center;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.lime-theme.elevation-control.elevation .area {
|
|
317
|
-
fill: #9CC222;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.lime-theme.elevation-control.elevation .mouse-focus-line {
|
|
321
|
-
stroke: #101404;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.lime-theme.height-focus {
|
|
325
|
-
stroke: #000;
|
|
326
|
-
fill: #9CC222;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.lime-theme.elevation-polyline {
|
|
330
|
-
stroke: #566B13;
|
|
291
|
+
.lime-theme {
|
|
292
|
+
--ele-bg: rgba(156, 194, 34, 0.2);
|
|
293
|
+
--ele-axis: #566B13;
|
|
294
|
+
--ele-area: #9CC222;
|
|
295
|
+
--ele-grid: #CCC;
|
|
296
|
+
--ele-brush: rgba(99, 126, 11, 0.4);
|
|
297
|
+
--ele-icon: url(../images/elevation-lime.svg);
|
|
298
|
+
--ele-poly: #566B13;
|
|
331
299
|
}
|
|
332
300
|
|
|
333
301
|
/* STEELBLUE THEME //////////////////////////////////////////////// */
|
|
334
302
|
|
|
335
|
-
.steelblue-theme
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
.steelblue-theme.elevation-control.elevation .axis path {
|
|
341
|
-
stroke: #0D1821;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.steelblue-theme.elevation-control.elevation .brush .selection {
|
|
345
|
-
fill: rgba(23, 74, 117, 0.4);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.steelblue-theme.elevation-control.elevation .elevation-toggle-icon {
|
|
349
|
-
background: url(../images/elevation-steelblue.svg) no-repeat center center;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.steelblue-theme.elevation-control.elevation .area {
|
|
353
|
-
fill: #4682B4;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.steelblue-theme.elevation-control.elevation .mouse-focus-line {
|
|
357
|
-
stroke: #0D1821;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.steelblue-theme.height-focus {
|
|
361
|
-
stroke: #000;
|
|
362
|
-
fill: #4682B4;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.steelblue-theme.elevation-polyline {
|
|
366
|
-
stroke: #4682B4;
|
|
303
|
+
.steelblue-theme {
|
|
304
|
+
--ele-axis: #0D1821;
|
|
305
|
+
--ele-area: #4682B4;
|
|
306
|
+
--ele-brush: rgba(23, 74, 117, 0.4);
|
|
307
|
+
--ele-icon: url(../images/elevation-steelblue.svg);
|
|
367
308
|
}
|
|
368
309
|
|
|
369
310
|
/* PURPLE THEME //////////////////////////////////////////////// */
|
|
370
311
|
|
|
371
|
-
.purple-theme
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
.purple-theme.elevation-control.elevation .axis path {
|
|
377
|
-
stroke: #2D1130;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.purple-theme.elevation-control.elevation .brush .selection {
|
|
381
|
-
fill: rgba(74, 14, 80, 0.4);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.purple-theme.elevation-control.elevation .elevation-toggle-icon {
|
|
385
|
-
background: url(../images/elevation-purple.svg) no-repeat center center;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.purple-theme.elevation-control.elevation .area {
|
|
389
|
-
fill: #732C7B;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.purple-theme.elevation-control.elevation .mouse-focus-line {
|
|
393
|
-
stroke: #000;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.purple-theme.height-focus {
|
|
397
|
-
stroke: #000;
|
|
398
|
-
fill: #732C7B;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.purple-theme.elevation-polyline {
|
|
402
|
-
stroke: #732C7B;
|
|
312
|
+
.purple-theme {
|
|
313
|
+
--ele-bg: rgba(115, 44, 123, 0.2);
|
|
314
|
+
--ele-area: #732C7B;
|
|
315
|
+
--ele-brush: rgba(74, 14, 80, 0.4);
|
|
316
|
+
--ele-icon: url(../images/elevation-purple.svg);
|
|
403
317
|
}
|
|
404
318
|
|
|
405
319
|
/* YELLOW THEME //////////////////////////////////////////////// */
|
|
406
320
|
|
|
407
|
-
.yellow-theme
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.yellow-theme.elevation-polyline {
|
|
412
|
-
stroke: #FF0;
|
|
321
|
+
.yellow-theme {
|
|
322
|
+
--ele-area: #FF0;
|
|
413
323
|
}
|
|
414
324
|
|
|
415
325
|
/* RED THEME //////////////////////////////////////////////// */
|
|
416
326
|
|
|
417
|
-
.red-theme
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.red-theme.elevation-polyline {
|
|
422
|
-
stroke: #F00;
|
|
327
|
+
.red-theme {
|
|
328
|
+
--ele-area: #F00;
|
|
423
329
|
}
|
|
424
330
|
|
|
425
331
|
/* MAGENTA THEME //////////////////////////////////////////////// */
|
|
426
332
|
|
|
427
|
-
.magenta-theme
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
.magenta-theme.elevation-control.elevation .area {
|
|
432
|
-
fill: #FF005E;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.magenta-theme.elevation-polyline {
|
|
436
|
-
stroke: #FF005E;
|
|
333
|
+
.magenta-theme {
|
|
334
|
+
--ele-bg: rgba(255, 255, 255, 0.47);
|
|
335
|
+
--ele-area: #FF005E;
|
|
437
336
|
}
|
|
438
337
|
|
|
439
338
|
/* LIGHTBLUE THEME //////////////////////////////////////////////// */
|
|
440
339
|
|
|
441
|
-
.lightblue-theme
|
|
442
|
-
|
|
443
|
-
|
|
340
|
+
.lightblue-theme {
|
|
341
|
+
--ele-area: #3366CC;
|
|
342
|
+
--ele-alpha: 0.45;
|
|
343
|
+
--ele-stroke: #4682B4;
|
|
444
344
|
}
|
|
445
345
|
|
|
446
346
|
.elevation-detached .lightblue-theme.elevation-control.elevation .area {
|
|
447
|
-
fill-opacity: 0.45;
|
|
448
|
-
stroke: #3366CC;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
.lightblue-theme.height-focus {
|
|
452
|
-
stroke: #000;
|
|
453
|
-
fill: #FFFFFF;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.lightblue-theme.elevation-polyline {
|
|
457
347
|
stroke: #3366CC;
|
|
458
348
|
}
|
|
459
349
|
|