@raruto/leaflet-elevation 1.9.1 → 1.9.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 +18 -27
- package/dist/leaflet-elevation.js +13 -22
- 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/package.json +1 -1
- package/src/control.js +4 -14
- package/src/options.js +1 -1
package/README.md
CHANGED
|
@@ -17,38 +17,29 @@ _For a working example see one of the following demos:_
|
|
|
17
17
|
- [loading .geojson file](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-data.html)
|
|
18
18
|
- [loading .kml file](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_kml-data.html)
|
|
19
19
|
- [loading .tcx file](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_tcx-data.html)
|
|
20
|
-
- [loading
|
|
21
|
-
- [loading
|
|
22
|
-
- [loading
|
|
20
|
+
- [loading a local .gpx file](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_upload-gpx.html)
|
|
21
|
+
- [loading multiple tracks (gpx group 1)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hoverable-tracks.html)
|
|
22
|
+
- [loading multiple tracks (gpx group 2)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-charts.html)
|
|
23
|
+
- [loading individual tracks (geojson)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-group.html)
|
|
24
|
+
- [loading individual tracks (gpx)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-tracks.html)
|
|
25
|
+
- [loading waypoint icons (gpx)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_gpx-waypoints.html)
|
|
26
|
+
- [loading waypoint icons (geojson)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-waypoints.html)
|
|
23
27
|
|
|
24
28
|
<br/>
|
|
25
29
|
|
|
30
|
+
- [autohide map](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-map.html)
|
|
31
|
+
- [autohide chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-chart.html)
|
|
26
32
|
- [custom chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_extended-ui.html)
|
|
27
33
|
- [custom colors](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-theme.html)
|
|
34
|
+
- [custom labels](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_i18n-strings.html)
|
|
35
|
+
- [custom marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_dynamic-runner.html)
|
|
28
36
|
- [custom summary](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-summary.html)
|
|
29
|
-
- [
|
|
37
|
+
- [leaflet button](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_close-button.html)
|
|
38
|
+
- [leaflet almost over](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_almost-over.html)
|
|
39
|
+
- [leaflet follow marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_follow-marker.html)
|
|
30
40
|
- [slope chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_slope-chart.html)
|
|
31
41
|
- [speed chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_speed-chart.html)
|
|
32
|
-
- [
|
|
33
|
-
|
|
34
|
-
<br/>
|
|
35
|
-
|
|
36
|
-
- [hoverable chart / hidden map](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-map.html)
|
|
37
|
-
- [hoverable chart / hidden chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-chart.html)
|
|
38
|
-
- [hoverable tracks](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hoverable-tracks.html)
|
|
39
|
-
- [toggable tracks](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-tracks.html)
|
|
40
|
-
- [toggable charts](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-charts.html)
|
|
41
|
-
|
|
42
|
-
<br/>
|
|
43
|
-
|
|
44
|
-
- [waypoint icons / gpx](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_gpx-waypoints.html)
|
|
45
|
-
- [waypoint icons / geojson](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-waypoints.html)
|
|
46
|
-
|
|
47
|
-
<br/>
|
|
48
|
-
|
|
49
|
-
- [almost over](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_almost-over.html)
|
|
50
|
-
- [follow marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_follow-marker.html)
|
|
51
|
-
- [dynamic runner](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_dynamic-runner.html)
|
|
42
|
+
- [web editor](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_string-data.html)
|
|
52
43
|
|
|
53
44
|
---
|
|
54
45
|
|
|
@@ -69,8 +60,8 @@ _For a working example see one of the following demos:_
|
|
|
69
60
|
<style> html, body, #map, #elevation-div { height: 100%; width: 100%; padding: 0; margin: 0; } #map { height: 75%; } #elevation-div { height: 25%; font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; } </style>
|
|
70
61
|
|
|
71
62
|
<!-- leaflet-ui -->
|
|
72
|
-
<script src="https://unpkg.com/leaflet@1.
|
|
73
|
-
<script src="https://unpkg.com/leaflet-ui@0.
|
|
63
|
+
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
|
64
|
+
<script src="https://unpkg.com/leaflet-ui@0.5.1/dist/leaflet-ui.js"></script>
|
|
74
65
|
|
|
75
66
|
<!-- leaflet-elevation -->
|
|
76
67
|
<link rel="stylesheet" href="https://unpkg.com/@raruto/leaflet-elevation/dist/leaflet-elevation.css" />
|
|
@@ -256,7 +247,7 @@ _Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui), [QGIS Inte
|
|
|
256
247
|
---
|
|
257
248
|
|
|
258
249
|
**Compatibile with:**
|
|
259
|
-
[](http://leafletjs.com/reference.html)
|
|
260
251
|
[](https://www.npmjs.com/package/d3)
|
|
261
252
|
[](https://www.npmjs.com/package/@tmcw/togeojson)
|
|
262
253
|
|
|
@@ -1766,7 +1766,7 @@
|
|
|
1766
1766
|
wptIcons: {
|
|
1767
1767
|
'': L.divIcon({
|
|
1768
1768
|
className: 'elevation-waypoint-marker',
|
|
1769
|
-
html: '<i class="elevation-waypoint-icon"></i>',
|
|
1769
|
+
html: '<i class="elevation-waypoint-icon default"></i>',
|
|
1770
1770
|
iconSize: [30, 30],
|
|
1771
1771
|
iconAnchor: [8, 30]
|
|
1772
1772
|
})
|
|
@@ -1793,7 +1793,7 @@
|
|
|
1793
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.9.
|
|
1796
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.2/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
|
|
@@ -2225,23 +2225,6 @@
|
|
|
2225
2225
|
_addMarker: function _addMarker(marker) {
|
|
2226
2226
|
if (marker) this._markers.addLayer(marker);
|
|
2227
2227
|
},
|
|
2228
|
-
_bindPopup: function _bindPopup(marker) {
|
|
2229
|
-
var popup = marker._popup;
|
|
2230
|
-
|
|
2231
|
-
if (popup) {
|
|
2232
|
-
popup.options.className = 'elevation-popup';
|
|
2233
|
-
|
|
2234
|
-
if (popup._content) {
|
|
2235
|
-
popup._content = decodeURI(popup._content);
|
|
2236
|
-
popup.bindTooltip(popup._content, {
|
|
2237
|
-
direction: 'auto',
|
|
2238
|
-
sticky: true,
|
|
2239
|
-
opacity: 1,
|
|
2240
|
-
className: 'elevation-tooltip'
|
|
2241
|
-
}).openTooltip();
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
},
|
|
2245
2228
|
|
|
2246
2229
|
/**
|
|
2247
2230
|
* Initialize "L.AlmostOver" integration
|
|
@@ -2616,13 +2599,21 @@
|
|
|
2616
2599
|
});
|
|
2617
2600
|
|
|
2618
2601
|
if ([true, 'markers'].includes(wptLabels) && (name || desc)) {
|
|
2619
|
-
|
|
2602
|
+
var content = decodeURI("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : ''));
|
|
2603
|
+
marker.bindPopup(content, {
|
|
2604
|
+
className: 'elevation-popup',
|
|
2605
|
+
keepInView: true
|
|
2606
|
+
}).openPopup();
|
|
2607
|
+
marker.bindTooltip(content, {
|
|
2608
|
+
className: 'elevation-tooltip',
|
|
2609
|
+
direction: 'auto',
|
|
2610
|
+
sticky: true,
|
|
2611
|
+
opacity: 1
|
|
2612
|
+
}).openTooltip();
|
|
2620
2613
|
}
|
|
2621
2614
|
|
|
2622
2615
|
control._addMarker(marker);
|
|
2623
2616
|
|
|
2624
|
-
control._bindPopup(marker);
|
|
2625
|
-
|
|
2626
2617
|
control.fire('waypoint_added', {
|
|
2627
2618
|
point: marker,
|
|
2628
2619
|
element: latlng,
|