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.
@@ -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 realtime API](https://developer.geops.io/apis/realtime/).
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 realtime API](https://developer.geops.io/apis/realtime/).
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);
@@ -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 realtime API](https://developer.geops.io/apis/realtime/).
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 realtime API](https://developer.geops.io/apis/realtime/).
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 = {}) {
@@ -5,7 +5,7 @@ export type RoutingAPIOptions = {
5
5
  apiKey?: string;
6
6
  };
7
7
  /**
8
- * Access to the [geOps Routing API](https://developer.geops.io/apis/routing).
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
- * Access to the [geOps Routing API](https://developer.geops.io/apis/routing).
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 api](https://developer.geops.io/apis/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 api](https://developer.geops.io/apis/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?: ((object: any) => string) | undefined, timeout?: number) => WebSocketAPIMessageCallback<any>;
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
- const { coordinates } = trajectory.geometry;
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
- * Responsible for loading and display data from a geOps realtime API.
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/Maplibre';
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 realtime API url.
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
- * Responsible for loading and display data from a geOps realtime API.
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/Maplibre';
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 realtime API url.
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 = {}) {