@wemap/routers 12.8.6 → 12.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.
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/remote/geovelo/GeoveloRemoteRouter.ts +4 -1
- package/src/wemap-multi/CustomGraphMap.ts +2 -3
- package/src/wemap-multi/CustomGraphMapTester.ts +4 -2
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/routers"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/routers",
|
|
15
|
-
"version": "12.8.
|
|
15
|
+
"version": "12.8.8",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
18
18
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
},
|
|
53
53
|
"./helpers/*": "./helpers/*"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b07244ca8001b2016ac848003dee3e5fcfe1f2e7"
|
|
56
56
|
}
|
|
@@ -153,7 +153,10 @@ class GeoveloRemoteRouter extends RemoteRouter {
|
|
|
153
153
|
|
|
154
154
|
const res = await (fetch(url, {
|
|
155
155
|
method: 'POST',
|
|
156
|
-
headers: {
|
|
156
|
+
headers: {
|
|
157
|
+
apiKey,
|
|
158
|
+
'Content-Type': 'application/json'
|
|
159
|
+
},
|
|
157
160
|
body: JSON.stringify(bodyParams)
|
|
158
161
|
}).catch(() => {
|
|
159
162
|
throw RemoteRoutingError.unreachableServer(this.rname, url.toString());
|
|
@@ -13,7 +13,7 @@ import OsmGraphUtils from '../wemap-osm/OsmGraphUtils.js';
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
export type ParsingErrors = {
|
|
16
|
-
couldNotParseFile
|
|
16
|
+
couldNotParseFile?: string,
|
|
17
17
|
routingIoNotFound: OsmNode[],
|
|
18
18
|
routingBoundsNotFound: boolean
|
|
19
19
|
}
|
|
@@ -66,7 +66,6 @@ export default class CustomGraphMap {
|
|
|
66
66
|
callbackErrors?: (errors: ParsingErrors) => void
|
|
67
67
|
) {
|
|
68
68
|
const errors: ParsingErrors = {
|
|
69
|
-
couldNotParseFile: false,
|
|
70
69
|
routingIoNotFound: [],
|
|
71
70
|
routingBoundsNotFound: false
|
|
72
71
|
};
|
|
@@ -75,7 +74,7 @@ export default class CustomGraphMap {
|
|
|
75
74
|
try {
|
|
76
75
|
osmModel = OsmParser.parseOsmXmlString(osmXmlString);
|
|
77
76
|
} catch (e) {
|
|
78
|
-
errors.couldNotParseFile =
|
|
77
|
+
errors.couldNotParseFile = e instanceof Error ? e.message : "Unknown error";
|
|
79
78
|
callbackErrors?.(errors);
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
@@ -15,7 +15,8 @@ export type Error = CouldNotParseFileError
|
|
|
15
15
|
| RoutingIoNotOnGraphError;
|
|
16
16
|
|
|
17
17
|
export type CouldNotParseFileError = {
|
|
18
|
-
type: 'could-not-parse-file'
|
|
18
|
+
type: 'could-not-parse-file',
|
|
19
|
+
details: string | undefined
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export type MultipleGraphComponentsError = {
|
|
@@ -42,7 +43,8 @@ export default class CustomGraphMapTester {
|
|
|
42
43
|
|
|
43
44
|
if (customGraphMapErrors?.couldNotParseFile || !customGraphMap) {
|
|
44
45
|
errors.push({
|
|
45
|
-
type: 'could-not-parse-file'
|
|
46
|
+
type: 'could-not-parse-file',
|
|
47
|
+
details: customGraphMapErrors?.couldNotParseFile
|
|
46
48
|
});
|
|
47
49
|
return { errors };
|
|
48
50
|
}
|