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,140 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
attachToMap(map) {
|
|
46
|
-
super.attachToMap(map);
|
|
47
|
-
if (!this.map) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
this.format = new GeoJSON({
|
|
51
|
-
featureProjection: this.map.getView().getProjection()
|
|
52
|
-
});
|
|
53
|
-
this.loadMbMap();
|
|
54
|
-
}
|
|
55
|
-
detachFromMap() {
|
|
56
|
-
if (this.mbMap) {
|
|
57
|
-
this.mbMap.off("idle", this.updateAttribution);
|
|
58
|
-
this.mbMap.triggerRepaint = () => {
|
|
59
|
-
};
|
|
60
|
-
this.mbMap.remove();
|
|
61
|
-
this.mbMap = null;
|
|
62
|
-
}
|
|
63
|
-
this.loaded = false;
|
|
64
|
-
super.detachFromMap();
|
|
65
|
-
}
|
|
66
|
-
loadMbMap() {
|
|
67
|
-
this.olListenersKeys.push(this.map.on("change:target", () => {
|
|
68
|
-
this.loadMbMap();
|
|
69
|
-
}));
|
|
70
|
-
if (!this.map.getTargetElement()) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (!this.visible) {
|
|
74
|
-
this.olListenersKeys.push(this.once("change:visible", () => {
|
|
75
|
-
this.loadMbMap();
|
|
76
|
-
}));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const container = document.createElement("div");
|
|
80
|
-
container.style.position = "absolute";
|
|
81
|
-
container.style.width = "100%";
|
|
82
|
-
container.style.height = "100%";
|
|
83
|
-
if (!this.apiKey && !this.styleUrl.includes(this.apiKeyName)) {
|
|
84
|
-
console.error(`No apiKey defined for mapbox layer with style url to ${this.url}`);
|
|
85
|
-
}
|
|
86
|
-
this.mbMap = new Map({
|
|
87
|
-
style: getUrlWithParams(this.styleUrl, {
|
|
88
|
-
[this.apiKeyName]: this.apiKey
|
|
89
|
-
}).toString(),
|
|
90
|
-
container,
|
|
91
|
-
interactive: false,
|
|
92
|
-
trackResize: false,
|
|
93
|
-
attributionControl: false,
|
|
94
|
-
...this.options.mapOptions || {}
|
|
95
|
-
});
|
|
96
|
-
this.mbMap.once("load", () => {
|
|
97
|
-
this.loaded = true;
|
|
98
|
-
this.dispatchEvent({
|
|
99
|
-
type: "load",
|
|
100
|
-
target: this
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
this.mbMap.on("idle", this.updateAttribution);
|
|
104
|
-
}
|
|
105
|
-
updateAttribution(evt) {
|
|
106
|
-
const newAttributions = getMapboxMapCopyrights(evt.target) || [];
|
|
107
|
-
if (this.copyrights?.toString() !== newAttributions.toString()) {
|
|
108
|
-
this.copyrights = newAttributions;
|
|
109
|
-
this.olLayer.getSource()?.setAttributions(newAttributions);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
getFeatureInfoAtCoordinate(coordinate, options) {
|
|
113
|
-
if (!options || !this.format || !this.mbMap || !this.mbMap.isStyleLoaded()) {
|
|
114
|
-
return Promise.resolve({ coordinate, features: [], layer: this });
|
|
115
|
-
}
|
|
116
|
-
let pixel = coordinate && this.mbMap.project(toLonLat(coordinate));
|
|
117
|
-
if (this.hitTolerance) {
|
|
118
|
-
const { x, y } = pixel;
|
|
119
|
-
pixel = [
|
|
120
|
-
{ x: x - this.hitTolerance, y: y - this.hitTolerance },
|
|
121
|
-
{ x: x + this.hitTolerance, y: y + this.hitTolerance }
|
|
122
|
-
];
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var maplibre_gl_1 = require("maplibre-gl");
|
|
30
|
+
var Layer_1 = require("./Layer");
|
|
31
|
+
var MapboxLayerMixin_1 = require("../../common/mixins/MapboxLayerMixin");
|
|
32
|
+
var utils_1 = require("../../common/utils");
|
|
33
|
+
/**
|
|
34
|
+
* A class representing MaplibreLayer to display on BasicMap
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* import { MaplibreLayer } from 'mobility-toolbox-js/ol';
|
|
38
|
+
*
|
|
39
|
+
* const layer = new MaplibreLayer({
|
|
40
|
+
* url: 'https://maps.geops.io/styles/travic_v2/style.json',
|
|
41
|
+
* apikey: 'yourApiKey',
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
45
|
+
* @extends {Layer}
|
|
46
|
+
*/
|
|
47
|
+
var MaplibreLayer = /** @class */ (function (_super) {
|
|
48
|
+
__extends(MaplibreLayer, _super);
|
|
49
|
+
function MaplibreLayer() {
|
|
50
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
123
51
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
52
|
+
MaplibreLayer.prototype.getOlLayerRender = function () {
|
|
53
|
+
return (0, utils_1.getMaplibreRender)(this);
|
|
54
|
+
};
|
|
55
|
+
// eslint-disable-next-line class-methods-use-this
|
|
56
|
+
MaplibreLayer.prototype.getMapboxMapClass = function () {
|
|
57
|
+
return maplibre_gl_1.Map;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Create a copy of the MapboxLayer.
|
|
61
|
+
* @param {Object} newOptions Options to override
|
|
62
|
+
* @return {MapboxLayer} A MapboxLayer
|
|
63
|
+
*/
|
|
64
|
+
MaplibreLayer.prototype.clone = function (newOptions) {
|
|
65
|
+
return new MaplibreLayer(__assign(__assign({}, this.options), newOptions));
|
|
66
|
+
};
|
|
67
|
+
return MaplibreLayer;
|
|
68
|
+
}((0, MapboxLayerMixin_1.default)(Layer_1.default)));
|
|
69
|
+
exports.default = MaplibreLayer;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export default RealtimeLayer;
|
|
2
|
+
/**
|
|
3
|
+
* Responsible for loading and display data from a Realtime service.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* import { RealtimeLayer } from 'mobility-toolbox-js/ol';
|
|
7
|
+
*
|
|
8
|
+
* const layer = new RealtimeLayer({
|
|
9
|
+
* url: [yourUrl],
|
|
10
|
+
* apiKey: [yourApiKey],
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @see <a href="/api/class/src/api/RealtimeAPI%20js~RealtimeAPI%20html">RealtimeAPI</a>
|
|
15
|
+
*
|
|
16
|
+
* @extends {Layer}
|
|
17
|
+
* @implements {UserInteractionsLayerInterface}
|
|
18
|
+
* @implements {RealtimeLayerInterface}
|
|
19
|
+
*/
|
|
20
|
+
declare class RealtimeLayer extends Layer implements UserInteractionsLayerInterface, RealtimeLayerInterface {
|
|
21
|
+
/**
|
|
22
|
+
* Constructor.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} options
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
private constructor();
|
|
28
|
+
/** @ignore */
|
|
29
|
+
olLayer: any;
|
|
30
|
+
container: HTMLDivElement;
|
|
31
|
+
transformContainer: HTMLDivElement;
|
|
32
|
+
vectorLayer: any;
|
|
33
|
+
/** @ignore */
|
|
34
|
+
renderState: {
|
|
35
|
+
center: number[];
|
|
36
|
+
zoom: any;
|
|
37
|
+
rotation: number;
|
|
38
|
+
};
|
|
39
|
+
attachToMap(map: any): void;
|
|
40
|
+
currentZoom: any;
|
|
41
|
+
/**
|
|
42
|
+
* Detect in the canvas if there is data to query at a specific coordinate.
|
|
43
|
+
* @param {ol/coordinate~Coordinate} coordinate The coordinate to test
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
hasFeatureInfoAtCoordinate(coordinate: any): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Render the trajectories using current map's size, resolution and rotation.
|
|
49
|
+
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
50
|
+
* @overrides
|
|
51
|
+
*/
|
|
52
|
+
renderTrajectories(noInterpolate: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Launch renderTrajectories. it avoids duplicating code in renderTrajectories methhod.
|
|
55
|
+
* @private
|
|
56
|
+
* @override
|
|
57
|
+
*/
|
|
58
|
+
private override renderTrajectoriesInternal;
|
|
59
|
+
renderedViewState: any;
|
|
60
|
+
/**
|
|
61
|
+
* Return the delay in ms before the next rendering.
|
|
62
|
+
*/
|
|
63
|
+
getRefreshTimeInMs(): any;
|
|
64
|
+
getFeatureInfoAtCoordinate(coordinate: any, options?: {}): any;
|
|
65
|
+
/**
|
|
66
|
+
* On move end we update the websocket with the new bbox.
|
|
67
|
+
*
|
|
68
|
+
* @private
|
|
69
|
+
* @override
|
|
70
|
+
*/
|
|
71
|
+
private override onMoveEnd;
|
|
72
|
+
/**
|
|
73
|
+
* Function called on moveend event only when the zoom has changed.
|
|
74
|
+
*
|
|
75
|
+
* @param {ol/MapEvent~MapEvent} evt Moveend event.
|
|
76
|
+
* @private
|
|
77
|
+
* @override
|
|
78
|
+
*/
|
|
79
|
+
private override onZoomEnd;
|
|
80
|
+
/**
|
|
81
|
+
* Update the cursor style when hovering a vehicle.
|
|
82
|
+
*
|
|
83
|
+
* @private
|
|
84
|
+
* @override
|
|
85
|
+
*/
|
|
86
|
+
private override onFeatureHover;
|
|
87
|
+
/**
|
|
88
|
+
* Display the complete trajectory of the vehicle.
|
|
89
|
+
*
|
|
90
|
+
* @private
|
|
91
|
+
* @override
|
|
92
|
+
*/
|
|
93
|
+
private override onFeatureClick;
|
|
94
|
+
/**
|
|
95
|
+
* Remove the trajectory form the list if necessary.
|
|
96
|
+
*
|
|
97
|
+
* @private
|
|
98
|
+
*/
|
|
99
|
+
private purgeTrajectory;
|
|
100
|
+
/**
|
|
101
|
+
* Send the current bbox to the websocket
|
|
102
|
+
*
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
private setBbox;
|
|
106
|
+
/**
|
|
107
|
+
* Highlight the trajectory of journey.
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
private highlightTrajectory;
|
|
111
|
+
/**
|
|
112
|
+
* Create a copy of the RealtimeLayer.
|
|
113
|
+
* @param {Object} newOptions Options to override
|
|
114
|
+
* @return {RealtimeLayer} A RealtimeLayer
|
|
115
|
+
*/
|
|
116
|
+
clone(newOptions: any): RealtimeLayer;
|
|
117
|
+
}
|
|
118
|
+
import Layer from "./Layer";
|
|
119
|
+
//# sourceMappingURL=RealtimeLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RealtimeLayer.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;GAiBG;AACH,qDAHgB,8BAA8B,EAC9B,sBAAsB;IAGpC;;;;;OAKG;IACH,sBA2FC;IApFC,cAAc;IACd,aAsEI;IApDQ,0BAA8C;IAI9C,mCAAuD;IAmDnE,iBAAmD;IAInD,cAAc;IACd;;;;MAIC;IAGH,4BAqBC;IANO,iBAAuB;IAgB/B;;;;OAIG;IACH,qDAYC;IAED;;;;OAIG;IACH,kCAHW,OAAO,QAiBjB;IAED;;;;OAIG;IACH,4CAuBC;IAPG,uBAAyC;IAS7C;;OAEG;IACH,0BAEC;IAED,+DAMC;IAED;;;;;OAKG;IACH,2BAaC;IAED;;;;;;OAMG;IAEH,2BAEC;IAED;;;;;OAKG;IACH,gCAKC;IAED;;;;;OAKG;IACH,gCAQC;IAED;;;;OAIG;IACH,wBAMC;IAED;;;;OAIG;IACH,gBAQC;IAED;;;OAGG;IACH,4BAiBC;IAED;;;;OAIG;IACH,wBAFY,aAAa,CAIxB;CACF"}
|