mobility-toolbox-js 3.0.0-beta.31 → 3.0.0-beta.33
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/HttpAPI.js +1 -3
- package/api/RealtimeAPI.d.ts +3 -3
- package/api/WebSocketAPI.js +0 -1
- package/common/styles/realtimeDefaultStyle.js +0 -5
- package/common/styles/realtimeHeadingStyle.js +0 -5
- package/common/styles/realtimeSimpleStyle.d.ts +0 -1
- package/common/styles/realtimeSimpleStyle.js +0 -1
- package/common/utils/RealtimeEngine.d.ts +224 -0
- package/common/utils/RealtimeEngine.js +565 -0
- package/common/utils/getLayersAsFlatArray.d.ts +0 -1
- package/common/utils/getLayersAsFlatArray.js +0 -1
- package/common/utils/realtimeConfig.d.ts +1 -1
- package/common/utils/realtimeConfig.js +0 -1
- package/maplibre/layers/RealtimeLayer.d.ts +50 -109
- package/maplibre/layers/RealtimeLayer.js +108 -111
- package/mbt.js +5122 -13362
- package/mbt.js.map +4 -4
- package/mbt.min.js +67 -70
- package/mbt.min.js.map +4 -4
- package/ol/controls/RoutingControl.d.ts +5 -4
- package/ol/controls/RoutingControl.js +2 -29
- package/ol/controls/StopFinderControl.d.ts +2 -5
- package/ol/controls/StopFinderControl.js +0 -3
- package/ol/layers/MaplibreLayer.d.ts +29 -18
- package/ol/layers/MaplibreLayer.js +18 -10
- package/ol/layers/MaplibreStyleLayer.d.ts +39 -27
- package/ol/layers/MaplibreStyleLayer.js +33 -28
- package/ol/layers/RealtimeLayer.d.ts +72 -124
- package/ol/layers/RealtimeLayer.js +130 -168
- package/ol/mixins/PropertiesLayerMixin.d.ts +4 -6
- package/ol/mixins/PropertiesLayerMixin.js +0 -2
- package/ol/renderers/RealtimeLayerRenderer.js +6 -31
- package/ol/styles/fullTrajectoryDelayStyle.js +5 -7
- package/ol/styles/fullTrajectoryStyle.d.ts +1 -2
- package/ol/styles/fullTrajectoryStyle.js +5 -7
- package/ol/styles/routingStyle.d.ts +0 -1
- package/ol/styles/routingStyle.js +2 -7
- package/package.json +31 -30
- package/types/common.d.ts +2 -1
- package/common/mixins/RealtimeLayerMixin.d.ts +0 -267
- package/common/mixins/RealtimeLayerMixin.js +0 -751
|
@@ -13,33 +13,38 @@ if (typeof window !== 'undefined' &&
|
|
|
13
13
|
}, 1000);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Layer
|
|
16
|
+
* Layer that helps show/hide a specific subset of style layers of a [MaplibreLayer](./MaplibreLayer.js~MaplibreLayer.html).
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
|
-
* import {
|
|
19
|
+
* import { MaplibreLayer, MaplibreStyleLayer } from 'mobility-toolbox-js/ol';
|
|
20
20
|
*
|
|
21
|
-
* const maplibreLayer = new
|
|
22
|
-
*
|
|
21
|
+
* const maplibreLayer = new MaplibreLayer({
|
|
22
|
+
* apiKey: 'yourApiKey',
|
|
23
23
|
* });
|
|
24
24
|
*
|
|
25
|
-
* const layer = new
|
|
25
|
+
* const layer = new MaplibreStyleLayer({
|
|
26
26
|
* maplibreLayer: maplibreLayer,
|
|
27
|
-
*
|
|
27
|
+
* layersFilter: (layer) => {
|
|
28
|
+
* // show/hide only style layers related to stations
|
|
29
|
+
* return /station/.test(layer.id);
|
|
30
|
+
* },
|
|
28
31
|
* });
|
|
29
32
|
*
|
|
30
|
-
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
31
33
|
* @extends {ol/layer/Layer~Layer}
|
|
34
|
+
* @public
|
|
32
35
|
*/
|
|
33
36
|
class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
34
37
|
/**
|
|
35
38
|
* Constructor.
|
|
36
39
|
*
|
|
37
40
|
* @param {Object} options
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {maplibregl.SourceSpecification[]} [options.sources] The source to add to the style on load.
|
|
41
|
+
* @param {string} [options.beforeId] The style layer id to use when the options.layers property is defined, unsused otherwise.
|
|
40
42
|
* @param {maplibregl.AddLayerObject[]} [options.layers] The layers to add to the style on load.
|
|
41
43
|
* @param {FilterFunction} [options.layersFilter] Filter function to decide which style layer to apply visiblity on. If not provided, the 'layers' property is used.
|
|
44
|
+
* @param {MaplibreLayer} [options.maplibreLayer] The MaplibreLayer to use.
|
|
42
45
|
* @param {FilterFunction} [options.queryRenderedLayersFilter] Filter function to decide which style layer are available for query.
|
|
46
|
+
* @param {maplibregl.SourceSpecification[]} [options.sources] The sources to add to the style on load.
|
|
47
|
+
* @public
|
|
43
48
|
*/
|
|
44
49
|
constructor(options = {
|
|
45
50
|
mapLibreOptions: { style: { layers: [], sources: {}, version: 8 } },
|
|
@@ -69,9 +74,7 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
69
74
|
super(Object.assign({ source: new Source({}) }, options));
|
|
70
75
|
this.highlightedFeatures = [];
|
|
71
76
|
this.selectedFeatures = [];
|
|
72
|
-
|
|
73
|
-
* @private
|
|
74
|
-
*/
|
|
77
|
+
this.beforeId = options.beforeId;
|
|
75
78
|
this.onLoad = this.onLoad.bind(this);
|
|
76
79
|
if (!this.layersFilter && this.layers) {
|
|
77
80
|
this.layersFilter = (layer) => {
|
|
@@ -79,7 +82,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
79
82
|
};
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
/** @private */
|
|
83
85
|
addLayers() {
|
|
84
86
|
var _a;
|
|
85
87
|
if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.mapLibreMap) || !Array.isArray(this.layers)) {
|
|
@@ -99,7 +101,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
99
101
|
this.applyLayoutVisibility();
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
/** @private */
|
|
103
104
|
addSources() {
|
|
104
105
|
var _a;
|
|
105
106
|
if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.mapLibreMap) || !this.sources) {
|
|
@@ -198,9 +199,11 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
198
199
|
}));
|
|
199
200
|
}
|
|
200
201
|
/**
|
|
201
|
-
* Create a copy of the
|
|
202
|
-
*
|
|
203
|
-
* @
|
|
202
|
+
* Create a copy of the MaplibreStyleLayer.
|
|
203
|
+
*
|
|
204
|
+
* @param {Object} newOptions Options to override. See constructor.
|
|
205
|
+
* @return {MapboxStyleLayer} A MaplibreStyleLayer.
|
|
206
|
+
* @public
|
|
204
207
|
*/
|
|
205
208
|
clone(newOptions) {
|
|
206
209
|
return new MaplibreStyleLayer(Object.assign(Object.assign({}, this.options), newOptions));
|
|
@@ -225,6 +228,7 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
225
228
|
* Request feature information for a given coordinate.
|
|
226
229
|
* @param {ol/coordinate~Coordinate} coordinate Coordinate to request the information at.
|
|
227
230
|
* @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
|
|
231
|
+
* @deprecated Use getFeatureInfoAtCoordinate([layer], coordinate) from mobility-toolbox-ol package instead.
|
|
228
232
|
*/
|
|
229
233
|
getFeatureInfoAtCoordinate(coordinate) {
|
|
230
234
|
var _a;
|
|
@@ -275,11 +279,11 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
275
279
|
/**
|
|
276
280
|
* Highlight a list of features.
|
|
277
281
|
* @param {Array<ol/Feature~Feature>} [features=[]] Features to highlight.
|
|
278
|
-
* @
|
|
282
|
+
* @deprecated Use layer.setFeatureState(features, {hover: true|false}) instead.
|
|
279
283
|
*/
|
|
280
284
|
highlight(features = []) {
|
|
281
285
|
var _a;
|
|
282
|
-
deprecated(`Deprecated. Use layer.setFeatureState(features, {
|
|
286
|
+
deprecated(`Deprecated. Use layer.setFeatureState(features, {hover: true}) instead.`);
|
|
283
287
|
// Filter out selected features
|
|
284
288
|
const filtered = ((_a = this.highlightedFeatures) === null || _a === void 0 ? void 0 : _a.filter((feature) => !(this.selectedFeatures || [])
|
|
285
289
|
.map((feat) => feat.getId())
|
|
@@ -292,7 +296,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
292
296
|
}
|
|
293
297
|
/**
|
|
294
298
|
* On Maplibre map load callback function. Add style layers and dynaimc filters.
|
|
295
|
-
* @private
|
|
296
299
|
*/
|
|
297
300
|
onLoad() {
|
|
298
301
|
var _a;
|
|
@@ -309,7 +312,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
309
312
|
}
|
|
310
313
|
this.applyLayoutVisibility();
|
|
311
314
|
}
|
|
312
|
-
/** @private */
|
|
313
315
|
removeLayers() {
|
|
314
316
|
var _a;
|
|
315
317
|
if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.mapLibreMap) || !Array.isArray(this.layers)) {
|
|
@@ -325,7 +327,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
325
327
|
});
|
|
326
328
|
}
|
|
327
329
|
}
|
|
328
|
-
/** @private */
|
|
329
330
|
removeSources() {
|
|
330
331
|
var _a;
|
|
331
332
|
if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.mapLibreMap) || !this.sources) {
|
|
@@ -343,7 +344,7 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
343
344
|
/**
|
|
344
345
|
* Select a list of features.
|
|
345
346
|
* @param {Array<ol/Feature~Feature>} [features=[]] Features to select.
|
|
346
|
-
* @
|
|
347
|
+
* @deprecated Use layer.setFeatureState(features, {selected: true|false}) instead.
|
|
347
348
|
*/
|
|
348
349
|
select(features = []) {
|
|
349
350
|
deprecated(`Deprecated. Use layer.setFeatureState(features, {selected: true}) instead.`);
|
|
@@ -353,8 +354,9 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
353
354
|
}
|
|
354
355
|
/**
|
|
355
356
|
* Set the feature state of the features.
|
|
356
|
-
*
|
|
357
|
-
* @param {
|
|
357
|
+
*
|
|
358
|
+
* @param {ol/Feature~Feature[]} features
|
|
359
|
+
* @param {maplibregl.FeatureState} state The feature state
|
|
358
360
|
* @public
|
|
359
361
|
*/
|
|
360
362
|
setFeatureState(features, state) {
|
|
@@ -382,7 +384,7 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
382
384
|
* Set if features are hovered or not.
|
|
383
385
|
* @param {Array<ol/Feature~Feature>} features
|
|
384
386
|
* @param {boolean} state Is the feature hovered
|
|
385
|
-
* @
|
|
387
|
+
* @deprecated Use layer.setFeatureState(features, {hover: true|false}) instead.
|
|
386
388
|
*/
|
|
387
389
|
setHoverState(features, state) {
|
|
388
390
|
deprecated(`Deprecated. Use layer.setFeatureState(features, {hover: ${state}}) instead.`);
|
|
@@ -406,6 +408,9 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
406
408
|
set layersFilter(newValue) {
|
|
407
409
|
this.set('layersFilter', newValue);
|
|
408
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* @deprecated Use MaplibreStyleLayer.maplibreLayer instead.
|
|
413
|
+
*/
|
|
409
414
|
get mapboxLayer() {
|
|
410
415
|
deprecated('Deprecated. Use maplibreLayer instead.');
|
|
411
416
|
return this.get('maplibreLayer');
|
|
@@ -445,10 +450,10 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
|
|
|
445
450
|
this.set('sources', newValue);
|
|
446
451
|
}
|
|
447
452
|
/**
|
|
448
|
-
* @deprecated
|
|
453
|
+
* @deprecated Use MaplibreStyleLayer.layer instead.
|
|
449
454
|
*/
|
|
450
455
|
get styleLayer() {
|
|
451
|
-
deprecated('
|
|
456
|
+
deprecated('Deprecated. Use MaplibreStyleLayer.layer instead.');
|
|
452
457
|
return this.layers[0];
|
|
453
458
|
}
|
|
454
459
|
/**
|
|
@@ -1,92 +1,23 @@
|
|
|
1
|
+
import { DebouncedFunc } from 'lodash';
|
|
1
2
|
import { Map, MapEvent } from 'ol';
|
|
2
3
|
import Feature, { FeatureLike } from 'ol/Feature';
|
|
3
|
-
import GeoJSON from 'ol/format/GeoJSON';
|
|
4
4
|
import { Vector as VectorLayer } from 'ol/layer';
|
|
5
5
|
import Layer from 'ol/layer/Layer';
|
|
6
6
|
import { ObjectEvent } from 'ol/Object';
|
|
7
|
+
import { Vector as VectorSource } from 'ol/source';
|
|
7
8
|
import Source from 'ol/source/Source';
|
|
9
|
+
import { State } from 'ol/View';
|
|
8
10
|
import { WebSocketAPIMessageEventData } from '../../api/WebSocketAPI';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import RealtimeEngine, { RealtimeEngineOptions } from '../../common/utils/RealtimeEngine';
|
|
12
|
+
import { RealtimeAPI } from '../../maplibre';
|
|
13
|
+
import { RealtimeFullTrajectory, RealtimeMode, RealtimeRenderState, RealtimeTrainId, ViewState } from '../../types';
|
|
11
14
|
import RealtimeLayerRenderer from '../renderers/RealtimeLayerRenderer';
|
|
12
|
-
export type RealtimeLayerOptions =
|
|
15
|
+
export type RealtimeLayerOptions = {
|
|
13
16
|
allowRenderWhenAnimating?: boolean;
|
|
14
17
|
fullTrajectoryStyle?: (feature: FeatureLike, resolution: number, options: any) => void;
|
|
15
|
-
|
|
18
|
+
maxNbFeaturesRequested?: number;
|
|
19
|
+
} & RealtimeEngineOptions;
|
|
16
20
|
declare const RealtimeLayer_base: {
|
|
17
|
-
new (options: RealtimeLayerMixinOptions): {
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
[x: symbol]: any;
|
|
20
|
-
api: import("..").RealtimeAPI;
|
|
21
|
-
bboxParameters?: Record<string, boolean | boolean[] | number | number[] | string | string[]>;
|
|
22
|
-
canvas?: import("../../types").AnyCanvas;
|
|
23
|
-
debounceRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean) => void;
|
|
24
|
-
debug: boolean;
|
|
25
|
-
filter?: import("../../common/typedefs").FilterFunction;
|
|
26
|
-
format: GeoJSON;
|
|
27
|
-
generalizationLevel?: import("../../types").RealtimeGeneralizationLevel;
|
|
28
|
-
generalizationLevelByZoom: import("../../types").RealtimeGeneralizationLevel[];
|
|
29
|
-
getGeneralizationLevelByZoom: (zoom: number) => import("../../types").RealtimeGeneralizationLevel;
|
|
30
|
-
getMotsByZoom: (zoom: number) => import("../../types").RealtimeMot[];
|
|
31
|
-
getRenderTimeIntervalByZoom: (zoom: number) => number;
|
|
32
|
-
hoverVehicleId?: RealtimeTrainId;
|
|
33
|
-
isUpdateBboxOnMoveEnd: boolean;
|
|
34
|
-
live?: boolean;
|
|
35
|
-
minZoomInterpolation: number;
|
|
36
|
-
mode: import("../../types").RealtimeMode;
|
|
37
|
-
mots?: import("../../types").RealtimeMot[];
|
|
38
|
-
motsByZoom: import("../../types").RealtimeMot[][];
|
|
39
|
-
onStart?: ((realtimeLayer: import("../../types").AnyLayer) => void) | undefined;
|
|
40
|
-
onStop?: ((realtimeLayer: import("../../types").AnyLayer) => void) | undefined;
|
|
41
|
-
pixelRatio?: number;
|
|
42
|
-
renderState?: import("../../types").RealtimeRenderState;
|
|
43
|
-
renderTimeIntervalByZoom: number[];
|
|
44
|
-
requestId?: number;
|
|
45
|
-
selectedVehicle: RealtimeTrajectory;
|
|
46
|
-
selectedVehicleId?: RealtimeTrainId;
|
|
47
|
-
sort?: import("../../common/typedefs").SortFunction;
|
|
48
|
-
speed?: number;
|
|
49
|
-
style?: import("../../types").RealtimeStyleFunction;
|
|
50
|
-
styleOptions?: import("../../types").RealtimeStyleOptions;
|
|
51
|
-
tenant: import("../../types").RealtimeTenant;
|
|
52
|
-
throttleRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean) => void;
|
|
53
|
-
time?: Date;
|
|
54
|
-
trajectories?: Record<RealtimeTrainId, RealtimeTrajectory>;
|
|
55
|
-
updateTimeDelay?: number;
|
|
56
|
-
updateTimeInterval?: number;
|
|
57
|
-
useDebounce?: boolean;
|
|
58
|
-
useRequestAnimationFrame?: boolean;
|
|
59
|
-
useThrottle?: boolean;
|
|
60
|
-
visibilityRef: import("ol/events").EventsKey;
|
|
61
|
-
addTrajectory(trajectory: RealtimeTrajectory): void;
|
|
62
|
-
attachToMap(map: import("../../types").AnyMap): void;
|
|
63
|
-
defineProperties(options: RealtimeLayerMixinOptions): void;
|
|
64
|
-
detachFromMap(): void;
|
|
65
|
-
getFeatureInfoAtCoordinate(coordinate: import("ol/coordinate").Coordinate, options: import("../../types").LayerGetFeatureInfoOptions): Promise<import("../../types").LayerGetFeatureInfoResponse>;
|
|
66
|
-
getRefreshTimeInMs(zoom?: number | undefined): number;
|
|
67
|
-
getTrajectoryInfos(id: RealtimeTrainId): Promise<{
|
|
68
|
-
fullTrajectory: WebSocketAPIMessageEventData<import("../../types").RealtimeStopSequence[]> | WebSocketAPIMessageEventData<RealtimeFullTrajectory>;
|
|
69
|
-
stopSequence: WebSocketAPIMessageEventData<import("../../types").RealtimeStopSequence[]> | WebSocketAPIMessageEventData<RealtimeFullTrajectory>;
|
|
70
|
-
}>;
|
|
71
|
-
getVehicle(filterFc: import("../../common/typedefs").FilterFunction): RealtimeTrajectory[];
|
|
72
|
-
highlightVehicle(id: RealtimeTrainId): void;
|
|
73
|
-
onDeleteTrajectoryMessage(data: WebSocketAPIMessageEventData<RealtimeTrainId>): void;
|
|
74
|
-
onDocumentVisibilityChange(): void;
|
|
75
|
-
onTrajectoryMessage(data: WebSocketAPIMessageEventData<RealtimeTrajectory>): void;
|
|
76
|
-
onZoomEnd(): void;
|
|
77
|
-
purgeOutOfDateTrajectories(): void;
|
|
78
|
-
purgeTrajectory(trajectory: RealtimeTrajectory, extent: [number, number, number, number], zoom: number): boolean;
|
|
79
|
-
removeTrajectory(trajectoryOrId: RealtimeTrainId | RealtimeTrajectory): void;
|
|
80
|
-
renderTrajectories(viewState: undefined | ViewState, noInterpolate: boolean | undefined): void;
|
|
81
|
-
renderTrajectoriesInternal(viewState: ViewState, noInterpolate?: boolean): boolean;
|
|
82
|
-
selectVehicle(id: RealtimeTrainId): void;
|
|
83
|
-
setBbox(extent: [number, number, number, number], zoom: number): void;
|
|
84
|
-
start(): void;
|
|
85
|
-
startUpdateTime(): void;
|
|
86
|
-
stop(): void;
|
|
87
|
-
stopUpdateTime(): void;
|
|
88
|
-
};
|
|
89
|
-
} & {
|
|
90
21
|
new (...args: any[]): {
|
|
91
22
|
olEventsKeys: import("ol/events").EventsKey[];
|
|
92
23
|
options?: import("../mixins/PropertiesLayerMixin").PropertiesLayerMixinOptions;
|
|
@@ -197,87 +128,104 @@ declare const RealtimeLayer_base: {
|
|
|
197
128
|
* @public
|
|
198
129
|
*/
|
|
199
130
|
declare class RealtimeLayer extends RealtimeLayer_base {
|
|
200
|
-
/** @private */
|
|
201
131
|
allowRenderWhenAnimating?: boolean;
|
|
202
|
-
|
|
132
|
+
currentZoom?: number;
|
|
133
|
+
engine: RealtimeEngine;
|
|
134
|
+
maxNbFeaturesRequested: number;
|
|
135
|
+
onMoveEndDebounced: DebouncedFunc<(evt: MapEvent | ObjectEvent) => void>;
|
|
136
|
+
onZoomEndDebounced: DebouncedFunc<(evt: MapEvent | ObjectEvent) => void>;
|
|
137
|
+
renderedViewState: State | undefined;
|
|
138
|
+
vectorLayer: VectorLayer<VectorSource>;
|
|
203
139
|
/**
|
|
204
140
|
* Constructor.
|
|
205
141
|
*
|
|
206
142
|
* @param {RealtimeLayerOptions} options
|
|
207
143
|
* @param {boolean} [options.allowRenderWhenAnimating=false] Allow rendering of the layer when the map is animating.
|
|
208
|
-
* @param {string} options.apiKey Access key for [geOps
|
|
209
|
-
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
|
|
144
|
+
* @param {string} options.apiKey Access key for [geOps APIs](https://developer.geops.io/).
|
|
145
|
+
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The [geOps Realtime API](https://developer.geops.io/apis/realtime/) url.
|
|
210
146
|
*
|
|
211
147
|
*/
|
|
212
148
|
constructor(options: RealtimeLayerOptions);
|
|
213
|
-
/** @private */
|
|
214
149
|
attachToMap(map: Map): void;
|
|
215
150
|
/**
|
|
216
151
|
* Create a copy of the RealtimeLayer.
|
|
217
|
-
*
|
|
152
|
+
*
|
|
153
|
+
* @param {Object} newOptions Options to override. See constructor.
|
|
218
154
|
* @return {RealtimeLayer} A RealtimeLayer
|
|
155
|
+
* @public
|
|
219
156
|
*/
|
|
220
157
|
clone(newOptions: RealtimeLayerOptions): RealtimeLayer;
|
|
221
|
-
/**
|
|
222
|
-
* @private
|
|
223
|
-
*/
|
|
224
158
|
createRenderer(): RealtimeLayerRenderer;
|
|
225
|
-
/**
|
|
226
|
-
* Render the trajectories using current map's size, resolution and rotation.
|
|
227
|
-
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
228
|
-
* @overrides
|
|
229
|
-
* @private
|
|
230
|
-
*/
|
|
231
159
|
/**
|
|
232
160
|
* Destroy the container of the tracker.
|
|
233
|
-
* @private
|
|
234
161
|
*/
|
|
235
162
|
detachFromMap(): void;
|
|
236
163
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @private
|
|
239
|
-
*/
|
|
240
|
-
getRefreshTimeInMs(): number;
|
|
241
|
-
highlight(feature: Feature): void;
|
|
242
|
-
/**
|
|
243
|
-
* On move end we update the websocket with the new bbox.
|
|
164
|
+
* Get some informations about a trajectory.
|
|
244
165
|
*
|
|
245
|
-
* @
|
|
246
|
-
* @
|
|
166
|
+
* @param {RealtimeTrainId} id A vehicle's id.
|
|
167
|
+
* @returns
|
|
247
168
|
*/
|
|
169
|
+
getTrajectoryInfos(id: RealtimeTrainId): Promise<{
|
|
170
|
+
fullTrajectory: WebSocketAPIMessageEventData<RealtimeFullTrajectory> | WebSocketAPIMessageEventData<import("../../types").RealtimeStopSequence[]>;
|
|
171
|
+
stopSequence: WebSocketAPIMessageEventData<RealtimeFullTrajectory> | WebSocketAPIMessageEventData<import("../../types").RealtimeStopSequence[]>;
|
|
172
|
+
}>;
|
|
173
|
+
getViewState(): {
|
|
174
|
+
center?: undefined;
|
|
175
|
+
extent?: undefined;
|
|
176
|
+
pixelRatio?: undefined;
|
|
177
|
+
resolution?: undefined;
|
|
178
|
+
rotation?: undefined;
|
|
179
|
+
size?: undefined;
|
|
180
|
+
visible?: undefined;
|
|
181
|
+
zoom?: undefined;
|
|
182
|
+
} | {
|
|
183
|
+
center: import("ol/coordinate").Coordinate | undefined;
|
|
184
|
+
extent: import("ol/extent").Extent;
|
|
185
|
+
pixelRatio: number | undefined;
|
|
186
|
+
resolution: number | undefined;
|
|
187
|
+
rotation: number;
|
|
188
|
+
size: import("ol/size").Size | undefined;
|
|
189
|
+
visible: boolean;
|
|
190
|
+
zoom: number | undefined;
|
|
191
|
+
};
|
|
192
|
+
highlight(feature: Feature): void;
|
|
248
193
|
/**
|
|
249
194
|
* Highlight the trajectory of journey.
|
|
250
|
-
* @private
|
|
251
195
|
*/
|
|
252
196
|
highlightTrajectory(id: RealtimeTrainId): Promise<Feature[] | undefined>;
|
|
197
|
+
onMoveEnd(): void;
|
|
253
198
|
/**
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
* @param {ol/MapEvent~MapEvent} evt Moveend event.
|
|
257
|
-
* @private
|
|
258
|
-
* @override
|
|
199
|
+
* Callback when the RealtimeEngine has rendered successfully.
|
|
259
200
|
*/
|
|
260
|
-
|
|
201
|
+
onRealtimeEngineRender(renderState: RealtimeRenderState, viewState: ViewState): void;
|
|
261
202
|
onZoomEnd(): void;
|
|
203
|
+
select(feature: Feature): void;
|
|
204
|
+
shouldRender(): boolean;
|
|
262
205
|
/**
|
|
263
|
-
*
|
|
206
|
+
* Start the rendering.
|
|
264
207
|
*
|
|
265
|
-
* @
|
|
266
|
-
*/
|
|
267
|
-
purgeTrajectory(trajectory: RealtimeTrajectory, extent: [number, number, number, number], zoom: number): boolean;
|
|
268
|
-
renderTrajectories(noInterpolate: boolean): void;
|
|
269
|
-
/**
|
|
270
|
-
* Launch renderTrajectories. it avoids duplicating code in renderTrajectories methhod.
|
|
271
|
-
* @private
|
|
272
|
-
* @override
|
|
208
|
+
* @public
|
|
273
209
|
*/
|
|
274
|
-
|
|
275
|
-
select(feature: Feature): void;
|
|
210
|
+
start(): void;
|
|
276
211
|
/**
|
|
277
|
-
*
|
|
212
|
+
* Stop the rendering.
|
|
278
213
|
*
|
|
279
|
-
* @
|
|
214
|
+
* @public
|
|
280
215
|
*/
|
|
281
|
-
|
|
216
|
+
stop(): void;
|
|
217
|
+
get api(): RealtimeAPI;
|
|
218
|
+
set api(api: RealtimeAPI);
|
|
219
|
+
get canvas(): import("../../types").AnyCanvas | undefined;
|
|
220
|
+
get filter(): Function | undefined;
|
|
221
|
+
get hoverVehicleId(): RealtimeTrainId | undefined;
|
|
222
|
+
set hoverVehicleId(id: RealtimeTrainId);
|
|
223
|
+
get mode(): RealtimeMode;
|
|
224
|
+
set mode(mode: RealtimeMode);
|
|
225
|
+
get pixelRatio(): number | undefined;
|
|
226
|
+
get selectedVehicleId(): RealtimeTrainId | undefined;
|
|
227
|
+
set selectedVehicleId(id: RealtimeTrainId);
|
|
228
|
+
get sort(): Function | undefined;
|
|
229
|
+
get trajectories(): Record<string, import("../../types").RealtimeTrajectory> | undefined;
|
|
282
230
|
}
|
|
283
231
|
export default RealtimeLayer;
|