@trailstash/ultra 3.8.7 → 3.8.8

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.
@@ -87,12 +87,22 @@ export async function callInterpreter(
87
87
  ) {
88
88
  let geoJSON;
89
89
  if (resp.headers.get("content-type") == "application/osm3s+xml") {
90
- geoJSON = osmtogeojson(
91
- new window.DOMParser().parseFromString(await resp.text(), "text/xml"),
92
- { flatProperties: false },
90
+ const dom = new window.DOMParser().parseFromString(
91
+ await resp.text(),
92
+ "text/xml",
93
93
  );
94
+ if (dom.querySelector("remark")) {
95
+ alert(dom.querySelector("remark").textContent);
96
+ return { type: "FeatureCollection", features: [] };
97
+ }
98
+ geoJSON = osmtogeojson(dom, { flatProperties: false });
94
99
  } else {
95
- geoJSON = osmtogeojson(await resp.json(), { flatProperties: false });
100
+ const json = await resp.json();
101
+ if (json.remark) {
102
+ alert(json.remark);
103
+ return { type: "FeatureCollection", features: [] };
104
+ }
105
+ geoJSON = osmtogeojson(json, { flatProperties: false });
96
106
  }
97
107
 
98
108
  return flattenProperties(geoJSON);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.8.7",
6
+ "version": "3.8.8",
7
7
  "description": "A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc",
8
8
  "main": "index.js",
9
9
  "scripts": {