@raruto/leaflet-elevation 1.9.2 → 1.9.3
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 +13 -13
- package/dist/leaflet-elevation.js +17 -16
- 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/components.js +4 -2
- package/src/control.js +1 -1
- package/src/marker.js +15 -15
package/README.md
CHANGED
|
@@ -18,28 +18,28 @@ _For a working example see one of the following demos:_
|
|
|
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
20
|
- [loading a local .gpx file](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_upload-gpx.html)
|
|
21
|
-
- [loading
|
|
22
|
-
- [loading
|
|
23
|
-
- [loading individual tracks
|
|
24
|
-
- [loading
|
|
25
|
-
- [loading
|
|
26
|
-
- [loading
|
|
21
|
+
- [loading data from a textarea](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_string-data.html)
|
|
22
|
+
- [loading individual .geojson tracks](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-group.html)
|
|
23
|
+
- [loading individual .gpx tracks](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-tracks.html)
|
|
24
|
+
- [loading multiple .gpx tracks (hover to toggle)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hoverable-tracks.html)
|
|
25
|
+
- [loading multiple .gpx tracks (click to toggle)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_toggable-charts.html)
|
|
26
|
+
- [loading heart rate data (coding a custom plugin)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_extended-ui.html)
|
|
27
|
+
- [loading a dynamic runner (coding a custom plugin)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_dynamic-runner.html)
|
|
28
|
+
- [snapping mouse over layer buffer (leaflet-almostover)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_almost-over.html)
|
|
29
|
+
- [translating plugin labels (leaflet-i18n)](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_i18n-strings.html)
|
|
30
|
+
- [using .gpx waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_gpx-waypoints.html)
|
|
31
|
+
- [using .geojson waypoint icons](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-waypoints.html)
|
|
27
32
|
|
|
28
33
|
<br/>
|
|
29
34
|
|
|
30
35
|
- [autohide map](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-map.html)
|
|
31
36
|
- [autohide chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hidden-chart.html)
|
|
32
|
-
- [
|
|
37
|
+
- [collapsible button](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_close-button.html)
|
|
33
38
|
- [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)
|
|
36
39
|
- [custom summary](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_custom-summary.html)
|
|
37
|
-
- [
|
|
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)
|
|
40
|
+
- [follow marker](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_follow-marker.html)
|
|
40
41
|
- [slope chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_slope-chart.html)
|
|
41
42
|
- [speed chart](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_speed-chart.html)
|
|
42
|
-
- [web editor](https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_string-data.html)
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
@@ -394,6 +394,7 @@
|
|
|
394
394
|
_ref4$length = _ref4.length,
|
|
395
395
|
length = _ref4$length === void 0 ? 0 : _ref4$length;
|
|
396
396
|
return function (g) {
|
|
397
|
+
g.attr("class", "height-focus-group");
|
|
397
398
|
var line = g.select('.height-focus.line');
|
|
398
399
|
var circle = g.select('.height-focus.circle-lower');
|
|
399
400
|
var text = g.select('.height-focus-label');
|
|
@@ -1557,7 +1558,6 @@
|
|
|
1557
1558
|
switch (this.options.marker) {
|
|
1558
1559
|
case 'elevation-line':
|
|
1559
1560
|
// this._container = d3.create("g").attr("class", "height-focus-group");
|
|
1560
|
-
this._container = d3.select(map.getPane('elevationPane')).select("svg > g").attr("class", "height-focus-group");
|
|
1561
1561
|
break;
|
|
1562
1562
|
|
|
1563
1563
|
case 'position-marker':
|
|
@@ -1578,8 +1578,7 @@
|
|
|
1578
1578
|
|
|
1579
1579
|
switch (this.options.marker) {
|
|
1580
1580
|
case 'elevation-line':
|
|
1581
|
-
this._container.call(PositionMarker({}));
|
|
1582
|
-
|
|
1581
|
+
this._container = d3.select(map.getPane('elevationPane')).select("svg > g").call(PositionMarker({}));
|
|
1583
1582
|
break;
|
|
1584
1583
|
|
|
1585
1584
|
case 'position-marker':
|
|
@@ -1605,21 +1604,23 @@
|
|
|
1605
1604
|
|
|
1606
1605
|
switch (this.options.marker) {
|
|
1607
1606
|
case 'elevation-line':
|
|
1608
|
-
|
|
1607
|
+
if (this._container) {
|
|
1608
|
+
var point = this._map.latLngToLayerPoint(this._latlng);
|
|
1609
1609
|
|
|
1610
|
-
|
|
1610
|
+
point = L.extend({}, props.item, this._map._rotate ? this._map.rotatedPointToMapPanePoint(point) : point);
|
|
1611
1611
|
|
|
1612
|
-
|
|
1612
|
+
this._container.classed("leaflet-hidden", false);
|
|
1613
1613
|
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1614
|
+
this._container.call(PositionMarker({
|
|
1615
|
+
theme: this.options.theme,
|
|
1616
|
+
xCoord: point.x,
|
|
1617
|
+
yCoord: point.y,
|
|
1618
|
+
length: point.y - this._height() / props.maxElevation * point.z,
|
|
1619
|
+
// normalized Y
|
|
1620
|
+
labels: this._labels,
|
|
1621
|
+
item: point
|
|
1622
|
+
}));
|
|
1623
|
+
}
|
|
1623
1624
|
|
|
1624
1625
|
break;
|
|
1625
1626
|
|
|
@@ -1793,7 +1794,7 @@
|
|
|
1793
1794
|
__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.5.0/dist/togeojson.umd.js',
|
|
1794
1795
|
__LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
|
|
1795
1796
|
__LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
|
|
1796
|
-
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.
|
|
1797
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.3/libs/leaflet-distance-marker.min.js',
|
|
1797
1798
|
|
|
1798
1799
|
/*
|
|
1799
1800
|
* Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
|