@raruto/leaflet-elevation 1.8.1 → 1.8.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/dist/leaflet-elevation.css +0 -4
- package/dist/leaflet-elevation.js +29 -3
- package/dist/leaflet-elevation.js.map +1 -1
- package/dist/leaflet-elevation.min.css +1 -1
- package/dist/leaflet-elevation.min.js +1 -1
- package/dist/leaflet-elevation.min.js.map +1 -1
- package/libs/leaflet-distance-marker.min.js +1 -6
- package/package.json +1 -1
- package/src/chart.js +7 -1
- package/src/control.js +1 -1
- package/src/index.css +0 -4
- package/src/utils.js +17 -0
|
@@ -149,7 +149,25 @@
|
|
|
149
149
|
}, control.options.distanceMarkers);
|
|
150
150
|
var _control$options = control.options,
|
|
151
151
|
wptIcons = _control$options.wptIcons,
|
|
152
|
-
wptLabels = _control$options.wptLabels;
|
|
152
|
+
wptLabels = _control$options.wptLabels; // Partially fix MultiLineStrings (trk > trkseg + trkseg) splitting them into seperate LineStrings (trk > trkseg, trk > trkseg)
|
|
153
|
+
|
|
154
|
+
data.features.forEach(function (d) {
|
|
155
|
+
if (d.type == 'Feature' && d.geometry.type == "MultiLineString") {
|
|
156
|
+
d.geometry.coordinates.forEach(function (coords) {
|
|
157
|
+
data.features.push({
|
|
158
|
+
type: 'Feature',
|
|
159
|
+
geometry: {
|
|
160
|
+
type: 'LineString',
|
|
161
|
+
coordinates: coords
|
|
162
|
+
},
|
|
163
|
+
properties: d.properties
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
data.features = data.features.filter(function (d) {
|
|
169
|
+
return d.type && d.geometry.type != "MultiLineString";
|
|
170
|
+
});
|
|
153
171
|
var layer = L.geoJson(data, {
|
|
154
172
|
distanceMarkers: distanceMarkers,
|
|
155
173
|
style: function style(feature) {
|
|
@@ -1168,6 +1186,10 @@
|
|
|
1168
1186
|
// this._y.domain([0, 1]);
|
|
1169
1187
|
// }
|
|
1170
1188
|
|
|
1189
|
+
|
|
1190
|
+
this._maskGaps = [];
|
|
1191
|
+
|
|
1192
|
+
this._mask.selectAll(".gap").remove();
|
|
1171
1193
|
},
|
|
1172
1194
|
_drawPath: function _drawPath(name) {
|
|
1173
1195
|
var path = this._paths[name];
|
|
@@ -1295,6 +1317,8 @@
|
|
|
1295
1317
|
_this4.zooming = true;
|
|
1296
1318
|
_this4._scales.distance = _this4._x = e.transform.rescaleX(_this4._x); // calculate x scale at zoom level
|
|
1297
1319
|
|
|
1320
|
+
if (_this4._scales.time) _this4._scales.time = e.transform.rescaleX(_this4._scales.time); // calculate x scale at zoom level
|
|
1321
|
+
|
|
1298
1322
|
_this4._resetDrag();
|
|
1299
1323
|
|
|
1300
1324
|
if (e.sourceEvent && e.sourceEvent.type == "mousemove") {
|
|
@@ -1457,7 +1481,9 @@
|
|
|
1457
1481
|
var opts = this.options;
|
|
1458
1482
|
var scale = props.scale;
|
|
1459
1483
|
|
|
1460
|
-
if (typeof
|
|
1484
|
+
if (typeof this._scales[props.name] === 'function') {
|
|
1485
|
+
props.scale = this._scales[props.name]; // retrieve cached scale
|
|
1486
|
+
} else if (typeof scale !== 'function') {
|
|
1461
1487
|
scale = L.extend({
|
|
1462
1488
|
data: this._data,
|
|
1463
1489
|
forceBounds: opts.forceAxisBounds
|
|
@@ -2035,7 +2061,7 @@
|
|
|
2035
2061
|
__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.3.0/dist/togeojson.umd.js',
|
|
2036
2062
|
__LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
|
|
2037
2063
|
__LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
|
|
2038
|
-
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.
|
|
2064
|
+
__LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.4/libs/leaflet-distance-marker.min.js',
|
|
2039
2065
|
|
|
2040
2066
|
/*
|
|
2041
2067
|
* Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
|