@any-routing/osrm-data-provider 1.0.0-rc.1 → 1.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/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@any-routing/osrm-data-provider",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@any-routing/core": "1.0.0
|
|
8
|
+
"@any-routing/core": "1.0.0",
|
|
9
9
|
"comlink": "4.4.2",
|
|
10
10
|
"@turf/bbox": "7.4.0",
|
|
11
11
|
"@turf/helpers": "7.4.0",
|
|
@@ -86,7 +86,7 @@ export class OsrmProvider implements AnyRoutingDataProvider {
|
|
|
86
86
|
const coordinates = waypoints.map((w) => this.formatWp(w.position)).join(';');
|
|
87
87
|
|
|
88
88
|
const queryParamsObj: Record<string, string | number | boolean | undefined | null> = {
|
|
89
|
-
alternatives: opts.
|
|
89
|
+
alternatives: opts.alternatives ?? 0,
|
|
90
90
|
steps: opts.steps,
|
|
91
91
|
geometries: opts.geometries || 'geojson',
|
|
92
92
|
overview: opts.overview || 'full',
|
package/src/lib/osrm.executor.ts
CHANGED
|
@@ -2,7 +2,7 @@ import bbox from '@turf/bbox';
|
|
|
2
2
|
import { featureCollection, lineString } from '@turf/helpers';
|
|
3
3
|
import type { BBox, Feature, LineString } from 'geojson';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Requester, type WaypointPosition } from '@any-routing/core';
|
|
6
6
|
|
|
7
7
|
import type {
|
|
8
8
|
Options,
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
OsrmRoutingData,
|
|
14
14
|
} from './osrm-provider.types';
|
|
15
15
|
|
|
16
|
-
export type ExecutorRequestOptions = { url: string
|
|
16
|
+
export type ExecutorRequestOptions = { url: string } & Options;
|
|
17
17
|
|
|
18
18
|
/** Properties attached to each rendered segment of a route's shape. */
|
|
19
19
|
type ShapeFeatureProperties = {
|
|
@@ -63,7 +63,6 @@ export class OsrmExecutor {
|
|
|
63
63
|
routesShapeGeojson,
|
|
64
64
|
version: performance.now(),
|
|
65
65
|
latest: !this.requester.hasPendingRequests,
|
|
66
|
-
mode: opts.mode,
|
|
67
66
|
requestOptions: opts,
|
|
68
67
|
};
|
|
69
68
|
}
|