@wemap/routers 7.2.1 → 7.2.2
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/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/routers"
|
|
12
12
|
},
|
|
13
13
|
"name": "@wemap/routers",
|
|
14
|
-
"version": "7.2.
|
|
14
|
+
"version": "7.2.2",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"@wemap/maths": "^7.0.0",
|
|
35
35
|
"@wemap/osm": "^7.2.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "5ce542abeeef3e58f5e3c3afaadc435ea0ceff17"
|
|
38
38
|
}
|
|
@@ -117,24 +117,16 @@ class IdfmRemoteRouter extends RemoteRouter {
|
|
|
117
117
|
|
|
118
118
|
// When IDFM failed to calculate an itinerary (ie. start or end
|
|
119
119
|
// point is far from network), it respond a 404 with an error message
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (response && 'error' in response && 'message' in response.error) {
|
|
123
|
-
errorMessage = response.error.message;
|
|
124
|
-
}
|
|
125
|
-
|
|
120
|
+
// or a 200 with an error message
|
|
121
|
+
if (response && response.error) {
|
|
126
122
|
const routerResponse = new RouterResponse();
|
|
127
123
|
routerResponse.routerName = this.rname;
|
|
128
124
|
routerResponse.from = waypoints[0];
|
|
129
125
|
routerResponse.to = waypoints[1];
|
|
130
|
-
routerResponse.error =
|
|
126
|
+
routerResponse.error = response.error.message || 'no details.';
|
|
131
127
|
return routerResponse;
|
|
132
128
|
}
|
|
133
129
|
|
|
134
|
-
if (res.status !== 200) {
|
|
135
|
-
throw new RemoteRouterServerUnreachable(this.rname, url);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
130
|
return this.createRouterResponseFromJson(response);
|
|
139
131
|
}
|
|
140
132
|
|
|
@@ -204,17 +196,17 @@ class IdfmRemoteRouter extends RemoteRouter {
|
|
|
204
196
|
|
|
205
197
|
let query = '';
|
|
206
198
|
switch (mode) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
199
|
+
case Constants.ROUTING_MODE.WALK:
|
|
200
|
+
query = this.getWalkingQuery();
|
|
201
|
+
break;
|
|
202
|
+
case Constants.ROUTING_MODE.BIKE:
|
|
203
|
+
query = this.getBikeQuery();
|
|
204
|
+
break;
|
|
205
|
+
case Constants.ROUTING_MODE.CAR:
|
|
206
|
+
query = this.getCarQuery();
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
break;
|
|
218
210
|
}
|
|
219
211
|
|
|
220
212
|
url = `${url.origin}${url.pathname}${search}${query}`;
|