mobility-toolbox-js 3.0.0-beta.10 → 3.0.0-beta.11
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/api/RealtimeAPI.d.ts +2 -2
- package/api/RealtimeAPI.js +2 -2
- package/api/RoutingAPI.d.ts +1 -1
- package/api/RoutingAPI.js +1 -1
- package/api/StopsAPI.d.ts +1 -1
- package/api/StopsAPI.js +1 -1
- package/common/utils/debounceWebsocketMessages.d.ts +1 -1
- package/common/utils/getVehiclePosition.js +3 -2
- package/maplibre/layers/RealtimeLayer.d.ts +3 -3
- package/maplibre/layers/RealtimeLayer.js +3 -3
- package/mbt.js +5418 -6756
- package/mbt.js.map +4 -4
- package/mbt.min.js +67 -67
- package/mbt.min.js.map +4 -4
- package/ol/controls/RoutingControl.d.ts +1 -1
- package/ol/controls/RoutingControl.js +1 -1
- package/ol/controls/StopFinderControl.d.ts +1 -1
- package/ol/controls/StopFinderControl.js +1 -1
- package/ol/layers/MaplibreLayer.d.ts +130 -10
- package/ol/layers/MaplibreLayer.js +133 -10
- package/ol/layers/MaplibreStyleLayer.d.ts +8 -2
- package/ol/layers/MaplibreStyleLayer.js +37 -22
- package/ol/layers/RealtimeLayer.d.ts +2 -2
- package/ol/layers/RealtimeLayer.js +2 -2
- package/package.json +14 -15
- package/ol/layers/MapGlLayer.d.ts +0 -144
- package/ol/layers/MapGlLayer.js +0 -144
package/api/RealtimeAPI.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const RealtimeModes: {
|
|
|
40
40
|
SCHEMATIC: RealtimeMode;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* This class provides convenience methods to use to the [geOps
|
|
43
|
+
* This class provides convenience methods to use to the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* import { RealtimeAPI } from 'mobility-toolbox-js/api';
|
|
@@ -116,7 +116,7 @@ declare class RealtimeAPI {
|
|
|
116
116
|
* @param {Object} options Options.
|
|
117
117
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
118
118
|
* @param {string[]} options.bbox The bounding box to receive data from.
|
|
119
|
-
* @param {string} [options.url='wss://api.geops.io/tracker-ws/v1/'] Url of the [geOps
|
|
119
|
+
* @param {string} [options.url='wss://api.geops.io/tracker-ws/v1/'] Url of the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
120
120
|
* @public
|
|
121
121
|
*/
|
|
122
122
|
constructor(options?: RealtimeAPIOptions);
|
package/api/RealtimeAPI.js
CHANGED
|
@@ -19,7 +19,7 @@ export const RealtimeModes = {
|
|
|
19
19
|
SCHEMATIC: 'schematic',
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
* This class provides convenience methods to use to the [geOps
|
|
22
|
+
* This class provides convenience methods to use to the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* import { RealtimeAPI } from 'mobility-toolbox-js/api';
|
|
@@ -114,7 +114,7 @@ class RealtimeAPI {
|
|
|
114
114
|
* @param {Object} options Options.
|
|
115
115
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
116
116
|
* @param {string[]} options.bbox The bounding box to receive data from.
|
|
117
|
-
* @param {string} [options.url='wss://api.geops.io/tracker-ws/v1/'] Url of the [geOps
|
|
117
|
+
* @param {string} [options.url='wss://api.geops.io/tracker-ws/v1/'] Url of the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
118
118
|
* @public
|
|
119
119
|
*/
|
|
120
120
|
constructor(options = {}) {
|
package/api/RoutingAPI.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type RoutingAPIOptions = {
|
|
|
5
5
|
apiKey?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* This class provides convenience methods to use to the [geOps Routing API](https://developer.geops.io/apis/routing).
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* import { RoutingAPI } from 'mobility-toolbox-js';
|
package/api/RoutingAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import HttpAPI from './HttpAPI';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* This class provides convenience methods to use to the [geOps Routing API](https://developer.geops.io/apis/routing).
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* import { RoutingAPI } from 'mobility-toolbox-js';
|
package/api/StopsAPI.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type StopsAPIOptions = {
|
|
|
5
5
|
apiKey?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* This class provides convenience methods to use to the [geOps Stops
|
|
8
|
+
* This class provides convenience methods to use to the [geOps Stops API](https://developer.geops.io/apis/stops/).
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* import { StopsAPI } from 'mobility-toolbox-js/api';
|
package/api/StopsAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import HttpAPI from './HttpAPI';
|
|
2
2
|
/**
|
|
3
|
-
* This class provides convenience methods to use to the [geOps Stops
|
|
3
|
+
* This class provides convenience methods to use to the [geOps Stops API](https://developer.geops.io/apis/stops/).
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* import { StopsAPI } from 'mobility-toolbox-js/api';
|
|
@@ -7,5 +7,5 @@ import type { WebSocketAPIMessageCallback } from '../../api/WebSocketAPI';
|
|
|
7
7
|
* @param {number} [timeout = 100] debounce timeout in ms
|
|
8
8
|
* @private
|
|
9
9
|
*/
|
|
10
|
-
declare const debounceWebsocketMessages: (onUpdate: (objects: any[]) => void, getObjectId?: (
|
|
10
|
+
declare const debounceWebsocketMessages: (onUpdate: (objects: any[]) => void, getObjectId?: (object: any) => string, timeout?: number) => WebSocketAPIMessageCallback<any>;
|
|
11
11
|
export default debounceWebsocketMessages;
|
|
@@ -10,13 +10,14 @@ import { LineString } from 'ol/geom';
|
|
|
10
10
|
*/
|
|
11
11
|
const getVehiclePosition = (now, trajectory, noInterpolate) => {
|
|
12
12
|
const { time_intervals: timeIntervals, olGeometry, coordinate, } = trajectory.properties;
|
|
13
|
-
|
|
14
|
-
let { type } = trajectory.geometry;
|
|
13
|
+
let { type, coordinates } = trajectory.geometry;
|
|
15
14
|
let geometry = olGeometry;
|
|
16
15
|
let coord;
|
|
17
16
|
let rotation;
|
|
17
|
+
// If an olGeometry exists we use it. It avoids to create one each time.
|
|
18
18
|
if (olGeometry) {
|
|
19
19
|
type = geometry.getType();
|
|
20
|
+
coordinates = geometry.getCoordinates();
|
|
20
21
|
}
|
|
21
22
|
if (noInterpolate && coordinate) {
|
|
22
23
|
coord = coordinate;
|
|
@@ -81,10 +81,10 @@ declare const RealtimeLayer_base: {
|
|
|
81
81
|
};
|
|
82
82
|
} & typeof Layer;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* A Maplibre layer able to display data from the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
|
-
* import { RealtimeLayer } from 'mobility-toolbox-js/
|
|
87
|
+
* import { RealtimeLayer } from 'mobility-toolbox-js/maplibre';
|
|
88
88
|
*
|
|
89
89
|
* const layer = new RealtimeLayer({
|
|
90
90
|
* apiKey: "yourApiKey"
|
|
@@ -104,7 +104,7 @@ declare class RealtimeLayer extends RealtimeLayer_base {
|
|
|
104
104
|
*
|
|
105
105
|
* @param {RealtimeLayerOptions} options
|
|
106
106
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
107
|
-
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps
|
|
107
|
+
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
|
|
108
108
|
*
|
|
109
109
|
*/
|
|
110
110
|
constructor(options?: {});
|
|
@@ -8,10 +8,10 @@ import Layer from './Layer';
|
|
|
8
8
|
import { getSourceCoordinates } from '../utils';
|
|
9
9
|
import toMercatorExtent from '../../common/utils/toMercatorExtent';
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A Maplibre layer able to display data from the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* import { RealtimeLayer } from 'mobility-toolbox-js/
|
|
14
|
+
* import { RealtimeLayer } from 'mobility-toolbox-js/maplibre';
|
|
15
15
|
*
|
|
16
16
|
* const layer = new RealtimeLayer({
|
|
17
17
|
* apiKey: "yourApiKey"
|
|
@@ -31,7 +31,7 @@ class RealtimeLayer extends RealtimeLayerMixin(Layer) {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {RealtimeLayerOptions} options
|
|
33
33
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
34
|
-
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps
|
|
34
|
+
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
|
|
35
35
|
*
|
|
36
36
|
*/
|
|
37
37
|
constructor(options = {}) {
|