@raruto/leaflet-elevation 1.9.6 → 2.0.2

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 CHANGED
@@ -24,22 +24,23 @@ _For a working example see one of the following demos:_
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
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)
27
29
  - [using .gpx waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_gpx-waypoints.html)
28
30
  - [using .geojson waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-waypoints.html)
29
- - [using custom attributes (heart rate)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_extended-ui.html)
30
- - [using custom markers (dynamic runner)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_dynamic-runner.html)
31
+
31
32
 
32
33
  <br/>
33
34
 
34
35
  - [autohide map](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-map.html)
35
36
  - [autohide chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-chart.html)
36
37
  - [collapsible button](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_close-button.html)
37
- - [custom colors](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-theme.html)
38
38
  - [custom summary](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-summary.html)
39
39
  - [follow marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_follow-marker.html)
40
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 = new L.Map('map', { mapTypeId: 'terrain', center: [41.4583, 12.7059], zoom: 5 });
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);
@@ -240,6 +241,7 @@ var map = L.map('map', {
240
241
  - https://wordpress.org/plugins/extensions-leaflet-map/
241
242
  - https://github.com/der-stefan/OpenTopoMap
242
243
  - https://gpx.n-peloton.fr/
244
+ - https://walkaholic.me/map
243
245
 
244
246
  </details>
245
247
 
@@ -250,7 +252,7 @@ _Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui), [QGIS Inte
250
252
  **Compatibile with:**
251
253
  [![Leaflet 1.x compatible!](https://img.shields.io/badge/Leaflet-1.7.0-1EB300.svg?style=flat)](http://leafletjs.com/reference.html)
252
254
  [![d3.js v6 compatibile!](https://img.shields.io/badge/d3.js-6.5-1EB300.svg?style=flat)](https://www.npmjs.com/package/d3)
253
- [![@tmcw/togeojson v4.5.0 compatibile!](https://img.shields.io/badge/@tmcw/togeojson-4.5-1EB300.svg?style=flat)](https://www.npmjs.com/package/@tmcw/togeojson)
255
+ [![@tmcw/togeojson v4.6.0 compatibile!](https://img.shields.io/badge/@tmcw/togeojson-4.6-1EB300.svg?style=flat)](https://www.npmjs.com/package/@tmcw/togeojson)
254
256
 
255
257
 
256
258
  ---
@@ -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: #0D1821;
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-circle, var(--ele-area, #FFF));
245
250
  }
246
251
 
247
252
  .leaflet-elevation-pane .height-focus.line,
@@ -260,200 +265,86 @@
260
265
  stroke-width: 2px;
261
266
  }
262
267
 
263
- .elevation-waypoint-icon:before {
264
- background: url(../images/elevation-pushpin.svg) no-repeat center center / contain;
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.elevation-control.elevation .background {
296
- background-color: rgba(156, 194, 34, 0.2);
297
- }
298
-
299
- .lime-theme.elevation-control.elevation .axis line,
300
- .lime-theme.elevation-control.elevation .axis path {
301
- stroke: #566B13;
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.elevation-control.elevation .background {
336
- background-color: rgba(70, 130, 180, 0.2);
337
- }
338
-
339
- .steelblue-theme.elevation-control.elevation .axis line,
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.elevation-control.elevation .background {
372
- background-color: rgba(115, 44, 123, 0.2);
373
- }
374
-
375
- .purple-theme.elevation-control.elevation .axis line,
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.elevation-control.elevation .area {
408
- fill: #FF0;
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.elevation-control.elevation .area {
418
- fill: #F00;
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.elevation-control.elevation .background {
428
- background-color: rgba(255, 255, 255, 0.47);
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.elevation-control.elevation .area {
442
- fill: #3366CC;
443
- stroke: #000;
340
+ .lightblue-theme {
341
+ --ele-area: #3366CC;
342
+ --ele-alpha: 0.45;
343
+ --ele-stroke: #4682B4;
344
+ --ele-circle: #fff;
444
345
  }
445
346
 
446
347
  .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
348
  stroke: #3366CC;
458
349
  }
459
350