@raruto/leaflet-elevation 1.8.5 → 1.8.6

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.
@@ -2523,7 +2523,9 @@
2523
2523
  }).then(function (data) {
2524
2524
  _this12._downloadURL = url; // TODO: handle multiple urls?
2525
2525
 
2526
- _this12.load(data);
2526
+ _this12._parseFromString(data).then(function (geojson) {
2527
+ return geojson && _this12._loadLayer(geojson);
2528
+ });
2527
2529
  }).catch(function (err) {
2528
2530
  return console.warn(err);
2529
2531
  });
@@ -2772,6 +2774,8 @@
2772
2774
  * Simple XML Parser (GPX, KML, TCX)
2773
2775
  */
2774
2776
  _parseFromXMLString: function _parseFromXMLString(data) {
2777
+ var _Array$from$find;
2778
+
2775
2779
  if (data.indexOf("<") != 0) {
2776
2780
  throw 'Invalid XML';
2777
2781
  }
@@ -2790,9 +2794,9 @@
2790
2794
  }
2791
2795
 
2792
2796
  var geojson = toGeoJSON[type](xml);
2793
- geojson.name = name.length > 0 ? Array.from(name).find(function (tag) {
2797
+ geojson.name = name.length > 0 ? ((_Array$from$find = Array.from(name).find(function (tag) {
2794
2798
  return tag.parentElement.tagName == "trk";
2795
- }).textContent : '';
2799
+ })) !== null && _Array$from$find !== void 0 ? _Array$from$find : name[0]).textContent : '';
2796
2800
  return geojson;
2797
2801
  },
2798
2802