mobility-toolbox-js 2.0.0-beta.71 → 2.0.0-beta.72
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/common/mixins/RealtimeLayerMixin.d.ts +8 -4
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -1
- package/common/mixins/RealtimeLayerMixin.js +9 -1
- package/common/utils/getVehiclePosition.d.ts.map +1 -1
- package/common/utils/getVehiclePosition.js +5 -1
- package/mapbox/layers/RealtimeLayer.d.ts +2 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
- package/mbt.js +16 -3
- package/mbt.js.map +2 -2
- package/mbt.min.js +2 -2
- package/mbt.min.js.map +3 -3
- package/ol/layers/RealtimeLayer.d.ts +3 -1
- package/ol/layers/RealtimeLayer.d.ts.map +1 -1
- package/ol/layers/RealtimeLayer.js +3 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { EventsKey } from 'ol/events';
|
|
|
3
3
|
import { Coordinate } from 'ol/coordinate';
|
|
4
4
|
import { Feature } from 'ol';
|
|
5
5
|
import { RealtimeAPI } from '../../api';
|
|
6
|
-
import { AnyCanvas, AnyLayerClass, AnyMap, AnyRealtimeLayer, LayerGetFeatureInfoOptions, RealtimeGeneralizationLevel, RealtimeMode, RealtimeMot, RealtimeRenderState, RealtimeStyleFunction, RealtimeStyleOptions, RealtimeTenant, RealtimeTrainId, ViewState } from '../../types';
|
|
6
|
+
import { AnyCanvas, AnyLayerClass, AnyMap, AnyRealtimeLayer, LayerGetFeatureInfoOptions, RealtimeGeneralizationLevel, RealtimeMode, RealtimeMot, RealtimeRenderState, RealtimeStyleFunction, RealtimeStyleOptions, RealtimeTenant, RealtimeTrainId, ViewState, AnyLayer } from '../../types';
|
|
7
7
|
import { RealtimeTrajectory } from '../../api/typedefs';
|
|
8
8
|
import { WebSocketAPIMessageEventData } from '../api/WebSocketAPI';
|
|
9
9
|
import type { OlLayerOptions } from '../../ol/layers/Layer';
|
|
@@ -34,6 +34,8 @@ export declare type RealtimeLayerMixinOptions = OlLayerOptions & {
|
|
|
34
34
|
getMotsByZoom: (zoom: number, motsByZoom: RealtimeMot[][]) => RealtimeMot[];
|
|
35
35
|
getGeneralizationLevelByZoom?: (zoom: number, generalizationLevelByZoom: RealtimeGeneralizationLevel[]) => RealtimeGeneralizationLevel;
|
|
36
36
|
getRenderTimeIntervalByZoom?: (zoom: number, renderTimeIntervalByZoom: number[]) => number;
|
|
37
|
+
onStart?: (realtimeLayer: AnyRealtimeLayer) => void;
|
|
38
|
+
onStop?: (realtimeLayer: AnyRealtimeLayer) => void;
|
|
37
39
|
url?: string;
|
|
38
40
|
apiKey?: string;
|
|
39
41
|
prefix?: string;
|
|
@@ -45,7 +47,7 @@ export declare type RealtimeLayerMixinOptions = OlLayerOptions & {
|
|
|
45
47
|
/**
|
|
46
48
|
* RealtimeLayerInterface.
|
|
47
49
|
*/
|
|
48
|
-
export declare class
|
|
50
|
+
export declare class Function {
|
|
49
51
|
/**
|
|
50
52
|
* Start the clock.
|
|
51
53
|
*/
|
|
@@ -95,8 +97,8 @@ declare function RealtimeLayerMixin<T extends AnyLayerClass>(Base: T): {
|
|
|
95
97
|
time?: Date | undefined;
|
|
96
98
|
live?: boolean | undefined;
|
|
97
99
|
speed?: number | undefined;
|
|
98
|
-
filter?: Function | undefined;
|
|
99
|
-
sort?: Function | undefined;
|
|
100
|
+
filter?: globalThis.Function | undefined;
|
|
101
|
+
sort?: globalThis.Function | undefined;
|
|
100
102
|
style?: RealtimeStyleFunction | undefined;
|
|
101
103
|
styleOptions?: RealtimeStyleOptions | undefined;
|
|
102
104
|
pixelRatio?: number | undefined;
|
|
@@ -124,6 +126,8 @@ declare function RealtimeLayerMixin<T extends AnyLayerClass>(Base: T): {
|
|
|
124
126
|
getRenderTimeIntervalByZoom: (zoom: number) => number;
|
|
125
127
|
throttleRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean) => void;
|
|
126
128
|
debounceRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean) => void;
|
|
129
|
+
onStart?: ((realtimeLayer: AnyLayer) => void) | undefined;
|
|
130
|
+
onStop?: ((realtimeLayer: AnyLayer) => void) | undefined;
|
|
127
131
|
/**
|
|
128
132
|
* Define layer's properties.
|
|
129
133
|
*
|
|
@@ -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,
|
|
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,E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';
|
|
|
16
16
|
/**
|
|
17
17
|
* RealtimeLayerInterface.
|
|
18
18
|
*/
|
|
19
|
-
export class
|
|
19
|
+
export class Function {
|
|
20
20
|
/**
|
|
21
21
|
* Start the clock.
|
|
22
22
|
*/
|
|
@@ -63,6 +63,8 @@ function RealtimeLayerMixin(Base) {
|
|
|
63
63
|
this.tenant = options.tenant || ''; // sbb,sbh or sbm
|
|
64
64
|
this.minZoomInterpolation = options.minZoomInterpolation || 8; // Min zoom level from which trains positions are not interpolated.
|
|
65
65
|
this.format = new GeoJSON();
|
|
66
|
+
this.onStart = options.onStart;
|
|
67
|
+
this.onStop = options.onStop;
|
|
66
68
|
// MOTs by zoom
|
|
67
69
|
const allMots = [
|
|
68
70
|
'tram',
|
|
@@ -353,6 +355,9 @@ function RealtimeLayerMixin(Base) {
|
|
|
353
355
|
// @ts-ignore function without parameters defined by subclasses
|
|
354
356
|
this.setBbox();
|
|
355
357
|
}
|
|
358
|
+
if (this.onStart) {
|
|
359
|
+
this.onStart(this);
|
|
360
|
+
}
|
|
356
361
|
}
|
|
357
362
|
/**
|
|
358
363
|
* Start the clock.
|
|
@@ -375,6 +380,9 @@ function RealtimeLayerMixin(Base) {
|
|
|
375
380
|
this.api.unsubscribeTrajectory(this.onTrajectoryMessage);
|
|
376
381
|
this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage);
|
|
377
382
|
this.api.close();
|
|
383
|
+
if (this.onStop) {
|
|
384
|
+
this.onStop(this);
|
|
385
|
+
}
|
|
378
386
|
}
|
|
379
387
|
/**
|
|
380
388
|
* Stop the clock.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVehiclePosition.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getVehiclePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,QACjB,MAAM,6CAEI,OAAO,KACrB,
|
|
1
|
+
{"version":3,"file":"getVehiclePosition.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getVehiclePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,QACjB,MAAM,6CAEI,OAAO,KACrB,eAoEF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -9,10 +9,14 @@ import { LineString } from 'ol/geom';
|
|
|
9
9
|
*/
|
|
10
10
|
const getVehiclePosition = (now, trajectory, noInterpolate) => {
|
|
11
11
|
const { time_intervals: timeIntervals, olGeometry, coordinate, } = trajectory.properties;
|
|
12
|
-
const {
|
|
12
|
+
const { coordinates } = trajectory.geometry;
|
|
13
|
+
let { type } = trajectory.geometry;
|
|
13
14
|
let geometry = olGeometry;
|
|
14
15
|
let coord;
|
|
15
16
|
let rotation;
|
|
17
|
+
if (olGeometry) {
|
|
18
|
+
type = geometry.getType();
|
|
19
|
+
}
|
|
16
20
|
if (noInterpolate && coordinate) {
|
|
17
21
|
coord = coordinate;
|
|
18
22
|
}
|
|
@@ -47,6 +47,8 @@ declare const RealtimeLayer_base: {
|
|
|
47
47
|
getRenderTimeIntervalByZoom: (zoom: number) => number;
|
|
48
48
|
throttleRenderTrajectories: (viewState: import("../../types").ViewState, noInterpolate?: boolean | undefined) => void;
|
|
49
49
|
debounceRenderTrajectories: (viewState: import("../../types").ViewState, noInterpolate?: boolean | undefined) => void;
|
|
50
|
+
onStart?: ((realtimeLayer: any) => void) | undefined;
|
|
51
|
+
onStop?: ((realtimeLayer: any) => void) | undefined;
|
|
50
52
|
defineProperties(options: import("../../common/mixins/RealtimeLayerMixin").RealtimeLayerMixinOptions): void;
|
|
51
53
|
attachToMap(map: any): void;
|
|
52
54
|
detachFromMap(): void;
|
|
@@ -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,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,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,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7D;;;;;;;;;;;;;;;;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
|
@@ -37985,10 +37985,14 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
37985
37985
|
olGeometry,
|
|
37986
37986
|
coordinate
|
|
37987
37987
|
} = trajectory.properties;
|
|
37988
|
-
const {
|
|
37988
|
+
const { coordinates: coordinates2 } = trajectory.geometry;
|
|
37989
|
+
let { type } = trajectory.geometry;
|
|
37989
37990
|
let geometry = olGeometry;
|
|
37990
37991
|
let coord;
|
|
37991
37992
|
let rotation;
|
|
37993
|
+
if (olGeometry) {
|
|
37994
|
+
type = geometry.getType();
|
|
37995
|
+
}
|
|
37992
37996
|
if (noInterpolate && coordinate) {
|
|
37993
37997
|
coord = coordinate;
|
|
37994
37998
|
} else if (type === "Point") {
|
|
@@ -49647,6 +49651,8 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
49647
49651
|
this.tenant = options.tenant || "";
|
|
49648
49652
|
this.minZoomInterpolation = options.minZoomInterpolation || 8;
|
|
49649
49653
|
this.format = new GeoJSON_default();
|
|
49654
|
+
this.onStart = options.onStart;
|
|
49655
|
+
this.onStop = options.onStop;
|
|
49650
49656
|
const allMots = [
|
|
49651
49657
|
"tram",
|
|
49652
49658
|
"subway",
|
|
@@ -49915,6 +49921,9 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
49915
49921
|
if (this.isUpdateBboxOnMoveEnd) {
|
|
49916
49922
|
this.setBbox();
|
|
49917
49923
|
}
|
|
49924
|
+
if (this.onStart) {
|
|
49925
|
+
this.onStart(this);
|
|
49926
|
+
}
|
|
49918
49927
|
}
|
|
49919
49928
|
startUpdateTime() {
|
|
49920
49929
|
this.stopUpdateTime();
|
|
@@ -49933,6 +49942,9 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
49933
49942
|
this.api.unsubscribeTrajectory(this.onTrajectoryMessage);
|
|
49934
49943
|
this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage);
|
|
49935
49944
|
this.api.close();
|
|
49945
|
+
if (this.onStop) {
|
|
49946
|
+
this.onStop(this);
|
|
49947
|
+
}
|
|
49936
49948
|
}
|
|
49937
49949
|
stopUpdateTime() {
|
|
49938
49950
|
if (this.updateTimeInterval) {
|
|
@@ -50506,14 +50518,15 @@ uniform ${i3} ${o3} u_${a3};
|
|
|
50506
50518
|
super.setBbox(newExtent, newZoom);
|
|
50507
50519
|
}
|
|
50508
50520
|
highlightTrajectory(id) {
|
|
50509
|
-
this.api.getFullTrajectory(id, this.mode, this.generalizationLevel).then((data) => {
|
|
50521
|
+
return this.api.getFullTrajectory(id, this.mode, this.generalizationLevel).then((data) => {
|
|
50510
50522
|
const fullTrajectory = data.content;
|
|
50511
50523
|
this.vectorLayer.getSource().clear();
|
|
50512
50524
|
if (!fullTrajectory || !fullTrajectory.features || !fullTrajectory.features.length) {
|
|
50513
|
-
return;
|
|
50525
|
+
return void 0;
|
|
50514
50526
|
}
|
|
50515
50527
|
const features = format.readFeatures(fullTrajectory);
|
|
50516
50528
|
this.vectorLayer.getSource().addFeatures(features);
|
|
50529
|
+
return features;
|
|
50517
50530
|
});
|
|
50518
50531
|
}
|
|
50519
50532
|
clone(newOptions) {
|