mobility-toolbox-js 2.0.0-beta.30 → 2.0.0-beta.34
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 +268 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +626 -343
- package/api/RoutingAPI.d.ts +33 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/RoutingAPI.js +65 -15
- package/api/StopsAPI.d.ts +36 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/StopsAPI.js +70 -12
- package/api/index.d.ts +5 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +10 -3
- package/api/typedefs.d.ts +105 -0
- package/api/typedefs.d.ts.map +1 -0
- package/api/typedefs.js +72 -0
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/HttpAPI.js +82 -30
- package/common/api/WebSocketAPI.d.ts +95 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.js +313 -168
- package/common/controls/Control.d.ts +74 -0
- package/common/controls/Control.d.ts.map +1 -0
- package/common/controls/Control.js +167 -78
- package/common/index.d.ts +3 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +18 -2
- package/common/layers/Layer.d.ts +80 -0
- package/common/layers/Layer.d.ts.map +1 -0
- package/common/layers/Layer.js +251 -134
- package/common/mixins/CopyrightMixin.d.ts +22 -0
- package/common/mixins/CopyrightMixin.d.ts.map +1 -0
- package/common/mixins/CopyrightMixin.js +70 -22
- package/common/mixins/MapboxLayerMixin.d.ts +27 -0
- package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
- package/common/mixins/MapboxLayerMixin.js +240 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +698 -429
- package/common/mixins/StopFinderMixin.d.ts +40 -0
- package/common/mixins/StopFinderMixin.d.ts.map +1 -0
- package/common/mixins/StopFinderMixin.js +195 -107
- package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.js +222 -121
- package/common/styles/index.d.ts +5 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/index.js +24 -4
- package/common/styles/realtimeDefaultStyle.d.ts +15 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +236 -190
- package/common/styles/realtimeDelayStyle.d.ts +11 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +25 -7
- package/common/styles/realtimeSimpleStyle.d.ts +3 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +23 -17
- package/common/typedefs.d.ts +50 -0
- package/common/typedefs.d.ts.map +1 -0
- package/common/typedefs.js +21 -0
- package/common/utils/cleanStopTime.d.ts +7 -0
- package/common/utils/cleanStopTime.d.ts.map +1 -0
- package/common/utils/cleanStopTime.js +28 -17
- package/common/utils/compareDepartures.d.ts +9 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/compareDepartures.js +34 -22
- package/common/utils/createCanvas.d.ts +9 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +28 -16
- package/common/utils/createTrackerFilters.d.ts +12 -0
- package/common/utils/createTrackerFilters.d.ts.map +1 -0
- package/common/utils/createTrackerFilters.js +75 -54
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +15 -13
- package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.js +24 -17
- package/common/utils/getMapboxRender.d.ts +5 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +77 -0
- package/common/utils/getMaplibreRender.d.ts +5 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +38 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.js +11 -2
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.js +20 -10
- package/common/utils/getVehiclePosition.d.ts +14 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.js +63 -39
- package/common/utils/index.d.ts +12 -0
- package/common/utils/index.d.ts.map +1 -0
- package/common/utils/index.js +37 -9
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/removeDuplicate.js +29 -7
- package/common/utils/renderTrajectories.d.ts +20 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/renderTrajectories.js +111 -78
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +21 -17
- package/common/utils/timeUtils.d.ts +5 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/timeUtils.js +47 -18
- package/common/utils/trackerConfig.d.ts +24 -0
- package/common/utils/trackerConfig.d.ts.map +1 -0
- package/common/utils/trackerConfig.js +171 -118
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/iife.js +7 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +10 -7
- package/mapbox/controls/CopyrightControl.d.ts +32 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/mapbox/controls/CopyrightControl.js +72 -28
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/controls/index.js +6 -1
- package/mapbox/index.d.ts +5 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/index.js +20 -4
- package/mapbox/layers/Layer.d.ts +47 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/Layer.js +137 -54
- package/mapbox/layers/RealtimeLayer.d.ts +118 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.js +310 -183
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/layers/index.js +7 -2
- package/mapbox/utils.d.ts +8 -0
- package/mapbox/utils.d.ts.map +1 -0
- package/mapbox/utils.js +54 -29
- package/mbt.js +2052 -2109
- package/mbt.js.map +3 -3
- package/mbt.min.js +18 -18
- package/mbt.min.js.map +3 -3
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.js +89 -41
- package/ol/controls/RoutingControl.d.ts +180 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/RoutingControl.js +666 -371
- package/ol/controls/StopFinderControl.d.ts +32 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/ol/controls/StopFinderControl.js +59 -10
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/controls/index.js +9 -3
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/index.js +21 -5
- package/ol/layers/Layer.d.ts +49 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +178 -81
- package/ol/layers/MapboxLayer.d.ts +42 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.js +131 -198
- package/ol/layers/MapboxStyleLayer.d.ts +146 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +382 -186
- package/ol/layers/MaplibreLayer.d.ts +27 -0
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +67 -138
- package/ol/layers/RealtimeLayer.d.ts +119 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +327 -184
- package/ol/layers/RoutingLayer.d.ts +24 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.js +111 -56
- package/ol/layers/VectorLayer.d.ts +23 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.js +71 -21
- package/ol/layers/WMSLayer.d.ts +38 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.js +105 -37
- package/ol/layers/index.d.ts +9 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/layers/index.js +19 -8
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.js +32 -28
- package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.js +44 -40
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/ol/styles/index.js +7 -2
- package/package.json +14 -36
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/setupTests.js +15 -0
- package/types/index.d.ts +7 -6
- package/types/routing.d.ts +25 -25
- package/types/stops.d.ts +19 -19
- package/api/RealtimeAPI.test.js +0 -67
- package/api/RoutingAPI.test.js +0 -25
- package/api/StopsAPI.test.js +0 -22
- package/common/api/HttpAPI.test.js +0 -50
- package/common/api/WebSocketAPI.test.js +0 -311
- package/common/controls/Control.test.js +0 -87
- package/common/layers/Layer.test.js +0 -134
- package/common/mixins/UserInteractionsLayerMixin.test.js +0 -199
- package/common/utils/createTrackerFilters.test.js +0 -79
- package/common/utils/getMapboxMapCopyrights.test.js +0 -40
- package/common/utils/removeDuplicate.test.js +0 -19
- package/common/utils/timeUtils.test.js +0 -10
- package/common/utils/trackerConfig.test.js +0 -23
- package/mapbox/layers/Layer.test.js +0 -182
- package/mapbox/layers/RealtimeLayer.test.js +0 -10
- package/ol/controls/CopyrightControl.test.js +0 -165
- package/ol/controls/RoutingControl.test.js +0 -146
- package/ol/controls/StopFinderControl.test.js +0 -48
- package/ol/layers/Layer.test.js +0 -175
- package/ol/layers/MapboxLayer.test.js +0 -160
- package/ol/layers/MapboxStyleLayer.test.js +0 -226
- package/ol/layers/RealtimeLayer.test.js +0 -67
- package/ol/layers/RoutingLayer.test.js +0 -39
- package/ol/layers/VectorLayer.test.js +0 -76
- package/ol/layers/WMSLayer.test.js +0 -57
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Return the styleUrl with apiKey parameters set.
|
|
5
|
+
* @param {string} url a url.
|
|
6
|
+
* @param {Object<String,String>} params a list of key/value pair to add to the url.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
var getUrlWithParams = function (url, params) {
|
|
10
|
+
// Clean requets parameters, removing undefined and null values.
|
|
11
|
+
var newUrl = new URL(url);
|
|
12
|
+
var searchParams = params || {};
|
|
13
|
+
Object.entries(searchParams).forEach(function (_a) {
|
|
14
|
+
var key = _a[0], value = _a[1];
|
|
15
|
+
if (value !== undefined && value !== null) {
|
|
16
|
+
newUrl.searchParams.set(key, value);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return newUrl;
|
|
10
20
|
};
|
|
11
|
-
|
|
21
|
+
exports.default = getUrlWithParams;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default getVehiclePosition;
|
|
2
|
+
/**
|
|
3
|
+
* Interpolate or not the vehicle position from a trajectory at a specific date.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} now Current date to interpolate a position with. In ms.
|
|
6
|
+
* @param {RealtimeTrajectory} trajectory The trajectory to interpolate.
|
|
7
|
+
* @param {boolean} noInterpolate If true, the vehicle position is not interpolated on each render but only once.
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
declare function getVehiclePosition(now: number, trajectory: GeoJSONFeature, noInterpolate: boolean): {
|
|
11
|
+
coord: any;
|
|
12
|
+
rotation: any;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=getVehiclePosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVehiclePosition.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getVehiclePosition.js"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AACH,yCALW,MAAM,6CAEN,OAAO;;;EA8DjB"}
|
|
@@ -1,42 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var GeometryType_1 = require("ol/geom/GeometryType");
|
|
4
|
+
/**
|
|
5
|
+
* Interpolate or not the vehicle position from a trajectory at a specific date.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} now Current date to interpolate a position with. In ms.
|
|
8
|
+
* @param {RealtimeTrajectory} trajectory The trajectory to interpolate.
|
|
9
|
+
* @param {boolean} noInterpolate If true, the vehicle position is not interpolated on each render but only once.
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
var getVehiclePosition = function (now, trajectory, noInterpolate) {
|
|
13
|
+
var _a;
|
|
14
|
+
var _b = trajectory.properties, timeIntervals = _b.time_intervals, geometry = _b.olGeometry, coordinate = _b.coordinate;
|
|
15
|
+
var coord;
|
|
16
|
+
var rotation;
|
|
17
|
+
if (noInterpolate && coordinate) {
|
|
18
|
+
coord = coordinate;
|
|
19
|
+
}
|
|
20
|
+
else if (geometry.getType() === GeometryType_1.default.POINT) {
|
|
21
|
+
coord = geometry.getCoordinates();
|
|
22
|
+
}
|
|
23
|
+
else if (geometry.getType() === GeometryType_1.default.LINE_STRING) {
|
|
24
|
+
var intervals = timeIntervals || [[]];
|
|
25
|
+
var firstInterval = intervals[0];
|
|
26
|
+
var lastInterval = intervals[intervals.length - 1];
|
|
27
|
+
// Between the last time interval of a trajectory event and the beginning
|
|
28
|
+
// of the new trajectory event, there is few seconds, can be 6 to 30
|
|
29
|
+
// seconds (that's why the vehicle jumps sometimes).
|
|
30
|
+
// So we make the choice here to display the last (or the first) position
|
|
31
|
+
// of an trajectory event instead of removing them, if the current date is
|
|
32
|
+
// outside the time intervals we display the vehicle at the last (or first) position known.
|
|
33
|
+
if (now < firstInterval[0]) {
|
|
34
|
+
// Display first position known.
|
|
35
|
+
rotation = firstInterval[2];
|
|
36
|
+
coord = geometry.getFirstCoordinate();
|
|
37
|
+
}
|
|
38
|
+
else if (now > lastInterval[0]) {
|
|
39
|
+
// Display last position known.
|
|
40
|
+
rotation = lastInterval[2];
|
|
41
|
+
coord = geometry.getLastCoordinate();
|
|
34
42
|
}
|
|
35
|
-
|
|
43
|
+
else {
|
|
44
|
+
// Interpolate position using time intervals.
|
|
45
|
+
for (var j = 0; j < intervals.length - 1; j += 1) {
|
|
46
|
+
// Rotation only available in realtime layer.
|
|
47
|
+
var _c = intervals[j], start = _c[0], startFrac = _c[1];
|
|
48
|
+
var _d = intervals[j + 1], end = _d[0], endFrac = _d[1];
|
|
49
|
+
if (start <= now && now <= end) {
|
|
50
|
+
// interpolate position inside the time interval.
|
|
51
|
+
var timeFrac = Math.min((now - start) / (end - start), 1);
|
|
52
|
+
var geomFrac = timeFrac * (endFrac - startFrac) + startFrac;
|
|
53
|
+
coord = geometry.getCoordinateAt(geomFrac);
|
|
54
|
+
_a = intervals[j], rotation = _a[2];
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.error('This geometry type is not supported. Only Point or LineString are. Current geometry: ', geometry);
|
|
36
63
|
}
|
|
37
|
-
|
|
38
|
-
console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ", geometry);
|
|
39
|
-
}
|
|
40
|
-
return { coord, rotation };
|
|
64
|
+
return { coord: coord, rotation: rotation };
|
|
41
65
|
};
|
|
42
|
-
|
|
66
|
+
exports.default = getVehiclePosition;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as getUrlWithParams } from "./getUrlWithParams";
|
|
2
|
+
export { default as getMapboxMapCopyrights } from "./getMapboxMapCopyrights";
|
|
3
|
+
export { default as removeDuplicate } from "./removeDuplicate";
|
|
4
|
+
export { default as createTrackerFilters } from "./createTrackerFilters";
|
|
5
|
+
export { default as getLayersAsFlatArray } from "./getLayersAsFlatArray";
|
|
6
|
+
export * from "./timeUtils";
|
|
7
|
+
export { default as sortByDelay } from "./sortByDelay";
|
|
8
|
+
export { default as renderTrajectories } from "./renderTrajectories";
|
|
9
|
+
export { default as getMaplibreRender } from "./getMaplibreRender";
|
|
10
|
+
export { default as getMapboxRender } from "./getMapboxRender";
|
|
11
|
+
export * as trackerConfig from "./trackerConfig";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/utils/index.js"],"names":[],"mappings":""}
|
package/common/utils/index.js
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.trackerConfig = exports.getMapboxRender = exports.getMaplibreRender = exports.renderTrajectories = exports.sortByDelay = exports.getLayersAsFlatArray = exports.createTrackerFilters = exports.removeDuplicate = exports.getMapboxMapCopyrights = exports.getUrlWithParams = void 0;
|
|
18
|
+
var getUrlWithParams_1 = require("./getUrlWithParams");
|
|
19
|
+
Object.defineProperty(exports, "getUrlWithParams", { enumerable: true, get: function () { return getUrlWithParams_1.default; } });
|
|
20
|
+
var getMapboxMapCopyrights_1 = require("./getMapboxMapCopyrights");
|
|
21
|
+
Object.defineProperty(exports, "getMapboxMapCopyrights", { enumerable: true, get: function () { return getMapboxMapCopyrights_1.default; } });
|
|
22
|
+
var removeDuplicate_1 = require("./removeDuplicate");
|
|
23
|
+
Object.defineProperty(exports, "removeDuplicate", { enumerable: true, get: function () { return removeDuplicate_1.default; } });
|
|
24
|
+
var createTrackerFilters_1 = require("./createTrackerFilters");
|
|
25
|
+
Object.defineProperty(exports, "createTrackerFilters", { enumerable: true, get: function () { return createTrackerFilters_1.default; } });
|
|
26
|
+
var getLayersAsFlatArray_1 = require("./getLayersAsFlatArray");
|
|
27
|
+
Object.defineProperty(exports, "getLayersAsFlatArray", { enumerable: true, get: function () { return getLayersAsFlatArray_1.default; } });
|
|
28
|
+
__exportStar(require("./timeUtils"), exports);
|
|
29
|
+
var sortByDelay_1 = require("./sortByDelay");
|
|
30
|
+
Object.defineProperty(exports, "sortByDelay", { enumerable: true, get: function () { return sortByDelay_1.default; } });
|
|
31
|
+
var renderTrajectories_1 = require("./renderTrajectories");
|
|
32
|
+
Object.defineProperty(exports, "renderTrajectories", { enumerable: true, get: function () { return renderTrajectories_1.default; } });
|
|
33
|
+
var getMaplibreRender_1 = require("./getMaplibreRender");
|
|
34
|
+
Object.defineProperty(exports, "getMaplibreRender", { enumerable: true, get: function () { return getMaplibreRender_1.default; } });
|
|
35
|
+
var getMapboxRender_1 = require("./getMapboxRender");
|
|
36
|
+
Object.defineProperty(exports, "getMapboxRender", { enumerable: true, get: function () { return getMapboxRender_1.default; } });
|
|
37
|
+
exports.trackerConfig = require("./trackerConfig");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default removeDuplicate;
|
|
2
|
+
/**
|
|
3
|
+
* This function remove duplicates lower case string value of an array.
|
|
4
|
+
* It removes also null, undefined or non string values.
|
|
5
|
+
*
|
|
6
|
+
* @param {array} array Array of values.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
declare function removeDuplicate(array: any[]): any[];
|
|
10
|
+
//# sourceMappingURL=removeDuplicate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeDuplicate.d.ts","sourceRoot":"","sources":["../../../src/common/utils/removeDuplicate.js"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,sDAYC"}
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**
|
|
13
|
+
* This function remove duplicates lower case string value of an array.
|
|
14
|
+
* It removes also null, undefined or non string values.
|
|
15
|
+
*
|
|
16
|
+
* @param {array} array Array of values.
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
var removeDuplicate = function (array) {
|
|
20
|
+
var arrWithoutEmptyValues = array.filter(function (val) { return val !== undefined && val !== null && val.trim && val.trim(); });
|
|
21
|
+
var lowerCasesValues = arrWithoutEmptyValues.map(function (str) {
|
|
22
|
+
return str.toLowerCase();
|
|
23
|
+
});
|
|
24
|
+
var uniqueLowerCaseValues = __spreadArray([], new Set(lowerCasesValues), true);
|
|
25
|
+
var uniqueValues = uniqueLowerCaseValues.map(function (uniqueStr) {
|
|
26
|
+
return arrWithoutEmptyValues.find(function (str) { return str.toLowerCase() === uniqueStr; });
|
|
27
|
+
});
|
|
28
|
+
return uniqueValues;
|
|
29
|
+
};
|
|
30
|
+
exports.default = removeDuplicate;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default renderTrajectories;
|
|
2
|
+
/**
|
|
3
|
+
* Draw all the trajectories available in a canvas.
|
|
4
|
+
* @param {HTMLCanvas|HTMLOffscreenCanvas} The canvas where to draw the trajectories.
|
|
5
|
+
* @param {ViewState} trajectories An array of trajectories.
|
|
6
|
+
* @param {Function} style A function that returns a canvas representing a vehicle of a specific trajectory.
|
|
7
|
+
* @param {ViewState} viewState The view state of the map.
|
|
8
|
+
* @param {boolean} options.hoverVehicleId The id of the vehicle to highlight.
|
|
9
|
+
* @param {boolean} options.selectedVehicleId The id of the vehicle to select.
|
|
10
|
+
* @param {boolean} options.noInterpolate If true trajectories are not interpolated but
|
|
11
|
+
* drawn at the last known coordinate. Use this for performance optimization
|
|
12
|
+
* during map navigation.
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
declare function renderTrajectories(canvas: any, trajectories: ViewState, style: Function, viewState: ViewState, options: any): {
|
|
16
|
+
renderedTrajectories?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
renderedTrajectories: any[];
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=renderTrajectories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTrajectories.d.ts","sourceRoot":"","sources":["../../../src/common/utils/renderTrajectories.js"],"names":[],"mappings":";AAIA;;;;;;;;;;;;GAYG;AACH,+DAVW,SAAS,8BAET,SAAS;;;;EAmKnB"}
|
|
@@ -1,86 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
time = Date.now(),
|
|
9
|
-
size = [],
|
|
10
|
-
center,
|
|
11
|
-
resolution,
|
|
12
|
-
rotation = 0,
|
|
13
|
-
pixelRatio
|
|
14
|
-
} = viewState;
|
|
15
|
-
const { noInterpolate = false, hoverVehicleId, selectedVehicleId } = options;
|
|
16
|
-
const context = canvas.getContext("2d");
|
|
17
|
-
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
18
|
-
const [width, height] = size;
|
|
19
|
-
if (width && height && (canvas.width !== width || canvas.height !== height)) {
|
|
20
|
-
[canvas.width, canvas.height] = [width * pixelRatio, height * pixelRatio];
|
|
21
|
-
}
|
|
22
|
-
const coordinateToPixelTransform = compose(create(), size[0] / 2, size[1] / 2, 1 / resolution, -1 / resolution, -rotation, -center[0], -center[1]);
|
|
23
|
-
if (canvas.style) {
|
|
24
|
-
canvas.style.width = `${canvas.width / pixelRatio}px`;
|
|
25
|
-
canvas.style.height = `${canvas.height / pixelRatio}px`;
|
|
26
|
-
}
|
|
27
|
-
let hoverVehicleImg;
|
|
28
|
-
let hoverVehiclePx;
|
|
29
|
-
let hoverVehicleWidth;
|
|
30
|
-
let hoverVehicleHeight;
|
|
31
|
-
let selectedVehicleImg;
|
|
32
|
-
let selectedVehiclePx;
|
|
33
|
-
let selectedVehicleWidth;
|
|
34
|
-
let selectedVehicleHeight;
|
|
35
|
-
const renderedTrajectories = [];
|
|
36
|
-
for (let i = trajectories.length - 1; i >= 0; i -= 1) {
|
|
37
|
-
const trajectory = trajectories[i];
|
|
38
|
-
const { train_id: id, timeOffset } = trajectory.properties;
|
|
39
|
-
const { coord, rotation: rotationIcon } = getVehiclePosition(time - (timeOffset || 0), trajectory, noInterpolate);
|
|
40
|
-
trajectories[i].properties.coordinate = coord;
|
|
41
|
-
trajectories[i].properties.rotation = rotationIcon;
|
|
42
|
-
if (!coord) {
|
|
43
|
-
continue;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
44
8
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/* eslint-disable no-param-reassign */
|
|
13
|
+
var transform_1 = require("ol/transform");
|
|
14
|
+
var getVehiclePosition_1 = require("./getVehiclePosition");
|
|
15
|
+
/**
|
|
16
|
+
* Draw all the trajectories available in a canvas.
|
|
17
|
+
* @param {HTMLCanvas|HTMLOffscreenCanvas} The canvas where to draw the trajectories.
|
|
18
|
+
* @param {ViewState} trajectories An array of trajectories.
|
|
19
|
+
* @param {Function} style A function that returns a canvas representing a vehicle of a specific trajectory.
|
|
20
|
+
* @param {ViewState} viewState The view state of the map.
|
|
21
|
+
* @param {boolean} options.hoverVehicleId The id of the vehicle to highlight.
|
|
22
|
+
* @param {boolean} options.selectedVehicleId The id of the vehicle to select.
|
|
23
|
+
* @param {boolean} options.noInterpolate If true trajectories are not interpolated but
|
|
24
|
+
* drawn at the last known coordinate. Use this for performance optimization
|
|
25
|
+
* during map navigation.
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
var renderTrajectories = function (canvas, trajectories, style, viewState, options) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!canvas) {
|
|
31
|
+
return {};
|
|
48
32
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
var _b = viewState.time, time = _b === void 0 ? Date.now() : _b, _c = viewState.size, size = _c === void 0 ? [] : _c, center = viewState.center, resolution = viewState.resolution, _d = viewState.rotation, rotation = _d === void 0 ? 0 : _d, pixelRatio = viewState.pixelRatio;
|
|
34
|
+
var _e = options.noInterpolate, noInterpolate = _e === void 0 ? false : _e, hoverVehicleId = options.hoverVehicleId, selectedVehicleId = options.selectedVehicleId;
|
|
35
|
+
var context = canvas.getContext('2d');
|
|
36
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
37
|
+
var width = size[0], height = size[1];
|
|
38
|
+
if (width && height && (canvas.width !== width || canvas.height !== height)) {
|
|
39
|
+
_a = [width * pixelRatio, height * pixelRatio], canvas.width = _a[0], canvas.height = _a[1];
|
|
52
40
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
var coordinateToPixelTransform = (0, transform_1.compose)((0, transform_1.create)(), size[0] / 2, size[1] / 2, 1 / resolution, -1 / resolution, -rotation, -center[0], -center[1]);
|
|
42
|
+
// Offscreen canvas has not style attribute
|
|
43
|
+
if (canvas.style) {
|
|
44
|
+
canvas.style.width = "".concat(canvas.width / pixelRatio, "px");
|
|
45
|
+
canvas.style.height = "".concat(canvas.height / pixelRatio, "px");
|
|
56
46
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
var hoverVehicleImg;
|
|
48
|
+
var hoverVehiclePx;
|
|
49
|
+
var hoverVehicleWidth;
|
|
50
|
+
var hoverVehicleHeight;
|
|
51
|
+
var selectedVehicleImg;
|
|
52
|
+
var selectedVehiclePx;
|
|
53
|
+
var selectedVehicleWidth;
|
|
54
|
+
var selectedVehicleHeight;
|
|
55
|
+
var renderedTrajectories = [];
|
|
56
|
+
for (var i = trajectories.length - 1; i >= 0; i -= 1) {
|
|
57
|
+
var trajectory = trajectories[i];
|
|
58
|
+
// We simplify the trajectory object
|
|
59
|
+
var _f = trajectory.properties, id = _f.train_id, timeOffset = _f.timeOffset;
|
|
60
|
+
// We set the rotation and the timeFraction of the trajectory (used by tralis).
|
|
61
|
+
// if rotation === null that seems there is no rotation available.
|
|
62
|
+
var _g = (0, getVehiclePosition_1.default)(time - (timeOffset || 0), trajectory, noInterpolate), coord = _g.coord, rotationIcon = _g.rotation;
|
|
63
|
+
// We store the current vehicle position to the trajectory.
|
|
64
|
+
trajectories[i].properties.coordinate = coord;
|
|
65
|
+
trajectories[i].properties.rotation = rotationIcon;
|
|
66
|
+
if (!coord) {
|
|
67
|
+
// eslint-disable-next-line no-continue
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
var px = (0, transform_1.apply)(coordinateToPixelTransform, __spreadArray([], coord, true));
|
|
71
|
+
if (!px) {
|
|
72
|
+
// eslint-disable-next-line no-continue
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
px = px.map(function (p) { return p * pixelRatio; });
|
|
76
|
+
if (px[0] < 0 ||
|
|
77
|
+
px[0] > canvas.width ||
|
|
78
|
+
px[1] < 0 ||
|
|
79
|
+
px[1] > canvas.height) {
|
|
80
|
+
// eslint-disable-next-line no-continue
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
var vehicleImg = style(trajectory, viewState, options);
|
|
84
|
+
if (!vehicleImg) {
|
|
85
|
+
// eslint-disable-next-line no-continue
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
var imgWidth = vehicleImg.width;
|
|
89
|
+
var imgHeight = vehicleImg.height;
|
|
90
|
+
if (hoverVehicleId !== id && selectedVehicleId !== id) {
|
|
91
|
+
context.drawImage(vehicleImg, px[0] - imgWidth / 2, px[1] - imgHeight / 2, imgWidth, imgHeight);
|
|
92
|
+
}
|
|
93
|
+
if (hoverVehicleId && hoverVehicleId === id) {
|
|
94
|
+
// Store the canvas to draw it at the end
|
|
95
|
+
hoverVehicleImg = vehicleImg;
|
|
96
|
+
hoverVehiclePx = px;
|
|
97
|
+
hoverVehicleWidth = imgWidth;
|
|
98
|
+
hoverVehicleHeight = imgHeight;
|
|
99
|
+
}
|
|
100
|
+
if (selectedVehicleId && selectedVehicleId === id) {
|
|
101
|
+
// Store the canvas to draw it at the end
|
|
102
|
+
selectedVehicleImg = vehicleImg;
|
|
103
|
+
selectedVehiclePx = px;
|
|
104
|
+
selectedVehicleWidth = imgWidth;
|
|
105
|
+
selectedVehicleHeight = imgHeight;
|
|
106
|
+
}
|
|
107
|
+
renderedTrajectories.push(trajectory);
|
|
61
108
|
}
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
hoverVehiclePx = px;
|
|
65
|
-
hoverVehicleWidth = imgWidth;
|
|
66
|
-
hoverVehicleHeight = imgHeight;
|
|
109
|
+
if (selectedVehicleImg) {
|
|
110
|
+
context.drawImage(selectedVehicleImg, selectedVehiclePx[0] - selectedVehicleWidth / 2, selectedVehiclePx[1] - selectedVehicleHeight / 2, selectedVehicleWidth, selectedVehicleHeight);
|
|
67
111
|
}
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
selectedVehiclePx = px;
|
|
71
|
-
selectedVehicleWidth = imgWidth;
|
|
72
|
-
selectedVehicleHeight = imgHeight;
|
|
112
|
+
if (hoverVehicleImg) {
|
|
113
|
+
context.drawImage(hoverVehicleImg, hoverVehiclePx[0] - hoverVehicleWidth / 2, hoverVehiclePx[1] - hoverVehicleHeight / 2, hoverVehicleWidth, hoverVehicleHeight);
|
|
73
114
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
context.drawImage(selectedVehicleImg, selectedVehiclePx[0] - selectedVehicleWidth / 2, selectedVehiclePx[1] - selectedVehicleHeight / 2, selectedVehicleWidth, selectedVehicleHeight);
|
|
78
|
-
}
|
|
79
|
-
if (hoverVehicleImg) {
|
|
80
|
-
context.drawImage(hoverVehicleImg, hoverVehiclePx[0] - hoverVehicleWidth / 2, hoverVehiclePx[1] - hoverVehicleHeight / 2, hoverVehicleWidth, hoverVehicleHeight);
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
renderedTrajectories
|
|
84
|
-
};
|
|
115
|
+
return {
|
|
116
|
+
renderedTrajectories: renderedTrajectories,
|
|
117
|
+
};
|
|
85
118
|
};
|
|
86
|
-
|
|
119
|
+
exports.default = renderTrajectories;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortByDelay.d.ts","sourceRoot":"","sources":["../../../src/common/utils/sortByDelay.js"],"names":[],"mappings":";AAAA,6DAoBC"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var sortByDelay = function (traj1, traj2) {
|
|
4
|
+
var props1 = traj1.properties;
|
|
5
|
+
var props2 = traj2.properties;
|
|
6
|
+
if (props1.delay === null && props2.delay !== null) {
|
|
7
|
+
return 1;
|
|
8
|
+
}
|
|
9
|
+
if (props2.delay === null && props1.delay !== null) {
|
|
10
|
+
return -1;
|
|
11
|
+
}
|
|
12
|
+
// We put cancelled train inbetween green and yellow trains
|
|
13
|
+
// >=180000ms corresponds to yellow train
|
|
14
|
+
if (props1.cancelled && !props2.cancelled) {
|
|
15
|
+
return props2.delay < 180000 ? -1 : 1;
|
|
16
|
+
}
|
|
17
|
+
if (props2.cancelled && !props1.cancelled) {
|
|
18
|
+
return props1.delay < 180000 ? 1 : -1;
|
|
19
|
+
}
|
|
20
|
+
return props2.delay - props1.delay;
|
|
17
21
|
};
|
|
18
|
-
|
|
22
|
+
exports.default = sortByDelay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeUtils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/timeUtils.js"],"names":[],"mappings":"AAKO,qDAON;AAOM,oDAKM;AAMN,uCAAiE;AAOjE,6DAMN"}
|
|
@@ -1,20 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHoursAndMinutes = exports.pad = exports.getUTCTimeString = exports.getUTCDateString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get a Date object as UTC date string .
|
|
6
|
+
* ex: 2019 09 01
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
var getUTCDateString = function (now) {
|
|
10
|
+
if (now === void 0) { now = new Date(); }
|
|
11
|
+
var month = (now.getUTCMonth() + 1).toString();
|
|
12
|
+
month = month.length === 1 ? "0".concat(month) : month;
|
|
13
|
+
var day = now.getUTCDate().toString();
|
|
14
|
+
day = day.length === 1 ? "0".concat(day) : day;
|
|
15
|
+
return [now.getUTCFullYear(), month, day].join('');
|
|
7
16
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
exports.getUTCDateString = getUTCDateString;
|
|
18
|
+
/**
|
|
19
|
+
* Get the UTC time string of Date object.
|
|
20
|
+
* ex: 09:05:01.123
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
var getUTCTimeString = function (date) {
|
|
24
|
+
return [
|
|
25
|
+
date.getUTCHours(),
|
|
26
|
+
date.getUTCMinutes(),
|
|
27
|
+
"".concat(date.getUTCSeconds(), ".").concat(date.getUTCMilliseconds()),
|
|
28
|
+
].join(':');
|
|
20
29
|
};
|
|
30
|
+
exports.getUTCTimeString = getUTCTimeString;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a string representation of a number, with a zero if the number is lower than 10.
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
var pad = function (integer) { return (integer < 10 ? "0".concat(integer) : integer); };
|
|
36
|
+
exports.pad = pad;
|
|
37
|
+
/**
|
|
38
|
+
* Returns a 'hh:mm' string from a time in ms.
|
|
39
|
+
* @param {Number} timeInMs Time in milliseconds.
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
var getHoursAndMinutes = function (timeInMs) {
|
|
43
|
+
if (!timeInMs || timeInMs <= 0) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
var date = new Date(timeInMs);
|
|
47
|
+
return "".concat((0, exports.pad)(date.getHours()), ":").concat((0, exports.pad)(date.getMinutes()));
|
|
48
|
+
};
|
|
49
|
+
exports.getHoursAndMinutes = getHoursAndMinutes;
|