mobility-toolbox-js 2.0.0-beta.46 → 2.0.0-beta.47
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 +80 -64
- package/api/RealtimeAPI.d.ts.map +1 -1
- package/api/RealtimeAPI.js +58 -45
- package/api/RoutingAPI.d.ts +2 -2
- package/api/RoutingAPI.d.ts.map +1 -1
- package/api/RoutingAPI.js +1 -1
- package/api/StopsAPI.d.ts +14 -12
- package/api/StopsAPI.d.ts.map +1 -1
- package/api/StopsAPI.js +7 -9
- package/api/typedefs.d.ts +84 -10
- package/api/typedefs.d.ts.map +1 -1
- package/api/typedefs.js +3 -1
- package/common/api/WebSocketAPI.d.ts +80 -24
- package/common/api/WebSocketAPI.d.ts.map +1 -1
- package/common/api/WebSocketAPI.js +28 -16
- package/common/controls/{Control.d.ts → ControlCommon.d.ts} +21 -19
- package/common/controls/ControlCommon.d.ts.map +1 -0
- package/common/controls/{Control.js → ControlCommon.js} +21 -8
- package/common/controls/CopyrightControlCommon.d.ts +13 -0
- package/common/controls/CopyrightControlCommon.d.ts.map +1 -0
- package/common/controls/CopyrightControlCommon.js +34 -0
- package/common/controls/StopFinderControlCommon.d.ts +54 -0
- package/common/controls/StopFinderControlCommon.d.ts.map +1 -0
- package/common/{mixins/StopFinderMixin.js → controls/StopFinderControlCommon.js} +25 -38
- package/common/layers/{Layer.d.ts → LayerCommon.d.ts} +34 -21
- package/common/layers/LayerCommon.d.ts.map +1 -0
- package/common/layers/{Layer.js → LayerCommon.js} +15 -9
- package/common/mixins/RealtimeLayerMixin.d.ts +243 -19
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -1
- package/common/mixins/RealtimeLayerMixin.js +598 -569
- package/common/mixins/UserInteractionsLayerMixin.d.ts +18 -8
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -1
- package/common/mixins/UserInteractionsLayerMixin.js +170 -159
- package/common/styles/realtimeDefaultStyle.d.ts +30 -9
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -1
- package/common/styles/realtimeDefaultStyle.js +41 -17
- package/common/styles/realtimeDelayStyle.d.ts +3 -2
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -1
- package/common/styles/realtimeSimpleStyle.d.ts +1 -1
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -1
- package/common/styles/realtimeSimpleStyle.js +9 -7
- package/common/typedefs.d.ts +64 -3
- package/common/typedefs.d.ts.map +1 -1
- package/common/typedefs.js +34 -4
- package/common/utils/cleanStopTime.d.ts +3 -2
- package/common/utils/cleanStopTime.d.ts.map +1 -1
- package/common/utils/cleanStopTime.js +0 -3
- package/common/utils/compareDepartures.d.ts +6 -4
- package/common/utils/compareDepartures.d.ts.map +1 -1
- package/common/utils/compareDepartures.js +3 -2
- package/common/utils/createCanvas.d.ts +3 -2
- package/common/utils/createCanvas.d.ts.map +1 -1
- package/common/utils/createTrackerFilters.d.ts +3 -2
- package/common/utils/createTrackerFilters.d.ts.map +1 -1
- package/common/utils/createTrackerFilters.js +3 -3
- package/common/utils/getLayersAsFlatArray.d.ts +1 -1
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -1
- package/common/utils/getLayersAsFlatArray.js +1 -0
- package/common/utils/getMapboxMapCopyrights.d.ts +13 -3
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -1
- package/common/utils/getMapboxMapCopyrights.js +10 -4
- package/common/utils/getMapboxRender.d.ts +3 -1
- package/common/utils/getMapboxRender.d.ts.map +1 -1
- package/common/utils/getMapboxRender.js +1 -2
- package/common/utils/getVehiclePosition.d.ts +1 -1
- package/common/utils/getVehiclePosition.d.ts.map +1 -1
- package/common/utils/removeDuplicate.d.ts +2 -2
- package/common/utils/removeDuplicate.d.ts.map +1 -1
- package/common/utils/renderTrajectories.d.ts +3 -6
- package/common/utils/renderTrajectories.d.ts.map +1 -1
- package/common/utils/renderTrajectories.js +17 -8
- package/common/utils/trackerConfig.d.ts.map +1 -1
- package/common/utils/trackerConfig.js +3 -0
- package/mapbox/controls/CopyrightControl.d.ts +6 -8
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -1
- package/mapbox/controls/CopyrightControl.js +3 -8
- package/mapbox/layers/Layer.js +1 -1
- package/mapbox/layers/RealtimeLayer.d.ts +1 -1
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
- package/mapbox/utils.d.ts +1 -1
- package/mapbox/utils.d.ts.map +1 -1
- package/mbt.js +824 -702
- package/mbt.js.map +3 -3
- package/mbt.min.js +84 -84
- package/mbt.min.js.map +3 -3
- package/ol/controls/CopyrightControl.d.ts +10 -10
- package/ol/controls/CopyrightControl.d.ts.map +1 -1
- package/ol/controls/CopyrightControl.js +8 -8
- package/ol/controls/RoutingControl.d.ts +10 -3
- package/ol/controls/RoutingControl.d.ts.map +1 -1
- package/ol/controls/RoutingControl.js +2 -2
- package/ol/controls/StopFinderControl.d.ts +5 -7
- package/ol/controls/StopFinderControl.d.ts.map +1 -1
- package/ol/controls/StopFinderControl.js +4 -8
- package/ol/layers/Layer.d.ts +57 -9
- package/ol/layers/Layer.d.ts.map +1 -1
- package/ol/layers/Layer.js +17 -8
- package/ol/layers/MapGlLayer.d.ts +67 -0
- package/ol/layers/MapGlLayer.d.ts.map +1 -0
- package/{common/mixins/MapboxLayerMixin.js → ol/layers/MapGlLayer.js} +66 -44
- package/ol/layers/MapboxLayer.d.ts +15 -17
- package/ol/layers/MapboxLayer.d.ts.map +1 -1
- package/ol/layers/MapboxLayer.js +10 -7
- package/ol/layers/MapboxStyleLayer.d.ts +6 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -1
- package/ol/layers/MaplibreLayer.d.ts +4 -4
- package/ol/layers/MaplibreLayer.d.ts.map +1 -1
- package/ol/layers/MaplibreLayer.js +2 -3
- package/ol/layers/RealtimeLayer.d.ts +106 -30
- package/ol/layers/RealtimeLayer.d.ts.map +1 -1
- package/ol/layers/RealtimeLayer.js +22 -14
- package/ol/styles/fullTrajectoryStyle.d.ts +3 -2
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -1
- package/package.json +15 -9
- package/types/common.d.ts +111 -0
- package/types/index.d.ts +1 -0
- package/types/realtime.d.ts +290 -9
- package/api/RealtimeAPI.test.d.ts +0 -2
- package/api/RealtimeAPI.test.d.ts.map +0 -1
- package/api/RealtimeAPI.test.js +0 -67
- package/api/RoutingAPI.test.d.ts +0 -2
- package/api/RoutingAPI.test.d.ts.map +0 -1
- package/api/RoutingAPI.test.js +0 -29
- package/api/StopsAPI.test.d.ts +0 -2
- package/api/StopsAPI.test.d.ts.map +0 -1
- package/api/StopsAPI.test.js +0 -26
- package/common/api/HttpAPI.test.d.ts +0 -2
- package/common/api/HttpAPI.test.d.ts.map +0 -1
- package/common/api/HttpAPI.test.js +0 -54
- package/common/api/WebSocketAPI.test.d.ts +0 -2
- package/common/api/WebSocketAPI.test.d.ts.map +0 -1
- package/common/api/WebSocketAPI.test.js +0 -380
- package/common/controls/Control.d.ts.map +0 -1
- package/common/controls/Control.test.d.ts +0 -2
- package/common/controls/Control.test.d.ts.map +0 -1
- package/common/controls/Control.test.js +0 -89
- package/common/layers/Layer.d.ts.map +0 -1
- package/common/layers/Layer.test.d.ts +0 -2
- package/common/layers/Layer.test.d.ts.map +0 -1
- package/common/layers/Layer.test.js +0 -137
- package/common/mixins/CopyrightMixin.d.ts +0 -22
- package/common/mixins/CopyrightMixin.d.ts.map +0 -1
- package/common/mixins/CopyrightMixin.js +0 -43
- package/common/mixins/MapboxLayerMixin.d.ts +0 -27
- package/common/mixins/MapboxLayerMixin.d.ts.map +0 -1
- package/common/mixins/StopFinderMixin.d.ts +0 -40
- package/common/mixins/StopFinderMixin.d.ts.map +0 -1
- package/common/mixins/UserInteractionsLayerMixin.test.d.ts +0 -2
- package/common/mixins/UserInteractionsLayerMixin.test.d.ts.map +0 -1
- package/common/mixins/UserInteractionsLayerMixin.test.js +0 -214
- package/common/utils/createTrackerFilters.test.d.ts +0 -2
- package/common/utils/createTrackerFilters.test.d.ts.map +0 -1
- package/common/utils/createTrackerFilters.test.js +0 -79
- package/common/utils/getMapboxMapCopyrights.test.d.ts +0 -2
- package/common/utils/getMapboxMapCopyrights.test.d.ts.map +0 -1
- package/common/utils/getMapboxMapCopyrights.test.js +0 -40
- package/common/utils/removeDuplicate.test.d.ts +0 -2
- package/common/utils/removeDuplicate.test.d.ts.map +0 -1
- package/common/utils/removeDuplicate.test.js +0 -19
- package/common/utils/timeUtils.test.d.ts +0 -2
- package/common/utils/timeUtils.test.d.ts.map +0 -1
- package/common/utils/timeUtils.test.js +0 -10
- package/common/utils/trackerConfig.test.d.ts +0 -2
- package/common/utils/trackerConfig.test.d.ts.map +0 -1
- package/common/utils/trackerConfig.test.js +0 -23
- package/mapbox/layers/Layer.test.d.ts +0 -2
- package/mapbox/layers/Layer.test.d.ts.map +0 -1
- package/mapbox/layers/Layer.test.js +0 -204
- package/mapbox/layers/RealtimeLayer.test.d.ts +0 -2
- package/mapbox/layers/RealtimeLayer.test.d.ts.map +0 -1
- package/mapbox/layers/RealtimeLayer.test.js +0 -10
- package/ol/controls/CopyrightControl.test.d.ts +0 -2
- package/ol/controls/CopyrightControl.test.d.ts.map +0 -1
- package/ol/controls/CopyrightControl.test.js +0 -177
- package/ol/controls/RoutingControl.test.d.ts +0 -2
- package/ol/controls/RoutingControl.test.d.ts.map +0 -1
- package/ol/controls/RoutingControl.test.js +0 -150
- package/ol/controls/StopFinderControl.test.d.ts +0 -2
- package/ol/controls/StopFinderControl.test.d.ts.map +0 -1
- package/ol/controls/StopFinderControl.test.js +0 -49
- package/ol/layers/Layer.test.d.ts +0 -2
- package/ol/layers/Layer.test.d.ts.map +0 -1
- package/ol/layers/Layer.test.js +0 -196
- package/ol/layers/MapboxLayer.test.d.ts +0 -2
- package/ol/layers/MapboxLayer.test.d.ts.map +0 -1
- package/ol/layers/MapboxLayer.test.js +0 -164
- package/ol/layers/MapboxStyleLayer.test.d.ts +0 -2
- package/ol/layers/MapboxStyleLayer.test.d.ts.map +0 -1
- package/ol/layers/MapboxStyleLayer.test.js +0 -232
- package/ol/layers/RealtimeLayer.test.d.ts +0 -2
- package/ol/layers/RealtimeLayer.test.d.ts.map +0 -1
- package/ol/layers/RealtimeLayer.test.js +0 -71
- package/ol/layers/RoutingLayer.test.d.ts +0 -2
- package/ol/layers/RoutingLayer.test.d.ts.map +0 -1
- package/ol/layers/RoutingLayer.test.js +0 -39
- package/ol/layers/VectorLayer.test.d.ts +0 -2
- package/ol/layers/VectorLayer.test.d.ts.map +0 -1
- package/ol/layers/VectorLayer.test.js +0 -87
- package/ol/layers/WMSLayer.test.d.ts +0 -2
- package/ol/layers/WMSLayer.test.d.ts.map +0 -1
- package/ol/layers/WMSLayer.test.js +0 -66
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Map } from 'mapbox-gl';
|
|
2
|
+
import type OlMap from 'ol/Map';
|
|
3
|
+
import MapGlLayer, { MapGlLayerOptions } from './MapGlLayer';
|
|
1
4
|
/**
|
|
2
5
|
* A class representing Mapboxlayer to display on BasicMap
|
|
3
6
|
*
|
|
@@ -12,31 +15,26 @@
|
|
|
12
15
|
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
13
16
|
* @extends {Layer}
|
|
14
17
|
*/
|
|
15
|
-
export default class MapboxLayer extends
|
|
18
|
+
export default class MapboxLayer extends MapGlLayer {
|
|
19
|
+
renderState?: {};
|
|
20
|
+
tabIndex?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the layer and listen to feature clicks.
|
|
23
|
+
* @param {ol/Map~Map} map
|
|
24
|
+
*/
|
|
25
|
+
attachToMap(map: OlMap): void;
|
|
16
26
|
/**
|
|
17
27
|
* Create the mapbox map.
|
|
18
28
|
* @private
|
|
19
29
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
center: any[];
|
|
24
|
-
zoom: null;
|
|
25
|
-
rotation: null;
|
|
26
|
-
visible: null;
|
|
27
|
-
opacity: null;
|
|
28
|
-
size: number[];
|
|
29
|
-
} | undefined;
|
|
30
|
-
/** @ignore */
|
|
31
|
-
copyrights: any[] | undefined;
|
|
32
|
-
getOlLayerRender(): (frameState: any) => any;
|
|
33
|
-
getMapboxMapClass(): any;
|
|
30
|
+
loadMbMap(): void;
|
|
31
|
+
getOlLayerRender(): (frameState: import("ol/PluggableMap").FrameState) => HTMLElement;
|
|
32
|
+
getMapboxMapClass(): typeof Map;
|
|
34
33
|
/**
|
|
35
34
|
* Create a copy of the MapboxLayer.
|
|
36
35
|
* @param {Object} newOptions Options to override
|
|
37
36
|
* @return {MapboxLayer} A MapboxLayer
|
|
38
37
|
*/
|
|
39
|
-
clone(newOptions:
|
|
38
|
+
clone(newOptions: MapGlLayerOptions): MapboxLayer;
|
|
40
39
|
}
|
|
41
|
-
import Layer from "./Layer";
|
|
42
40
|
//# sourceMappingURL=MapboxLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapboxLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxLayer.
|
|
1
|
+
{"version":3,"file":"MapboxLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC,OAAO,UAAU,EAAE,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IACjD,WAAW,CAAC,EAAE,EAAE,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,KAAK;IAsBtB;;;OAGG;IACH,SAAS;IAoDT,gBAAgB;IAKhB,iBAAiB;IAIjB;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,iBAAiB;CAGpC"}
|
package/ol/layers/MapboxLayer.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
import { Map } from 'mapbox-gl';
|
|
3
|
-
import Layer from './Layer';
|
|
4
|
-
import mixin from '../../common/mixins/MapboxLayerMixin';
|
|
5
3
|
import { getMapboxMapCopyrights, getMapboxRender } from '../../common/utils';
|
|
4
|
+
import MapGlLayer from './MapGlLayer';
|
|
6
5
|
/**
|
|
7
6
|
* A class representing Mapboxlayer to display on BasicMap
|
|
8
7
|
*
|
|
@@ -17,7 +16,7 @@ import { getMapboxMapCopyrights, getMapboxRender } from '../../common/utils';
|
|
|
17
16
|
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
18
17
|
* @extends {Layer}
|
|
19
18
|
*/
|
|
20
|
-
export default class MapboxLayer extends
|
|
19
|
+
export default class MapboxLayer extends MapGlLayer {
|
|
21
20
|
/**
|
|
22
21
|
* Initialize the layer and listen to feature clicks.
|
|
23
22
|
* @param {ol/Map~Map} map
|
|
@@ -45,9 +44,10 @@ export default class MapboxLayer extends mixin(Layer) {
|
|
|
45
44
|
* @private
|
|
46
45
|
*/
|
|
47
46
|
loadMbMap() {
|
|
47
|
+
var _a;
|
|
48
48
|
// If the map hasn't been resized, the center could be [NaN,NaN].
|
|
49
49
|
// We set default good value for the mapbox map, to avoid the app crashes.
|
|
50
|
-
let [x, y] = this.map.getView().getCenter();
|
|
50
|
+
let [x, y] = ((_a = this.map) === null || _a === void 0 ? void 0 : _a.getView().getCenter()) || [];
|
|
51
51
|
if (!x || !y) {
|
|
52
52
|
x = 0;
|
|
53
53
|
y = 0;
|
|
@@ -69,16 +69,19 @@ export default class MapboxLayer extends mixin(Layer) {
|
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
this.mbMap.once('load', () => {
|
|
72
|
-
var _a;
|
|
72
|
+
var _a, _b;
|
|
73
|
+
if (!this.mbMap) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
73
76
|
this.mbMap.resize();
|
|
74
77
|
/** @ignore */
|
|
75
78
|
this.copyrights = getMapboxMapCopyrights(this.mbMap) || [];
|
|
76
|
-
(_a = this.olLayer.getSource()) === null ||
|
|
79
|
+
(_b = (_a = this.olLayer) === null || _a === void 0 ? void 0 : _a.getSource()) === null || _b === void 0 ? void 0 : _b.setAttributions(this.copyrights);
|
|
77
80
|
});
|
|
78
81
|
const mapboxCanvas = this.mbMap.getCanvas();
|
|
79
82
|
if (mapboxCanvas) {
|
|
80
83
|
if (this.options.tabIndex) {
|
|
81
|
-
mapboxCanvas.setAttribute('tabindex', this.options.tabIndex);
|
|
84
|
+
mapboxCanvas.setAttribute('tabindex', `${this.options.tabIndex}`);
|
|
82
85
|
}
|
|
83
86
|
else {
|
|
84
87
|
// With a tabIndex='-1' the mouse events works but the map is not focused when we click on it
|
|
@@ -91,6 +91,12 @@ declare class MapboxStyleLayer extends Layer {
|
|
|
91
91
|
onLoad(): void;
|
|
92
92
|
/** @private */
|
|
93
93
|
private addDynamicFilters;
|
|
94
|
+
/**
|
|
95
|
+
* Initialize the layer.
|
|
96
|
+
* @param {mapboxgl.Map} map the mapbox map.
|
|
97
|
+
* @override
|
|
98
|
+
*/
|
|
99
|
+
override attachToMap(map: mapboxgl.Map): void;
|
|
94
100
|
/**
|
|
95
101
|
* Terminate the layer.
|
|
96
102
|
* @param {mapboxgl.Map} map the mapbox map.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapboxStyleLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxStyleLayer.js"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;OAMG;IACH;QAHiC,WAAW;QACd,iBAAiB;OA4F9C;IAvFC;;;;OAIG;IACH,oBAAsC;IAEtC;;OAEG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,0BAAkD;IAElD;;;;;OAKG;IACH,iBAAgC;IAEhC;;;;OAIG;IACH,0BAAoE;IAEpE;;;;OAIG;IACH,kCAAkE;IAElE;;;;OAIG;IACH,4BAA6B;IAE7B;;;;OAIG;IACH,yBAA0B;IAE1B;;;;OAIG;IACH,oBACyE;IAiG3E,cAAc;IACd,uBAcC;IAiBD;;;OAGG;IACH,eAaC;IAtIG,eAAe;IACf,0BAMC;
|
|
1
|
+
{"version":3,"file":"MapboxStyleLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxStyleLayer.js"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;OAMG;IACH;QAHiC,WAAW;QACd,iBAAiB;OA4F9C;IAvFC;;;;OAIG;IACH,oBAAsC;IAEtC;;OAEG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,0BAAkD;IAElD;;;;;OAKG;IACH,iBAAgC;IAEhC;;;;OAIG;IACH,0BAAoE;IAEpE;;;;OAIG;IACH,kCAAkE;IAElE;;;;OAIG;IACH,4BAA6B;IAE7B;;;;OAIG;IACH,yBAA0B;IAE1B;;;;OAIG;IACH,oBACyE;IAiG3E,cAAc;IACd,uBAcC;IAiBD;;;OAGG;IACH,eAaC;IAtIG,eAAe;IACf,0BAMC;IASL;;;;OAIG;IACH,0BAHW,YAAY,QAmDtB;IAED;;;;OAIG;IACH,4BAHW,YAAY,QAUtB;IAmBD,cAAc;IACd,0BAYC;IAqBD;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAiC/B;IAED;;;OAGG;IACH,yCAYC;IAED;;;;;OAKG;IACH,sBA8BC;IAED;;;;OAIG;IACH,eAIC;IAED;;;;OAIG;IACH,kBAeC;IAED;;;;OAIG;IAEH,8BA8BC;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACL,gBAAgB,CAI3B;CACF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Map } from 'maplibre-gl';
|
|
2
|
+
import MapGlLayer, { MapGlLayerOptions } from './MapGlLayer';
|
|
1
3
|
/**
|
|
2
4
|
* A class representing MaplibreLayer to display on BasicMap
|
|
3
5
|
*
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
13
15
|
* @extends {Layer}
|
|
14
16
|
*/
|
|
15
|
-
export default class MaplibreLayer extends
|
|
17
|
+
export default class MaplibreLayer extends MapGlLayer {
|
|
16
18
|
getOlLayerRender(): (frameState: any) => any;
|
|
17
19
|
getMapboxMapClass(): typeof Map;
|
|
18
20
|
/**
|
|
@@ -20,8 +22,6 @@ export default class MaplibreLayer extends Layer {
|
|
|
20
22
|
* @param {Object} newOptions Options to override
|
|
21
23
|
* @return {MapboxLayer} A MapboxLayer
|
|
22
24
|
*/
|
|
23
|
-
clone(newOptions:
|
|
25
|
+
clone(newOptions: MapGlLayerOptions): MaplibreLayer;
|
|
24
26
|
}
|
|
25
|
-
import Layer from "./Layer";
|
|
26
|
-
import { Map } from "maplibre-gl";
|
|
27
27
|
//# sourceMappingURL=MaplibreLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaplibreLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MaplibreLayer.
|
|
1
|
+
{"version":3,"file":"MaplibreLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MaplibreLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,UAAU,EAAE,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD,gBAAgB;IAKhB,iBAAiB;IAIjB;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,iBAAiB;CAGpC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Map } from 'maplibre-gl';
|
|
2
|
-
import Layer from './Layer';
|
|
3
|
-
import mixin from '../../common/mixins/MapboxLayerMixin';
|
|
4
2
|
import { getMaplibreRender } from '../../common/utils';
|
|
3
|
+
import MapGlLayer from './MapGlLayer';
|
|
5
4
|
/**
|
|
6
5
|
* A class representing MaplibreLayer to display on BasicMap
|
|
7
6
|
*
|
|
@@ -16,7 +15,7 @@ import { getMaplibreRender } from '../../common/utils';
|
|
|
16
15
|
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
17
16
|
* @extends {Layer}
|
|
18
17
|
*/
|
|
19
|
-
export default class MaplibreLayer extends
|
|
18
|
+
export default class MaplibreLayer extends MapGlLayer {
|
|
20
19
|
getOlLayerRender() {
|
|
21
20
|
return getMaplibreRender(this);
|
|
22
21
|
}
|
|
@@ -1,4 +1,89 @@
|
|
|
1
|
-
|
|
1
|
+
import GeoJSON from 'ol/format/GeoJSON';
|
|
2
|
+
import Feature, { FeatureLike } from 'ol/Feature';
|
|
3
|
+
import { MapEvent } from 'ol';
|
|
4
|
+
import { Coordinate } from 'ol/coordinate';
|
|
5
|
+
import Layer from './Layer';
|
|
6
|
+
import { RealtimeLayerMixinOptions } from '../../common/mixins/RealtimeLayerMixin';
|
|
7
|
+
import { AnyMap, LayerGetFeatureInfoResponse, RealtimeTrainId } from '../../types';
|
|
8
|
+
import { RealtimeTrajectory } from '../../api/typedefs';
|
|
9
|
+
export declare type OlRealtimeLayerOptions = RealtimeLayerMixinOptions & {
|
|
10
|
+
fullTrajectoryStyle: (feature: FeatureLike, resolution: number, options: any) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const RealtimeLayer_base: {
|
|
13
|
+
new (options: RealtimeLayerMixinOptions): {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
debug: boolean;
|
|
16
|
+
trajectories?: {
|
|
17
|
+
[key: string]: GeoJSONFeature;
|
|
18
|
+
} | undefined;
|
|
19
|
+
canvas?: import("../../types").AnyCanvas | undefined;
|
|
20
|
+
mode: import("../../types").RealtimeMode;
|
|
21
|
+
api: import("../../api/RealtimeAPI").default;
|
|
22
|
+
tenant: string;
|
|
23
|
+
time?: Date | undefined;
|
|
24
|
+
live?: boolean | undefined;
|
|
25
|
+
speed?: number | undefined;
|
|
26
|
+
filter?: Function | undefined;
|
|
27
|
+
sort?: Function | undefined;
|
|
28
|
+
style?: import("../../types").RealtimeStyleFunction | undefined;
|
|
29
|
+
styleOptions?: import("../../types").RealtimeStyleOptions | undefined;
|
|
30
|
+
pixelRatio?: number | undefined;
|
|
31
|
+
minZoomNonTrain: number;
|
|
32
|
+
minZoomInterpolation: number;
|
|
33
|
+
isUpdateBboxOnMoveEnd: boolean;
|
|
34
|
+
hoverVehicleId?: string | undefined;
|
|
35
|
+
selectedVehicleId?: string | undefined;
|
|
36
|
+
renderState?: import("../../types").RealtimeRenderState | undefined;
|
|
37
|
+
useRequestAnimationFrame?: boolean | undefined;
|
|
38
|
+
useDebounce?: boolean | undefined;
|
|
39
|
+
useThrottle?: boolean | undefined;
|
|
40
|
+
generalizationLevel?: import("../../types").RealtimeGeneralizationLevel | undefined;
|
|
41
|
+
generalizationLevelByZoom: import("../../types").RealtimeGeneralizationLevel[];
|
|
42
|
+
renderTimeIntervalByZoom: number[];
|
|
43
|
+
/** @ignore */
|
|
44
|
+
format: GeoJSON;
|
|
45
|
+
requestId?: number | undefined;
|
|
46
|
+
updateTimeInterval?: number | undefined;
|
|
47
|
+
updateTimeDelay?: number | undefined;
|
|
48
|
+
visibilityRef: import("ol/events").EventsKey;
|
|
49
|
+
selectedVehicle: GeoJSONFeature;
|
|
50
|
+
getGeneralizationLevelByZoom: (zoom: number) => import("../../types").RealtimeGeneralizationLevel;
|
|
51
|
+
getRenderTimeIntervalByZoom: (zoom: number) => number;
|
|
52
|
+
throttleRenderTrajectories: (viewState: import("../../types").ViewState, noInterpolate?: boolean | undefined) => void;
|
|
53
|
+
debounceRenderTrajectories: (viewState: import("../../types").ViewState, noInterpolate?: boolean | undefined) => void;
|
|
54
|
+
defineProperties(options: RealtimeLayerMixinOptions): void;
|
|
55
|
+
attachToMap(map: any): void;
|
|
56
|
+
detachFromMap(): void;
|
|
57
|
+
start(): void;
|
|
58
|
+
startUpdateTime(): void;
|
|
59
|
+
stop(): void;
|
|
60
|
+
stopUpdateTime(): void;
|
|
61
|
+
renderTrajectoriesInternal(viewState: import("../../types").ViewState, noInterpolate?: boolean): boolean;
|
|
62
|
+
renderTrajectories(viewState: import("../../types").ViewState | undefined, noInterpolate: boolean | undefined): void;
|
|
63
|
+
setBbox(extent?: [number, number, number, number] | undefined, zoom?: number | undefined): void;
|
|
64
|
+
setMode(mode: import("../../types").RealtimeMode): void;
|
|
65
|
+
getRefreshTimeInMs(zoom?: number | undefined): number;
|
|
66
|
+
getVehicle(filterFc: Function): GeoJSONFeature[];
|
|
67
|
+
getFeatureInfoAtCoordinate(coordinate: Coordinate, options: import("../../types").LayerGetFeatureInfoOptions): Promise<{
|
|
68
|
+
layer: any;
|
|
69
|
+
features: Feature<import("ol/geom/Geometry").default>[];
|
|
70
|
+
coordinate: Coordinate;
|
|
71
|
+
}>;
|
|
72
|
+
getTrajectoryInfos(id: string): Promise<{
|
|
73
|
+
stopSequence: unknown;
|
|
74
|
+
fullTrajectory: unknown;
|
|
75
|
+
}>;
|
|
76
|
+
purgeTrajectory(trajectory: GeoJSONFeature, extent: [number, number, number, number], zoom: number): boolean;
|
|
77
|
+
addTrajectory(trajectory: GeoJSONFeature): void;
|
|
78
|
+
removeTrajectory(trajectoryOrId: any): void;
|
|
79
|
+
onZoomEnd(): void;
|
|
80
|
+
onDocumentVisibilityChange(): void;
|
|
81
|
+
onTrajectoryMessage(data: import("../../common/api/WebSocketAPI").WebSocketAPIMessageEventData): void;
|
|
82
|
+
onDeleteTrajectoryMessage(data: import("../../common/api/WebSocketAPI").WebSocketAPIMessageEventData): void;
|
|
83
|
+
onFeatureHover(features: Feature<import("ol/geom/Geometry").default>[], layer: import("../../types").AnyRealtimeLayer, coordinate: Coordinate): void;
|
|
84
|
+
onFeatureClick(features: Feature<import("ol/geom/Geometry").default>[], layer: import("../../types").AnyRealtimeLayer, coordinate: Coordinate): void;
|
|
85
|
+
};
|
|
86
|
+
} & typeof Layer;
|
|
2
87
|
/**
|
|
3
88
|
* Responsible for loading and display data from a Realtime service.
|
|
4
89
|
*
|
|
@@ -17,33 +102,25 @@ export default RealtimeLayer;
|
|
|
17
102
|
* @implements {UserInteractionsLayerInterface}
|
|
18
103
|
* @implements {RealtimeLayerInterface}
|
|
19
104
|
*/
|
|
20
|
-
declare class RealtimeLayer extends
|
|
105
|
+
declare class RealtimeLayer extends RealtimeLayer_base {
|
|
21
106
|
/**
|
|
22
107
|
* Constructor.
|
|
23
108
|
*
|
|
24
109
|
* @param {Object} options
|
|
25
110
|
* @private
|
|
26
111
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/** @ignore */
|
|
34
|
-
renderState: {
|
|
35
|
-
center: number[];
|
|
36
|
-
zoom: null;
|
|
37
|
-
rotation: number;
|
|
38
|
-
};
|
|
39
|
-
attachToMap(map: any): void;
|
|
40
|
-
currentZoom: any;
|
|
112
|
+
constructor(options: OlRealtimeLayerOptions);
|
|
113
|
+
attachToMap(map: AnyMap): void;
|
|
114
|
+
/**
|
|
115
|
+
* Destroy the container of the tracker.
|
|
116
|
+
*/
|
|
117
|
+
detachFromMap(): void;
|
|
41
118
|
/**
|
|
42
119
|
* Detect in the canvas if there is data to query at a specific coordinate.
|
|
43
120
|
* @param {ol/coordinate~Coordinate} coordinate The coordinate to test
|
|
44
121
|
* @returns
|
|
45
122
|
*/
|
|
46
|
-
hasFeatureInfoAtCoordinate(coordinate:
|
|
123
|
+
hasFeatureInfoAtCoordinate(coordinate: Coordinate): boolean;
|
|
47
124
|
/**
|
|
48
125
|
* Render the trajectories using current map's size, resolution and rotation.
|
|
49
126
|
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
@@ -55,20 +132,19 @@ declare class RealtimeLayer extends Layer implements UserInteractionsLayerInterf
|
|
|
55
132
|
* @private
|
|
56
133
|
* @override
|
|
57
134
|
*/
|
|
58
|
-
|
|
59
|
-
renderedViewState: any;
|
|
135
|
+
renderTrajectoriesInternal(viewState: ViewState, noInterpolate: boolean): boolean;
|
|
60
136
|
/**
|
|
61
137
|
* Return the delay in ms before the next rendering.
|
|
62
138
|
*/
|
|
63
|
-
getRefreshTimeInMs():
|
|
64
|
-
getFeatureInfoAtCoordinate(coordinate:
|
|
139
|
+
getRefreshTimeInMs(): number;
|
|
140
|
+
getFeatureInfoAtCoordinate(coordinate: Coordinate, options?: {}): Promise<LayerGetFeatureInfoResponse>;
|
|
65
141
|
/**
|
|
66
142
|
* On move end we update the websocket with the new bbox.
|
|
67
143
|
*
|
|
68
144
|
* @private
|
|
69
145
|
* @override
|
|
70
146
|
*/
|
|
71
|
-
|
|
147
|
+
onMoveEnd(evt: MapEvent): void;
|
|
72
148
|
/**
|
|
73
149
|
* Function called on moveend event only when the zoom has changed.
|
|
74
150
|
*
|
|
@@ -76,44 +152,44 @@ declare class RealtimeLayer extends Layer implements UserInteractionsLayerInterf
|
|
|
76
152
|
* @private
|
|
77
153
|
* @override
|
|
78
154
|
*/
|
|
79
|
-
|
|
155
|
+
onZoomEnd(): void;
|
|
80
156
|
/**
|
|
81
157
|
* Update the cursor style when hovering a vehicle.
|
|
82
158
|
*
|
|
83
159
|
* @private
|
|
84
160
|
* @override
|
|
85
161
|
*/
|
|
86
|
-
|
|
162
|
+
onFeatureHover(features: Feature[], layer: RealtimeLayer, coordinate: Coordinate): void;
|
|
87
163
|
/**
|
|
88
164
|
* Display the complete trajectory of the vehicle.
|
|
89
165
|
*
|
|
90
166
|
* @private
|
|
91
167
|
* @override
|
|
92
168
|
*/
|
|
93
|
-
|
|
169
|
+
onFeatureClick(features: Feature[], layer: RealtimeLayer, coordinate: Coordinate): void;
|
|
94
170
|
/**
|
|
95
171
|
* Remove the trajectory form the list if necessary.
|
|
96
172
|
*
|
|
97
173
|
* @private
|
|
98
174
|
*/
|
|
99
|
-
|
|
175
|
+
purgeTrajectory(trajectory: RealtimeTrajectory, extent: [number, number, number, number], zoom: number): boolean;
|
|
100
176
|
/**
|
|
101
177
|
* Send the current bbox to the websocket
|
|
102
178
|
*
|
|
103
179
|
* @private
|
|
104
180
|
*/
|
|
105
|
-
|
|
181
|
+
setBbox(extent?: [number, number, number, number], zoom?: number): void;
|
|
106
182
|
/**
|
|
107
183
|
* Highlight the trajectory of journey.
|
|
108
184
|
* @private
|
|
109
185
|
*/
|
|
110
|
-
|
|
186
|
+
highlightTrajectory(id: RealtimeTrainId): void;
|
|
111
187
|
/**
|
|
112
188
|
* Create a copy of the RealtimeLayer.
|
|
113
189
|
* @param {Object} newOptions Options to override
|
|
114
190
|
* @return {RealtimeLayer} A RealtimeLayer
|
|
115
191
|
*/
|
|
116
|
-
clone(newOptions:
|
|
192
|
+
clone(newOptions: OlRealtimeLayerOptions): RealtimeLayer;
|
|
117
193
|
}
|
|
118
|
-
|
|
194
|
+
export default RealtimeLayer;
|
|
119
195
|
//# sourceMappingURL=RealtimeLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RealtimeLayer.
|
|
1
|
+
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RealtimeLayer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAKxC,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAc,EACZ,yBAAyB,EAC1B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,2BAA2B,EAE3B,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAKxD,oBAAY,sBAAsB,GAAG,yBAAyB,GAAG;IAC/D,mBAAmB,EAAE,CACnB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,GAAG,KACT,IAAI,CAAC;CACX,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqHE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnHlB;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAM,aAAc,SAAQ,kBAAY;IACtC;;;;;OAKG;gBACS,OAAO,EAAE,sBAAsB;IAiG3C,WAAW,CAAC,GAAG,EAAE,MAAM;IAuBvB;;OAEG;IACH,aAAa;IAKb;;;;OAIG;IACH,0BAA0B,CAAC,UAAU,EAAE,UAAU;IAcjD;;;;OAIG;IAEH,kBAAkB,CAAC,aAAa,EAAE,OAAO;IAoBzC;;;;OAIG;IACH,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO;IAyBvE;;OAEG;IACH,kBAAkB;IAIlB,0BAA0B,CACxB,UAAU,EAAE,UAAU,EACtB,OAAO,KAAK,GACX,OAAO,CAAC,2BAA2B,CAAC;IAQvC;;;;;OAKG;IAEH,SAAS,CAAC,GAAG,EAAE,QAAQ;IAevB;;;;;;OAMG;IAEH,SAAS;IAIT;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU;IAQxB;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU;IAWxB;;;;OAIG;IACH,eAAe,CACb,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxC,IAAI,EAAE,MAAM;IASd;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;IAUhE;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe;IAmBvC;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,sBAAsB;CAGzC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -26,6 +26,7 @@ const format = new GeoJSON();
|
|
|
26
26
|
* @implements {UserInteractionsLayerInterface}
|
|
27
27
|
* @implements {RealtimeLayerInterface}
|
|
28
28
|
*/
|
|
29
|
+
// @ts-ignore
|
|
29
30
|
class RealtimeLayer extends mixin(Layer) {
|
|
30
31
|
/**
|
|
31
32
|
* Constructor.
|
|
@@ -33,7 +34,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
33
34
|
* @param {Object} options
|
|
34
35
|
* @private
|
|
35
36
|
*/
|
|
36
|
-
constructor(options
|
|
37
|
+
constructor(options) {
|
|
37
38
|
// We use a group to be able to add custom vector layer in extended class.
|
|
38
39
|
// For example TrajservLayer use a vectorLayer to display the complete trajectory.
|
|
39
40
|
super(Object.assign({}, options));
|
|
@@ -51,6 +52,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
51
52
|
new OLLayer({
|
|
52
53
|
source: new Source({}),
|
|
53
54
|
render: (frameState) => {
|
|
55
|
+
var _a, _b, _c;
|
|
54
56
|
if (!this.container) {
|
|
55
57
|
this.container = document.createElement('div');
|
|
56
58
|
this.container.style.position = 'absolute';
|
|
@@ -61,19 +63,23 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
61
63
|
this.transformContainer.style.width = '100%';
|
|
62
64
|
this.transformContainer.style.height = '100%';
|
|
63
65
|
this.container.appendChild(this.transformContainer);
|
|
64
|
-
this.canvas
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (this.canvas) {
|
|
67
|
+
this.canvas.style.position =
|
|
68
|
+
'absolute';
|
|
69
|
+
this.canvas.style.top = '0';
|
|
70
|
+
this.canvas.style.left = '0';
|
|
71
|
+
this.canvas.style.transformOrigin =
|
|
72
|
+
'top left';
|
|
73
|
+
this.transformContainer.appendChild(this.canvas);
|
|
74
|
+
}
|
|
69
75
|
}
|
|
70
76
|
if (this.renderedViewState) {
|
|
71
77
|
const { center, resolution, rotation } = frameState.viewState;
|
|
72
78
|
const { center: renderedCenter, resolution: renderedResolution, rotation: renderedRotation, } = this.renderedViewState;
|
|
73
79
|
if (renderedResolution / resolution >= 3) {
|
|
74
80
|
// Avoid having really big points when zooming fast.
|
|
75
|
-
const context = this.canvas.getContext('2d');
|
|
76
|
-
context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
81
|
+
const context = (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
|
|
82
|
+
context === null || context === void 0 ? void 0 : context.clearRect(0, 0, (_b = this.canvas) === null || _b === void 0 ? void 0 : _b.width, (_c = this.canvas) === null || _c === void 0 ? void 0 : _c.height);
|
|
77
83
|
}
|
|
78
84
|
else {
|
|
79
85
|
const pixelCenterRendered = this.map.getPixelFromCoordinate(renderedCenter);
|
|
@@ -93,7 +99,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
93
99
|
/** @ignore */
|
|
94
100
|
this.renderState = {
|
|
95
101
|
center: [0, 0],
|
|
96
|
-
zoom:
|
|
102
|
+
zoom: undefined,
|
|
97
103
|
rotation: 0,
|
|
98
104
|
};
|
|
99
105
|
}
|
|
@@ -108,7 +114,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
108
114
|
const zoom = view.getZoom();
|
|
109
115
|
// Update the interval between render updates
|
|
110
116
|
if (this.currentZoom !== zoom) {
|
|
111
|
-
this.onZoomEnd(
|
|
117
|
+
this.onZoomEnd();
|
|
112
118
|
}
|
|
113
119
|
this.currentZoom = zoom;
|
|
114
120
|
this.onMoveEnd(evt);
|
|
@@ -131,7 +137,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
131
137
|
if (this.map && this.canvas) {
|
|
132
138
|
const context = this.canvas.getContext('2d');
|
|
133
139
|
const pixel = this.map.getPixelFromCoordinate(coordinate);
|
|
134
|
-
return !!context.getImageData(pixel[0] * this.pixelRatio, pixel[1] * this.pixelRatio, 1, 1).data[3];
|
|
140
|
+
return !!(context === null || context === void 0 ? void 0 : context.getImageData(pixel[0] * (this.pixelRatio || 1), pixel[1] * (this.pixelRatio || 1), 1, 1).data[3]);
|
|
135
141
|
}
|
|
136
142
|
return false;
|
|
137
143
|
}
|
|
@@ -140,6 +146,7 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
140
146
|
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
141
147
|
* @overrides
|
|
142
148
|
*/
|
|
149
|
+
// @ts-ignore
|
|
143
150
|
renderTrajectories(noInterpolate) {
|
|
144
151
|
if (!this.map) {
|
|
145
152
|
return;
|
|
@@ -195,7 +202,8 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
195
202
|
* @private
|
|
196
203
|
* @override
|
|
197
204
|
*/
|
|
198
|
-
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
206
|
+
onMoveEnd(evt) {
|
|
199
207
|
if (this.visible && this.isUpdateBboxOnMoveEnd) {
|
|
200
208
|
this.setBbox();
|
|
201
209
|
}
|
|
@@ -214,8 +222,8 @@ class RealtimeLayer extends mixin(Layer) {
|
|
|
214
222
|
* @override
|
|
215
223
|
*/
|
|
216
224
|
// eslint-disable-next-line no-unused-vars
|
|
217
|
-
onZoomEnd(
|
|
218
|
-
super.onZoomEnd(
|
|
225
|
+
onZoomEnd() {
|
|
226
|
+
super.onZoomEnd();
|
|
219
227
|
}
|
|
220
228
|
/**
|
|
221
229
|
* Update the cursor style when hovering a vehicle.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Feature } from 'ol';
|
|
2
|
+
import { Style } from 'ol/style';
|
|
3
|
+
declare const fullTrajectorystyle: (feature: Feature, resolution: number, options: any) => Style[];
|
|
1
4
|
export default fullTrajectorystyle;
|
|
2
|
-
declare function fullTrajectorystyle(feature: any, resolution: any, options: any): Style[];
|
|
3
|
-
import { Style } from "ol/style";
|
|
4
5
|
//# sourceMappingURL=fullTrajectoryStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullTrajectoryStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryStyle.
|
|
1
|
+
{"version":3,"file":"fullTrajectoryStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAwB,MAAM,UAAU,CAAC;AAiBvD,QAAA,MAAM,mBAAmB,YACd,OAAO,cACJ,MAAM,WACT,GAAG,YAiCb,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "mobility-toolbox-js",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
|
|
5
|
-
"version": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.47",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@turf/helpers": "^6.5.0",
|
|
16
16
|
"@turf/transform-rotate": "^6.5.0",
|
|
17
|
+
"@types/lodash": "^4.14.185",
|
|
17
18
|
"lodash.debounce": "4.0.8",
|
|
18
19
|
"lodash.throttle": "4.1.1",
|
|
19
20
|
"path": "^0.12.7",
|
|
@@ -29,14 +30,19 @@
|
|
|
29
30
|
"@babel/core": "7.16.12",
|
|
30
31
|
"@babel/eslint-parser": "7.16.5",
|
|
31
32
|
"@babel/plugin-transform-runtime": "7.16.10",
|
|
32
|
-
"@babel/preset-env": "^7.
|
|
33
|
+
"@babel/preset-env": "^7.18.10",
|
|
33
34
|
"@babel/preset-react": "7.16.7",
|
|
34
35
|
"@commitlint/cli": "17.0.2",
|
|
35
36
|
"@commitlint/config-conventional": "17.0.2",
|
|
36
37
|
"@types/arcgis-js-api": "^4.24.0",
|
|
37
38
|
"@types/arcgis-rest-api": "^10.4.5",
|
|
38
|
-
"@types/geojson": "^7946.0.
|
|
39
|
+
"@types/geojson": "^7946.0.10",
|
|
40
|
+
"@types/lodash.debounce": "^4.0.7",
|
|
41
|
+
"@types/lodash.throttle": "^4.1.7",
|
|
42
|
+
"@types/mapbox-gl": "^2.7.5",
|
|
43
|
+
"@types/offscreencanvas": "^2019.7.0",
|
|
39
44
|
"@types/topojson": "^3.2.3",
|
|
45
|
+
"@types/uuid": "^8.3.4",
|
|
40
46
|
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
41
47
|
"@typescript-eslint/parser": "^5.30.5",
|
|
42
48
|
"autoprefixer": "9.7.6",
|
|
@@ -55,7 +61,7 @@
|
|
|
55
61
|
"eslint-config-prettier": "8.3.0",
|
|
56
62
|
"eslint-plugin-cypress": "2.12.1",
|
|
57
63
|
"eslint-plugin-import": "2.25.4",
|
|
58
|
-
"eslint-plugin-jsx-a11y": "
|
|
64
|
+
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
59
65
|
"eslint-plugin-prettier": "4.0.0",
|
|
60
66
|
"eslint-plugin-react": "^7.30.1",
|
|
61
67
|
"fixpack": "3.0.6",
|
|
@@ -69,18 +75,18 @@
|
|
|
69
75
|
"lint-staged": "12.3.3",
|
|
70
76
|
"mapbox-gl": "1.13.2",
|
|
71
77
|
"maplibre-gl": "2.4.0",
|
|
72
|
-
"mock-socket": "9.1.
|
|
78
|
+
"mock-socket": "9.1.5",
|
|
73
79
|
"next": "12.1.6",
|
|
74
80
|
"next-transpile-modules": "9.0.0",
|
|
75
81
|
"ol": "6.14.1",
|
|
76
|
-
"openapi-typescript": "
|
|
82
|
+
"openapi-typescript": "5.4.1",
|
|
77
83
|
"postcss": "8.3.3",
|
|
78
84
|
"postcss-loader": "3.0.0",
|
|
79
85
|
"prettier": "2.5.1",
|
|
80
86
|
"raw-loader": "4.0.2",
|
|
81
87
|
"sass": "1.52.2",
|
|
82
88
|
"sass-loader": "8.0.2",
|
|
83
|
-
"sort-json": "2.0.
|
|
89
|
+
"sort-json": "2.0.1",
|
|
84
90
|
"standard-version": "9.5.0",
|
|
85
91
|
"start-server-and-test": "1.14.0",
|
|
86
92
|
"stylelint": "14.3.0",
|
|
@@ -91,7 +97,7 @@
|
|
|
91
97
|
},
|
|
92
98
|
"scripts": {
|
|
93
99
|
"apidoc": "esdoc && cp apidoc/index.json doc/src/components/Esdoc",
|
|
94
|
-
"build": "rm -rf build && yarn tsc && yarn esbuild:iife && cp README.md build/ && cp package.json build/ && cp -R src/types build/",
|
|
100
|
+
"build": "rm -rf build && yarn tsc && yarn esbuild:iife && cp README.md build/ && cp package.json build/ && cp -R src/types build/ && find build -type f -name '*.test.*' -delete",
|
|
95
101
|
"coverage": "yarn test --watchAll=false --coverage --coverageDirectory=coverage",
|
|
96
102
|
"cy:open": "cypress open",
|
|
97
103
|
"cy:test": "start-server-and-test dev http://localhost:3000 'cypress run --browser chrome'",
|
|
@@ -121,7 +127,7 @@
|
|
|
121
127
|
"test": "TZ='UTC' jest",
|
|
122
128
|
"test:watch": "yarn test --watchAll",
|
|
123
129
|
"tsc": "tsc",
|
|
124
|
-
"types:backend": "openapi-typescript https://developer.geops.io/swagger/routing.json --output types/routing.d.ts && openapi-typescript https://developer.geops.io/swagger/stops.json --output types/stops.d.ts"
|
|
130
|
+
"types:backend": "openapi-typescript https://developer.geops.io/swagger/routing.json --output src/types/routing.d.ts && openapi-typescript https://developer.geops.io/swagger/stops.json --output src/types/stops.d.ts"
|
|
125
131
|
},
|
|
126
132
|
"browserslist": [
|
|
127
133
|
">0.2%",
|