@raruto/leaflet-elevation 1.8.2 → 1.8.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.
@@ -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) {
@@ -2039,7 +2057,7 @@
2039
2057
  __TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.3.0/dist/togeojson.umd.js',
2040
2058
  __LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
2041
2059
  __LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
2042
- __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.2/libs/leaflet-distance-marker.min.js',
2060
+ __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.8.3/libs/leaflet-distance-marker.min.js',
2043
2061
 
2044
2062
  /*
2045
2063
  * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data