mobility-toolbox-js 2.0.0-beta.58 → 2.0.0-beta.59
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 +5 -5
- package/api/RealtimeAPI.d.ts.map +1 -1
- package/api/RealtimeAPI.js +20 -16
- package/common/mixins/RealtimeLayerMixin.d.ts +0 -1
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -1
- package/common/mixins/RealtimeLayerMixin.js +4 -1
- package/common/utils/getMapboxRender.d.ts +1 -1
- package/common/utils/getMapboxRender.d.ts.map +1 -1
- package/common/utils/getRealtimeModeSuffix.d.ts +3 -3
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -1
- package/common/utils/getRealtimeModeSuffix.js +8 -2
- package/mapbox/layers/RealtimeLayer.d.ts +5 -1
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
- package/mbt.js +28 -15
- package/mbt.js.map +2 -2
- package/mbt.min.js +2 -2
- package/mbt.min.js.map +2 -2
- package/ol/layers/RealtimeLayer.d.ts +1 -1
- package/ol/layers/RealtimeLayer.d.ts.map +1 -1
- package/package.json +2 -1
package/api/RealtimeAPI.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import WebSocketAPI, { WebSocketAPIMessageCallback, WebSocketAPIMessageEventData } from '../common/api/WebSocketAPI';
|
|
2
|
-
import { RealtimeMode, RealtimeDeparture, RealtimeNews, RealtimeStation, RealtimeExtraGeom, RealtimeTrainId, RealtimeGeneralizationLevel, RealtimeFullTrajectory, RealtimeTrajectoryResponse, RealtimeStationId } from '../types';
|
|
2
|
+
import { RealtimeMode, RealtimeDeparture, RealtimeNews, RealtimeStation, RealtimeExtraGeom, RealtimeTrainId, RealtimeGeneralizationLevel, RealtimeFullTrajectory, RealtimeTrajectoryResponse, RealtimeStationId, RealtimeTenant } from '../types';
|
|
3
3
|
import { StopSequence } from './typedefs';
|
|
4
4
|
export declare type RealtimeAPIOptions = {
|
|
5
5
|
url?: string;
|
|
6
6
|
apiKey?: string;
|
|
7
|
-
|
|
7
|
+
tenant?: RealtimeTenant;
|
|
8
8
|
projection?: string;
|
|
9
9
|
bbox?: (number | string)[];
|
|
10
10
|
buffer?: number[];
|
|
@@ -57,7 +57,7 @@ declare class RealtimeAPI {
|
|
|
57
57
|
projection?: string;
|
|
58
58
|
bbox?: (number | string)[];
|
|
59
59
|
buffer?: number[];
|
|
60
|
-
|
|
60
|
+
tenant?: RealtimeTenant;
|
|
61
61
|
pingInterval: number;
|
|
62
62
|
pingIntervalMs: number;
|
|
63
63
|
reconnectTimeout?: number;
|
|
@@ -68,7 +68,7 @@ declare class RealtimeAPI {
|
|
|
68
68
|
* @param {Object|string} options A string representing the url of the service or an object containing the url and the apiKey.
|
|
69
69
|
* @param {string} options.url Url to the [geOps realtime api](https://developer.geops.io/apis/realtime/).
|
|
70
70
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
71
|
-
* @param {string} [options.
|
|
71
|
+
* @param {string} [options.tenant=''] Tenant of the provider. Use to limitate some subscriptions to a specfic provider (it is used by schematic channels and newsticker).
|
|
72
72
|
* @param {string} [options.projection] The epsg code of the projection for features. Default to EPSG:3857.
|
|
73
73
|
* @param {number[4]} [options.bbox=[minX, minY, maxX, maxY, zoom, tenant] The bounding box to receive data from.
|
|
74
74
|
*/
|
|
@@ -151,7 +151,7 @@ declare class RealtimeAPI {
|
|
|
151
151
|
*/
|
|
152
152
|
getStation(uic: RealtimeStationId, mode: RealtimeMode): Promise<WebSocketAPIMessageEventData<RealtimeStation>>;
|
|
153
153
|
/**
|
|
154
|
-
* Get the list of
|
|
154
|
+
* Get the list of stations available for a specifc mode. The promise is resolved every 100ms
|
|
155
155
|
* @param {RealtimeMode} mode Realtime mode.
|
|
156
156
|
* @param {number} timeout = 100 Duration in ms between each promise resolve calls.
|
|
157
157
|
* @return {Promise<RealtimeStation[]>} An array of stations.
|
package/api/RealtimeAPI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeAPI.d.ts","sourceRoot":"","sources":["../../src/api/RealtimeAPI.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EACnB,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"RealtimeAPI.d.ts","sourceRoot":"","sources":["../../src/api/RealtimeAPI.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EACnB,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,oBAAY,kBAAkB,GAAG;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,yBAAyB,GAAG;IAC9C,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC;CACpC,CAAC;AAEF,oBAAY,yBAAyB,GAAG;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C9C,OAAO,GAAE,aAAwB,EACjC,KAAK,GAAE,OAAe;IAKxB;;;OAGG;IACH,sBAAsB,CAAC,SAAS,CAAC,EAAE,2BAA2B,CAAC,MAAM,CAAC;CAGvE;AACD,eAAe,WAAW,CAAC"}
|
package/api/RealtimeAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocketAPI from '../common/api/WebSocketAPI';
|
|
2
2
|
import debounceWebsocketMessages from '../common/utils/debounceWebsocketMessages';
|
|
3
|
-
import
|
|
3
|
+
import getRealtimeModeSuffix from '../common/utils/getRealtimeModeSuffix';
|
|
4
4
|
/**
|
|
5
5
|
* Enum for Realtime modes.
|
|
6
6
|
* @readonly
|
|
@@ -38,14 +38,14 @@ class RealtimeAPI {
|
|
|
38
38
|
* @param {Object|string} options A string representing the url of the service or an object containing the url and the apiKey.
|
|
39
39
|
* @param {string} options.url Url to the [geOps realtime api](https://developer.geops.io/apis/realtime/).
|
|
40
40
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
41
|
-
* @param {string} [options.
|
|
41
|
+
* @param {string} [options.tenant=''] Tenant of the provider. Use to limitate some subscriptions to a specfic provider (it is used by schematic channels and newsticker).
|
|
42
42
|
* @param {string} [options.projection] The epsg code of the projection for features. Default to EPSG:3857.
|
|
43
43
|
* @param {number[4]} [options.bbox=[minX, minY, maxX, maxY, zoom, tenant] The bounding box to receive data from.
|
|
44
44
|
*/
|
|
45
45
|
constructor(options = {}) {
|
|
46
46
|
this.defineProperties(options);
|
|
47
47
|
/** @ignore */
|
|
48
|
-
this.
|
|
48
|
+
this.tenant = options.tenant;
|
|
49
49
|
/** @ignore */
|
|
50
50
|
this.onOpen = this.onOpen.bind(this);
|
|
51
51
|
}
|
|
@@ -219,9 +219,9 @@ class RealtimeAPI {
|
|
|
219
219
|
* @private
|
|
220
220
|
*/
|
|
221
221
|
unsubscribe(channel, suffix = '', onMessage) {
|
|
222
|
-
const
|
|
223
|
-
const suffixTopographic =
|
|
224
|
-
this.wsApi.unsubscribe(`${channel}${
|
|
222
|
+
const suffixSchematic = getRealtimeModeSuffix(RealtimeModes.SCHEMATIC, RealtimeModes, this.tenant);
|
|
223
|
+
const suffixTopographic = getRealtimeModeSuffix(RealtimeModes.TOPOGRAPHIC, RealtimeModes, this.tenant);
|
|
224
|
+
this.wsApi.unsubscribe(`${channel}${suffixSchematic}${suffix || ''}`, onMessage);
|
|
225
225
|
this.wsApi.unsubscribe(`${channel}${suffixTopographic}${suffix || ''}`, onMessage);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
@@ -252,7 +252,8 @@ class RealtimeAPI {
|
|
|
252
252
|
* @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
|
|
253
253
|
*/
|
|
254
254
|
subscribeDisruptions(onMessage, onError = () => { }, quiet = false) {
|
|
255
|
-
this.
|
|
255
|
+
const channel = [this.tenant, 'newsticker'];
|
|
256
|
+
this.subscribe(channel.join('_'), onMessage, onError, quiet);
|
|
256
257
|
}
|
|
257
258
|
/**
|
|
258
259
|
* Unsubscribe disruptions.
|
|
@@ -260,7 +261,8 @@ class RealtimeAPI {
|
|
|
260
261
|
* @param {function(data: { content: RealtimeNews[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
261
262
|
*/
|
|
262
263
|
unsubscribeDisruptions(onMessage) {
|
|
263
|
-
this.
|
|
264
|
+
const channel = [this.tenant, 'newsticker'];
|
|
265
|
+
this.unsubscribe(channel.join('_'), '', onMessage);
|
|
264
266
|
}
|
|
265
267
|
/**
|
|
266
268
|
* Return a station with a given uic number and a mode.
|
|
@@ -271,7 +273,7 @@ class RealtimeAPI {
|
|
|
271
273
|
*/
|
|
272
274
|
getStation(uic, mode) {
|
|
273
275
|
const params = {
|
|
274
|
-
channel: `station${
|
|
276
|
+
channel: `station${getRealtimeModeSuffix(mode, RealtimeModes, this.tenant)}`,
|
|
275
277
|
args: uic,
|
|
276
278
|
};
|
|
277
279
|
return new Promise((resolve, reject) => {
|
|
@@ -279,7 +281,7 @@ class RealtimeAPI {
|
|
|
279
281
|
});
|
|
280
282
|
}
|
|
281
283
|
/**
|
|
282
|
-
* Get the list of
|
|
284
|
+
* Get the list of stations available for a specifc mode. The promise is resolved every 100ms
|
|
283
285
|
* @param {RealtimeMode} mode Realtime mode.
|
|
284
286
|
* @param {number} timeout = 100 Duration in ms between each promise resolve calls.
|
|
285
287
|
* @return {Promise<RealtimeStation[]>} An array of stations.
|
|
@@ -287,7 +289,7 @@ class RealtimeAPI {
|
|
|
287
289
|
getStations(mode, timeout = 100) {
|
|
288
290
|
return new Promise((resolve) => {
|
|
289
291
|
this.wsApi.get({
|
|
290
|
-
channel: `station${
|
|
292
|
+
channel: `station${getRealtimeModeSuffix(mode, RealtimeModes, this.tenant)}`,
|
|
291
293
|
}, debounceWebsocketMessages(resolve, undefined, timeout));
|
|
292
294
|
});
|
|
293
295
|
}
|
|
@@ -301,7 +303,7 @@ class RealtimeAPI {
|
|
|
301
303
|
* @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
|
|
302
304
|
*/
|
|
303
305
|
subscribeStations(mode, onMessage, onError = () => { }, quiet = false) {
|
|
304
|
-
this.subscribe(`station${
|
|
306
|
+
this.subscribe(`station${getRealtimeModeSuffix(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
305
307
|
}
|
|
306
308
|
/**
|
|
307
309
|
* Unsubscribe to stations channel.
|
|
@@ -337,7 +339,7 @@ class RealtimeAPI {
|
|
|
337
339
|
*/
|
|
338
340
|
subscribeTrajectory(mode, onMessage, onError = () => { }, quiet = false) {
|
|
339
341
|
this.unsubscribeTrajectory(onMessage);
|
|
340
|
-
this.subscribe(`trajectory${
|
|
342
|
+
this.subscribe(`trajectory${getRealtimeModeSuffix(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
341
343
|
}
|
|
342
344
|
/**
|
|
343
345
|
* Unsubscribe to trajectory channels.
|
|
@@ -356,7 +358,7 @@ class RealtimeAPI {
|
|
|
356
358
|
*/
|
|
357
359
|
subscribeDeletedVehicles(mode, onMessage, onError = () => { }, quiet = false) {
|
|
358
360
|
this.unsubscribeDeletedVehicles(onMessage);
|
|
359
|
-
this.subscribe(`deleted_vehicles${
|
|
361
|
+
this.subscribe(`deleted_vehicles${getRealtimeModeSuffix(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
360
362
|
}
|
|
361
363
|
/**
|
|
362
364
|
* Unsubscribe to deleted_vhicles channels.
|
|
@@ -374,7 +376,9 @@ class RealtimeAPI {
|
|
|
374
376
|
* @return {Promise<{ data: { content: FullTrajectory } }>} Return a full trajectory.
|
|
375
377
|
*/
|
|
376
378
|
getFullTrajectory(id, mode, generalizationLevel) {
|
|
377
|
-
const channel = [
|
|
379
|
+
const channel = [
|
|
380
|
+
`full_trajectory${getRealtimeModeSuffix(mode, RealtimeModes)}`,
|
|
381
|
+
];
|
|
378
382
|
if (id) {
|
|
379
383
|
channel.push(id);
|
|
380
384
|
}
|
|
@@ -398,7 +402,7 @@ class RealtimeAPI {
|
|
|
398
402
|
* @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
|
|
399
403
|
*/
|
|
400
404
|
subscribeFullTrajectory(id, mode, onMessage, onError = () => { }, quiet = false) {
|
|
401
|
-
this.subscribe(`full_trajectory${
|
|
405
|
+
this.subscribe(`full_trajectory${getRealtimeModeSuffix(mode, RealtimeModes)}_${id}`, onMessage, onError, quiet);
|
|
402
406
|
}
|
|
403
407
|
/**
|
|
404
408
|
* Unsubscribe from full_trajectory channel
|
|
@@ -36,7 +36,6 @@ export declare type RealtimeLayerMixinOptions = OlLayerOptions & {
|
|
|
36
36
|
getRenderTimeIntervalByZoom?: (zoom: number, renderTimeIntervalByZoom: number[]) => number;
|
|
37
37
|
url?: string;
|
|
38
38
|
apiKey?: string;
|
|
39
|
-
prefix?: string;
|
|
40
39
|
projection?: string;
|
|
41
40
|
bbox?: (number | string)[];
|
|
42
41
|
buffer?: number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeLayerMixin.d.ts","sourceRoot":"","sources":["../../../src/common/mixins/RealtimeLayerMixin.ts"],"names":[],"mappings":"AAOA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAiB,MAAM,WAAW,CAAC;AAGvD,OAAO,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,0BAA0B,EAC1B,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,oBAAY,yBAAyB,GAAG,cAAc,GAAG;IACvD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC;IAC7B,yBAAyB,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAC1D,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,KAAK,CAAC,E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AE;kCAE9B,MAAM,EAAE;gBAE1B,OAAO;;;;uBAQC,SAAS;;8BAIH,MAAM,KAAK,WAAW,EAAE;6CAET,MAAM,KAAK,2BAA2B;4CAEvC,MAAM,KAAK,MAAM;gDAGxC,SAAS,kBACJ,OAAO,KACpB,IAAI;gDAGI,SAAS,kBACJ,OAAO,KACpB,IAAI;QAuGT;;;;WAIG;kCACuB,yBAAyB;yBAyKlC,MAAM;;;QAmEvB;;;WAGG;;;QAsBH;;;WAGG;;QAQH;;;;;;;;;;;;;WAaG;8CAEU,SAAS,kBACL,OAAO;QA8CxB;;;;;;;;;;;;;;WAcG;sCAEU,SAAS,GAAG,SAAS,iBACjB,OAAO,GAAG,SAAS;yBAwBnB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,MAAM;sBAyClD,YAAY;QAmB1B;;;;;WAKG;kCACsB,MAAM,GAAG,SAAS,GAAO,MAAM;QA0BxD;;;;WAIG;6BACkB,cAAc;QASnC;;;;;;;;WAQG;oEAGQ,0BAA0B;;;;;QAkCrC;;;;;WAKG;+BACoB,eAAe;;;;QAiBtC;;;;;;;;;;;WAWG;4DAGO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,QAClC,MAAM;QAed;;;;WAIG;;yCAa8B,kBAAkB,GAAG,eAAe;QAYrE;;;;;WAKG;;;QAgBH;;;;;WAKG;kCAEK,6BAA6B,kBAAkB,CAAC;QAgDxD;;;;;;WAMG;wCAEK,6BAA6B,eAAe,CAAC;QAQrD;;;;;;WAMG;iCAES,OAAO,EAAE,SACZ,gBAAgB;QAgBzB;;;;;;WAMG;iCAES,OAAO,EAAE,SACZ,gBAAgB;;MAkB5B;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -63,11 +63,14 @@ function RealtimeLayerMixin(Base) {
|
|
|
63
63
|
return class Mixin extends Base {
|
|
64
64
|
constructor(options) {
|
|
65
65
|
super(Object.assign({ hitTolerance: 10 }, options));
|
|
66
|
+
this.minZoomInterpolation = 8;
|
|
66
67
|
this.debug = options.debug || false;
|
|
67
68
|
this.mode = options.mode || RealtimeModes.TOPOGRAPHIC;
|
|
68
69
|
this.api = options.api || new RealtimeAPI(options);
|
|
69
70
|
this.tenant = options.tenant || ''; // sbb,sbh or sbm
|
|
70
|
-
|
|
71
|
+
if (!Number.isNaN(options.minZoomInterpolation)) {
|
|
72
|
+
this.minZoomInterpolation = options.minZoomInterpolation || 0; // Min zoom level from which trains positions are not interpolated.
|
|
73
|
+
}
|
|
71
74
|
this.format = new GeoJSON();
|
|
72
75
|
// MOTs by zoom
|
|
73
76
|
const allMots = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMapboxRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMapboxRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getMapboxRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMapboxRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAU,EAAE,WAAW,GACtB,cAAc,CAwFhB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { RealtimeMode } from '../../types';
|
|
1
|
+
import type { RealtimeMode, RealtimeTenant } from '../../types';
|
|
2
2
|
import type { RealtimeModesType } from '../../api/RealtimeAPI';
|
|
3
3
|
/**
|
|
4
4
|
* Get the websocket channel suffix, depending on the current mode.
|
|
5
5
|
* @param {String} mode Mode 'topographic' ou 'schematic'.
|
|
6
6
|
* @private
|
|
7
7
|
*/
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const getRealtimeModeSuffix: (mode: RealtimeMode, modes: RealtimeModesType, tenant?: RealtimeTenant) => string;
|
|
9
|
+
export default getRealtimeModeSuffix;
|
|
10
10
|
//# sourceMappingURL=getRealtimeModeSuffix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRealtimeModeSuffix.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getRealtimeModeSuffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"getRealtimeModeSuffix.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getRealtimeModeSuffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;GAIG;AACH,QAAA,MAAM,qBAAqB,SACnB,YAAY,SACX,iBAAiB,WACf,cAAc,KACtB,MAQF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -3,5 +3,11 @@
|
|
|
3
3
|
* @param {String} mode Mode 'topographic' ou 'schematic'.
|
|
4
4
|
* @private
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const getRealtimeModeSuffix = (mode, modes, tenant) => {
|
|
7
|
+
const schematicSuffix = ['', 'schematic'];
|
|
8
|
+
if (tenant) {
|
|
9
|
+
schematicSuffix.push(tenant);
|
|
10
|
+
}
|
|
11
|
+
return mode === modes.SCHEMATIC ? schematicSuffix.join('_') : '';
|
|
12
|
+
};
|
|
13
|
+
export default getRealtimeModeSuffix;
|
|
@@ -12,7 +12,11 @@ declare const RealtimeLayer_base: {
|
|
|
12
12
|
[key: string]: GeoJSONFeature;
|
|
13
13
|
} | undefined;
|
|
14
14
|
canvas?: import("../../types").AnyCanvas | undefined;
|
|
15
|
-
mode: import("../../types").RealtimeMode;
|
|
15
|
+
mode: import("../../types").RealtimeMode; /**
|
|
16
|
+
* Render the trajectories using current map's size, resolution and rotation.
|
|
17
|
+
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
18
|
+
* @overrides
|
|
19
|
+
*/
|
|
16
20
|
api: import("../../api/RealtimeAPI").default;
|
|
17
21
|
tenant: string;
|
|
18
22
|
time?: Date | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/mapbox/layers/RealtimeLayer.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EACL,YAAY,EACZ,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/mapbox/layers/RealtimeLayer.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EACL,YAAY,EACZ,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;;;;;;;;;kDAiKtD;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnKL;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAM,aAAc,SAAQ,kBAAY;gBAC1B,OAAO,KAAK;IAqBxB;;;;;;OAMG;IAEH,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM;IAuC/C;;OAEG;IACH,aAAa;IAkBb;;;;;;OAMG;IACH,KAAK;IAQL;;;;OAIG;IACH,IAAI;IASJ,MAAM;IASN;;;OAGG;IACH,kBAAkB,CAChB,GAAG,EAAE,QAAQ,CAAC,kBAAkB,GAAG,UAAU,CAAC,aAAa;IAQ7D;;;;OAIG;IAEH,kBAAkB,CAAC,aAAa,CAAC,EAAE,OAAe;IAuDlD;;OAEG;IACH,kBAAkB;IAIlB,0BAA0B,CACxB,UAAU,EAAE,UAAU,EACtB,OAAO,KAAK,GACX,OAAO,CAAC,2BAA2B,CAAC;IAQvC,kBAAkB;IAclB;;;;OAIG;IACH,eAAe,CACb,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxC,IAAI,EAAE,MAAM;IASd;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;IAUhE;;;;OAIG;IACH,MAAM;IAIN,0BAA0B,CACxB,SAAS,EAAE,SAAS,EACpB,aAAa,GAAE,OAAe;IAahC;;;;;OAKG;IACH,SAAS;IAQT;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU;CAOzB;AAED,eAAe,aAAa,CAAC"}
|
package/mbt.js
CHANGED
|
@@ -34164,8 +34164,14 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34164
34164
|
var debounceWebsocketMessages_default = debounceWebsocketMessages;
|
|
34165
34165
|
|
|
34166
34166
|
// src/common/utils/getRealtimeModeSuffix.ts
|
|
34167
|
-
var
|
|
34168
|
-
|
|
34167
|
+
var getRealtimeModeSuffix = (mode, modes, tenant) => {
|
|
34168
|
+
const schematicSuffix = ["", "schematic"];
|
|
34169
|
+
if (tenant) {
|
|
34170
|
+
schematicSuffix.push(tenant);
|
|
34171
|
+
}
|
|
34172
|
+
return mode === modes.SCHEMATIC ? schematicSuffix.join("_") : "";
|
|
34173
|
+
};
|
|
34174
|
+
var getRealtimeModeSuffix_default = getRealtimeModeSuffix;
|
|
34169
34175
|
|
|
34170
34176
|
// src/api/RealtimeAPI.ts
|
|
34171
34177
|
var RealtimeModes = {
|
|
@@ -34176,7 +34182,7 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34176
34182
|
var RealtimeAPI = class {
|
|
34177
34183
|
constructor(options = {}) {
|
|
34178
34184
|
this.defineProperties(options);
|
|
34179
|
-
this.
|
|
34185
|
+
this.tenant = options.tenant;
|
|
34180
34186
|
this.onOpen = this.onOpen.bind(this);
|
|
34181
34187
|
}
|
|
34182
34188
|
defineProperties(options) {
|
|
@@ -34295,9 +34301,9 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34295
34301
|
this.wsApi.subscribe({ channel }, onSuccess, onError, quiet);
|
|
34296
34302
|
}
|
|
34297
34303
|
unsubscribe(channel, suffix = "", onMessage) {
|
|
34298
|
-
const
|
|
34299
|
-
const suffixTopographic = getRealtimeModeSuffix_default(RealtimeModes.TOPOGRAPHIC, RealtimeModes);
|
|
34300
|
-
this.wsApi.unsubscribe(`${channel}${
|
|
34304
|
+
const suffixSchematic = getRealtimeModeSuffix_default(RealtimeModes.SCHEMATIC, RealtimeModes, this.tenant);
|
|
34305
|
+
const suffixTopographic = getRealtimeModeSuffix_default(RealtimeModes.TOPOGRAPHIC, RealtimeModes, this.tenant);
|
|
34306
|
+
this.wsApi.unsubscribe(`${channel}${suffixSchematic}${suffix || ""}`, onMessage);
|
|
34301
34307
|
this.wsApi.unsubscribe(`${channel}${suffixTopographic}${suffix || ""}`, onMessage);
|
|
34302
34308
|
}
|
|
34303
34309
|
subscribeDepartures(stationId, onMessage, onError = () => {
|
|
@@ -34309,14 +34315,16 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34309
34315
|
}
|
|
34310
34316
|
subscribeDisruptions(onMessage, onError = () => {
|
|
34311
34317
|
}, quiet = false) {
|
|
34312
|
-
this.
|
|
34318
|
+
const channel = [this.tenant, "newsticker"];
|
|
34319
|
+
this.subscribe(channel.join("_"), onMessage, onError, quiet);
|
|
34313
34320
|
}
|
|
34314
34321
|
unsubscribeDisruptions(onMessage) {
|
|
34315
|
-
this.
|
|
34322
|
+
const channel = [this.tenant, "newsticker"];
|
|
34323
|
+
this.unsubscribe(channel.join("_"), "", onMessage);
|
|
34316
34324
|
}
|
|
34317
34325
|
getStation(uic, mode) {
|
|
34318
34326
|
const params = {
|
|
34319
|
-
channel: `station${getRealtimeModeSuffix_default(mode, RealtimeModes)}`,
|
|
34327
|
+
channel: `station${getRealtimeModeSuffix_default(mode, RealtimeModes, this.tenant)}`,
|
|
34320
34328
|
args: uic
|
|
34321
34329
|
};
|
|
34322
34330
|
return new Promise((resolve, reject) => {
|
|
@@ -34326,13 +34334,13 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34326
34334
|
getStations(mode, timeout = 100) {
|
|
34327
34335
|
return new Promise((resolve) => {
|
|
34328
34336
|
this.wsApi.get({
|
|
34329
|
-
channel: `station${getRealtimeModeSuffix_default(mode, RealtimeModes)}`
|
|
34337
|
+
channel: `station${getRealtimeModeSuffix_default(mode, RealtimeModes, this.tenant)}`
|
|
34330
34338
|
}, debounceWebsocketMessages_default(resolve, void 0, timeout));
|
|
34331
34339
|
});
|
|
34332
34340
|
}
|
|
34333
34341
|
subscribeStations(mode, onMessage, onError = () => {
|
|
34334
34342
|
}, quiet = false) {
|
|
34335
|
-
this.subscribe(`station${getRealtimeModeSuffix_default(mode, RealtimeModes)}`, onMessage, onError, quiet);
|
|
34343
|
+
this.subscribe(`station${getRealtimeModeSuffix_default(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
34336
34344
|
}
|
|
34337
34345
|
unsubscribeStations(onMessage) {
|
|
34338
34346
|
this.unsubscribe("station", "", onMessage);
|
|
@@ -34347,7 +34355,7 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34347
34355
|
subscribeTrajectory(mode, onMessage, onError = () => {
|
|
34348
34356
|
}, quiet = false) {
|
|
34349
34357
|
this.unsubscribeTrajectory(onMessage);
|
|
34350
|
-
this.subscribe(`trajectory${getRealtimeModeSuffix_default(mode, RealtimeModes)}`, onMessage, onError, quiet);
|
|
34358
|
+
this.subscribe(`trajectory${getRealtimeModeSuffix_default(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
34351
34359
|
}
|
|
34352
34360
|
unsubscribeTrajectory(onMessage) {
|
|
34353
34361
|
this.unsubscribe(`trajectory`, "", onMessage);
|
|
@@ -34355,13 +34363,15 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
34355
34363
|
subscribeDeletedVehicles(mode, onMessage, onError = () => {
|
|
34356
34364
|
}, quiet = false) {
|
|
34357
34365
|
this.unsubscribeDeletedVehicles(onMessage);
|
|
34358
|
-
this.subscribe(`deleted_vehicles${getRealtimeModeSuffix_default(mode, RealtimeModes)}`, onMessage, onError, quiet);
|
|
34366
|
+
this.subscribe(`deleted_vehicles${getRealtimeModeSuffix_default(mode, RealtimeModes, this.tenant)}`, onMessage, onError, quiet);
|
|
34359
34367
|
}
|
|
34360
34368
|
unsubscribeDeletedVehicles(onMessage) {
|
|
34361
34369
|
this.unsubscribe("deleted_vehicles", "", onMessage);
|
|
34362
34370
|
}
|
|
34363
34371
|
getFullTrajectory(id, mode, generalizationLevel) {
|
|
34364
|
-
const channel = [
|
|
34372
|
+
const channel = [
|
|
34373
|
+
`full_trajectory${getRealtimeModeSuffix_default(mode, RealtimeModes)}`
|
|
34374
|
+
];
|
|
34365
34375
|
if (id) {
|
|
34366
34376
|
channel.push(id);
|
|
34367
34377
|
}
|
|
@@ -49132,11 +49142,14 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
49132
49142
|
hitTolerance: 10,
|
|
49133
49143
|
...options
|
|
49134
49144
|
});
|
|
49145
|
+
this.minZoomInterpolation = 8;
|
|
49135
49146
|
this.debug = options.debug || false;
|
|
49136
49147
|
this.mode = options.mode || RealtimeModes.TOPOGRAPHIC;
|
|
49137
49148
|
this.api = options.api || new RealtimeAPI_default(options);
|
|
49138
49149
|
this.tenant = options.tenant || "";
|
|
49139
|
-
|
|
49150
|
+
if (!Number.isNaN(options.minZoomInterpolation)) {
|
|
49151
|
+
this.minZoomInterpolation = options.minZoomInterpolation || 0;
|
|
49152
|
+
}
|
|
49140
49153
|
this.format = new GeoJSON_default();
|
|
49141
49154
|
const allMots = [
|
|
49142
49155
|
"tram",
|