@wemap/routers 9.0.0-alpha.7 → 9.0.0
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/index.js +2 -1
- package/package.json +6 -6
- package/src/remote/osrm/OsrmRemoteRouter.js +10 -4
package/index.js
CHANGED
|
@@ -27,7 +27,8 @@ export { default as WemapMetaRemoteRouter } from './src/remote/wemap-meta/WemapM
|
|
|
27
27
|
export { default as WemapMetaRemoteRouterOptions } from './src/remote/wemap-meta/WemapMetaRemoteRouterOptions.js';
|
|
28
28
|
export { default as WemapMetaRemoteRouterPayload } from './src/remote/wemap-meta/WemapMetaRemoteRouterPayload.js';
|
|
29
29
|
export { default as RemoteRouterManager } from './src/remote/RemoteRouterManager.js';
|
|
30
|
-
|
|
30
|
+
export { default as RemoteRouterOptions } from './src/remote/RemoteRouterOptions.js';
|
|
31
|
+
export { default as RemoteRouterServerUnreachable} from './src/remote/RemoteRouterServerUnreachable.js';
|
|
31
32
|
|
|
32
33
|
/* Others */
|
|
33
34
|
export { default as ItineraryInfoManager } from './src/ItineraryInfoManager.js';
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/routers"
|
|
12
12
|
},
|
|
13
13
|
"name": "@wemap/routers",
|
|
14
|
-
"version": "9.0.0
|
|
14
|
+
"version": "9.0.0",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@turf/boolean-point-in-polygon": "^6.5.0",
|
|
30
30
|
"@turf/convex": "^6.5.0",
|
|
31
31
|
"@turf/helpers": "^6.5.0",
|
|
32
|
-
"@wemap/geo": "^9.0.0
|
|
33
|
-
"@wemap/logger": "^9.0.0
|
|
34
|
-
"@wemap/maths": "^9.0.0
|
|
35
|
-
"@wemap/osm": "^9.0.0
|
|
32
|
+
"@wemap/geo": "^9.0.0",
|
|
33
|
+
"@wemap/logger": "^9.0.0",
|
|
34
|
+
"@wemap/maths": "^9.0.0",
|
|
35
|
+
"@wemap/osm": "^9.0.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9f16c3cebf6f0e6d03a83835607528f5c37707cf"
|
|
38
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
2
|
|
|
3
|
-
import { Coordinates } from '@wemap/geo';
|
|
3
|
+
import { Coordinates, Level } from '@wemap/geo';
|
|
4
|
+
import Logger from '@wemap/logger';
|
|
4
5
|
import { rad2deg, positiveMod } from '@wemap/maths';
|
|
5
6
|
|
|
6
7
|
import Itinerary from '../../model/Itinerary.js';
|
|
@@ -95,11 +96,16 @@ class OsrmRemoteRouter extends RemoteRouter {
|
|
|
95
96
|
* @returns {Coordinates}
|
|
96
97
|
*/
|
|
97
98
|
jsonToCoordinates(json) {
|
|
98
|
-
const
|
|
99
|
+
const coords = new Coordinates(json[1], json[0]);
|
|
99
100
|
if (json.length > 2) {
|
|
100
|
-
|
|
101
|
+
if (typeof json[2] === 'string') {
|
|
102
|
+
Logger.warn('Still using legacy level format. Please update your project.');
|
|
103
|
+
coords.level = Level.fromString(json[2]);
|
|
104
|
+
} else {
|
|
105
|
+
coords.level = json[2];
|
|
106
|
+
}
|
|
101
107
|
}
|
|
102
|
-
return
|
|
108
|
+
return coords;
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
nodesToJsonCoords(nodes) {
|