@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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
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