mobility-toolbox-js 3.0.0-beta.11 → 3.0.0-beta.12

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.
Files changed (47) hide show
  1. package/api/RealtimeAPI.d.ts +28 -22
  2. package/api/RealtimeAPI.js +23 -16
  3. package/api/RoutingAPI.d.ts +16 -6
  4. package/api/RoutingAPI.js +16 -6
  5. package/api/StopsAPI.d.ts +3 -3
  6. package/api/StopsAPI.js +3 -3
  7. package/api/WebSocketAPI.d.ts +2 -2
  8. package/api/WebSocketAPI.js +2 -2
  9. package/api/typedefs.d.ts +0 -102
  10. package/api/typedefs.js +27 -42
  11. package/common/controls/StopFinderControlCommon.d.ts +1 -1
  12. package/common/controls/StopFinderControlCommon.js +1 -1
  13. package/common/mixins/RealtimeLayerMixin.d.ts +10 -11
  14. package/common/mixins/RealtimeLayerMixin.js +17 -9
  15. package/common/typedefs.d.ts +7 -0
  16. package/common/typedefs.js +6 -0
  17. package/common/utils/compareDepartures.d.ts +2 -2
  18. package/common/utils/compareDepartures.js +2 -2
  19. package/common/utils/getRealtimeModeSuffix.d.ts +1 -0
  20. package/common/utils/getRealtimeModeSuffix.js +1 -0
  21. package/common/utils/getVehiclePosition.d.ts +3 -2
  22. package/common/utils/getVehiclePosition.js +6 -1
  23. package/common/utils/renderTrajectories.d.ts +1 -1
  24. package/common/utils/renderTrajectories.js +1 -1
  25. package/common/utils/sortAndFilterDepartures.d.ts +1 -1
  26. package/common/utils/sortAndFilterDepartures.js +1 -1
  27. package/common/utils/sortByDelay.d.ts +2 -2
  28. package/common/utils/sortByDelay.js +5 -1
  29. package/maplibre/layers/Layer.d.ts +1 -1
  30. package/maplibre/layers/Layer.js +1 -1
  31. package/maplibre/layers/RealtimeLayer.d.ts +40 -11
  32. package/maplibre/layers/RealtimeLayer.js +27 -3
  33. package/mbt.js +85 -43
  34. package/mbt.js.map +4 -4
  35. package/mbt.min.js +12 -12
  36. package/mbt.min.js.map +4 -4
  37. package/ol/controls/RoutingControl.d.ts +1 -1
  38. package/ol/controls/RoutingControl.js +1 -1
  39. package/ol/layers/Layer.d.ts +101 -0
  40. package/ol/layers/Layer.js +17 -0
  41. package/ol/layers/MaplibreLayer.d.ts +3 -3
  42. package/ol/layers/MaplibreLayer.js +3 -3
  43. package/ol/layers/RealtimeLayer.d.ts +15 -12
  44. package/ol/layers/index.d.ts +1 -0
  45. package/ol/layers/index.js +1 -0
  46. package/ol/renderers/RealtimeLayerRenderer.js +4 -1
  47. package/package.json +1 -1
package/mbt.js CHANGED
@@ -17856,6 +17856,7 @@ uniform ${i3} ${s3} u_${a3};
17856
17856
  var ol_exports = {};
17857
17857
  __export(ol_exports, {
17858
17858
  CopyrightControl: () => CopyrightControl_default,
17859
+ Layer: () => Layer_default4,
17859
17860
  MaplibreLayer: () => MaplibreLayer_default,
17860
17861
  MaplibreStyleLayer: () => MaplibreStyleLayer_default,
17861
17862
  RealtimeAPI: () => RealtimeAPI_default,
@@ -17949,19 +17950,21 @@ uniform ${i3} ${s3} u_${a3};
17949
17950
  /**
17950
17951
  * Constructor
17951
17952
  *
17952
- * @param {RoutingAPIOptions} options Options.
17953
- * @param {string} [options.url='https://api.geops.io/routing/v1/'] Service url.
17953
+ * @param {Object} options Options.
17954
17954
  * @param {string} options.apiKey Access key for [geOps services](https://developer.geops.io/).
17955
+ * @param {string} [options.url='https://api.geops.io/routing/v1/'] Service url.
17956
+ * @public
17955
17957
  */
17956
17958
  constructor(options = {}) {
17957
17959
  super({ url: "https://api.geops.io/routing/v1/", ...options });
17958
17960
  }
17959
17961
  /**
17960
- * Route.
17962
+ * Calculate a route.
17961
17963
  *
17962
- * @param {RoutingParameters} params Request parameters. See [Routing service documentation](https://developer.geops.io/apis/routing/).
17963
- * @param {RequestInit} config Options for the fetch request.
17964
+ * @param {RoutingParameters} params Request parameters. See [geOps Routing API](https://developer.geops.io/apis/routing/).
17965
+ * @param {FetchOptions} config Options for the fetch request.
17964
17966
  * @return {Promise<RoutingResponse>} An GeoJSON feature collection with coordinates in [EPSG:4326](http://epsg.io/4326).
17967
+ * @public
17965
17968
  */
17966
17969
  route(params, config) {
17967
17970
  return this.fetch("", params, config);
@@ -17983,11 +17986,11 @@ uniform ${i3} ${s3} u_${a3};
17983
17986
  super({ url: "https://api.geops.io/stops/v1/", ...options });
17984
17987
  }
17985
17988
  /**
17986
- * Search fo stops.
17989
+ * Search for stops.
17987
17990
  *
17988
- * @param {StopsAPIParameters} params Request parameters. See [Stops API documentation](https://developer.geops.io/apis/stops).
17991
+ * @param {StopsParameters} params Request parameters. See [Stops API documentation](https://developer.geops.io/apis/stops).
17989
17992
  * @param {FetchOptions} config Options for the fetch request.
17990
- * @returns {Promise<StopsAPIResponse>} An GeoJSON feature collection with coordinates in [EPSG:4326](http://epsg.io/4326). See [Stops API documentation](https://developer.geops.io/apis/stops).
17993
+ * @returns {Promise<StopsResponse>} An GeoJSON feature collection with coordinates in [EPSG:4326](http://epsg.io/4326). See [Stops API documentation](https://developer.geops.io/apis/stops).
17991
17994
  * @public
17992
17995
  */
17993
17996
  search(params, config) {
@@ -18207,8 +18210,8 @@ uniform ${i3} ${s3} u_${a3};
18207
18210
  * The callback is called only once, when the response is received or when the call returns an error.
18208
18211
  *
18209
18212
  * @param {Object} params Parameters for the websocket get request
18210
- * @param {function} onMessage callback on message event
18211
- * @param {function} onError Callback on error and close event
18213
+ * @param {function} cb callback on message event
18214
+ * @param {function} errorCb Callback on error and close event
18212
18215
  * @private
18213
18216
  */
18214
18217
  get(params, cb, errorCb) {
@@ -18563,8 +18566,7 @@ uniform ${i3} ${s3} u_${a3};
18563
18566
  * Subscribe to departures channel of a given station.
18564
18567
  *
18565
18568
  * @param {number} stationId UIC of the station.
18566
- * @param {Boolean} sortByMinArrivalTime Sort by minimum arrival time
18567
- * @param {function(departures:Departure[])} onMessage Function called on each message of the channel.
18569
+ * @param {function(departures: RealtimeDeparture[])} onMessage Function called on each message of the channel.
18568
18570
  * @param {function} onError Callback when the subscription fails.
18569
18571
  * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
18570
18572
  * @public
@@ -18575,16 +18577,17 @@ uniform ${i3} ${s3} u_${a3};
18575
18577
  }
18576
18578
  /**
18577
18579
  * Unsubscribe from current departures channel.
18578
- * @param {RealtimeStationId} id Station's id
18580
+ * @param {number} stationId UIC of the station.
18579
18581
  * @param {function(data: { content: RealtimeDeparture[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18580
18582
  * @public
18581
18583
  */
18582
- unsubscribeDepartures(id, onMessage) {
18583
- this.unsubscribe(`timetable_${id}`, "", onMessage);
18584
+ unsubscribeDepartures(stationId, onMessage) {
18585
+ this.unsubscribe(`timetable_${stationId}`, "", onMessage);
18584
18586
  }
18585
18587
  /**
18586
18588
  * Subscribe to the disruptions channel for tenant.
18587
18589
  *
18590
+ * @param {RealtimeTenant} tenant Tenant's id
18588
18591
  * @param {function(data: { content: RealtimeNews[] })} onMessage Function called on each message of the channel.
18589
18592
  * @param {function} onError Callback when the subscription fails.
18590
18593
  * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
@@ -18596,8 +18599,8 @@ uniform ${i3} ${s3} u_${a3};
18596
18599
  }
18597
18600
  /**
18598
18601
  * Unsubscribe disruptions.
18599
- *
18600
- * @param {function(data: { content: RealtimeNews[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18602
+ * @param {RealtimeTenant} tenant Tenant's id
18603
+ * @param {Function(data: { content: RealtimeNews[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18601
18604
  * @public
18602
18605
  */
18603
18606
  unsubscribeDisruptions(tenant, onMessage) {
@@ -18680,7 +18683,7 @@ uniform ${i3} ${s3} u_${a3};
18680
18683
  /**
18681
18684
  * Return a partial trajectory with a given id and a mode.
18682
18685
  *
18683
- * @param {number} trainId The identifier of a trajectory.
18686
+ * @param {number} id The identifier of a trajectory.
18684
18687
  * @param {RealtimeMode} mode Realtime mode.
18685
18688
  * @return {Promise<{data: { content: RealtimeTrajectory }}>} A trajectory.
18686
18689
  * @public
@@ -18694,7 +18697,7 @@ uniform ${i3} ${s3} u_${a3};
18694
18697
  * Subscribe to trajectory channel.
18695
18698
  *
18696
18699
  * @param {RealtimeMode} mode Realtime mode.
18697
- * @param {function(data: { content: RealtimeTrajectoryResponse[] })} onMessage Function called on each message of the channel.
18700
+ * @param {function(data: { content: RealtimeTrajectory })} onMessage Function called on each message of the channel.
18698
18701
  * @param {function} onError Callback when the subscription fails.
18699
18702
  * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
18700
18703
  * @public
@@ -18710,7 +18713,7 @@ uniform ${i3} ${s3} u_${a3};
18710
18713
  }
18711
18714
  /**
18712
18715
  * Unsubscribe to trajectory channels.
18713
- * @param {function(data: { content: RealtimeTrajectoryResponse[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18716
+ * @param {function(data: { content: RealtimeTrajectory })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18714
18717
  * @public
18715
18718
  */
18716
18719
  unsubscribeTrajectory(onMessage) {
@@ -18746,7 +18749,7 @@ uniform ${i3} ${s3} u_${a3};
18746
18749
  * @param {string} id A vehicle id.
18747
18750
  * @param {RealtimeMode} mode Realtime mode.
18748
18751
  * @param {string} generalizationLevel The generalization level to request. Can be one of 5 (more generalized), 10, 30, 100, undefined (less generalized).
18749
- * @return {Promise<{ data: { content: RealtimeFullTrajectory } }>} Return a full trajectory.
18752
+ * @return {Promise<{data: { content: RealtimeFullTrajectory }}>} Return a full trajectory.
18750
18753
  * @public
18751
18754
  */
18752
18755
  getFullTrajectory(id, mode, generalizationLevel) {
@@ -18768,7 +18771,7 @@ uniform ${i3} ${s3} u_${a3};
18768
18771
  *
18769
18772
  * @param {string} id A vehicle id.
18770
18773
  * @param {RealtimeMode} mode Realtime mode.
18771
- * @param {function(data: { content: RealtimeFullTrajectory })} onMessage Function called on each message of the channel.
18774
+ * @param {function(data:{content: RealtimeFullTrajectory})} onMessage Function called on each message of the channel.
18772
18775
  * @param {function} onError Callback when the subscription fails.
18773
18776
  * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
18774
18777
  * @public
@@ -18781,11 +18784,18 @@ uniform ${i3} ${s3} u_${a3};
18781
18784
  }
18782
18785
  this.subscribe(`full_trajectory${suffix}_${id}`, onMessage, onError, quiet);
18783
18786
  }
18787
+ /**
18788
+ * This callback type is called `requestCallback` and is displayed as a global symbol.
18789
+ *
18790
+ * @callback onFullTrajectoryMessageCallback
18791
+ * @param {number} responseCode
18792
+ * @param {string} responseMessage
18793
+ */
18784
18794
  /**
18785
18795
  * Unsubscribe from full_trajectory channel
18786
18796
  *
18787
18797
  * @param {string} id A vehicle id.
18788
- * @param {function(data: { content: RealtimeFullTrajectory })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18798
+ * @param {onFullTrajectoryMessageCallback} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18789
18799
  * @public
18790
18800
  */
18791
18801
  unsubscribeFullTrajectory(id, onMessage) {
@@ -18795,7 +18805,7 @@ uniform ${i3} ${s3} u_${a3};
18795
18805
  * Get the list of stops for this vehicle.
18796
18806
  *
18797
18807
  * @param {string} id A vehicle id.
18798
- * @return {Promise<{ data: { content: StopSequence[] } }>} Returns a stop sequence object.
18808
+ * @return {Promise<{data: { content: RealtimeStopSequence[] }}>} Returns a stop sequence object.
18799
18809
  * @public
18800
18810
  */
18801
18811
  getStopSequence(id) {
@@ -18805,7 +18815,7 @@ uniform ${i3} ${s3} u_${a3};
18805
18815
  * Subscribe to stopsequence channel of a given vehicle.
18806
18816
  *
18807
18817
  * @param {string} id A vehicle id.
18808
- * @param {function(data: { content: StopSequence[] })} onMessage Function called on each message of the channel.
18818
+ * @param {function(data: { content: RealtimeStopSequence[] })} onMessage Function called on each message of the channel.
18809
18819
  * @param {function} onError Callback when the subscription fails.
18810
18820
  * @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
18811
18821
  * @public
@@ -18818,7 +18828,7 @@ uniform ${i3} ${s3} u_${a3};
18818
18828
  * Unsubscribe from stopsequence channel
18819
18829
  *
18820
18830
  * @param {string} id A vehicle id.
18821
- * @param {function(data: { content: StopSequence[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18831
+ * @param {function(data: { content: RealtimeStopSequence[] })} onMessage Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
18822
18832
  * @public
18823
18833
  */
18824
18834
  unsubscribeStopSequence(id, onMessage) {
@@ -24410,7 +24420,9 @@ uniform ${i3} ${s3} u_${a3};
24410
24420
  var getVehiclePosition = (now, trajectory, noInterpolate) => {
24411
24421
  const {
24412
24422
  time_intervals: timeIntervals,
24423
+ // @ts-expect-error olGeometry is added by the RealtimeLayer
24413
24424
  olGeometry,
24425
+ // @ts-expect-error coordinate is added by the RealtimeLayer
24414
24426
  coordinate
24415
24427
  } = trajectory.properties;
24416
24428
  let { type, coordinates: coordinates2 } = trajectory.geometry;
@@ -44171,7 +44183,7 @@ uniform ${i3} ${s3} u_${a3};
44171
44183
  /**
44172
44184
  * Launch a search.
44173
44185
  *
44174
- * @param {String} query The query to search for.
44186
+ * @param {String} q The query to search for.
44175
44187
  * @param {AbortController} abortController Abort controller used to cancel the request.
44176
44188
  * @return {Promise<Array<GeoJSONFeature>>} An array of GeoJSON features with coordinates in [EPSG:4326](http://epsg.io/4326).
44177
44189
  */
@@ -44520,10 +44532,10 @@ uniform ${i3} ${s3} u_${a3};
44520
44532
  *
44521
44533
  * @param {MaplibreLayerOptions} options
44522
44534
  * @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
44523
- * @param {string} [options.apiKeyName="key"] The geOps Maps api key name.
44535
+ * @param {string} [options.apiKeyName="key"] The geOps Maps API key name.
44524
44536
  * @param {maplibregl.MapOptions} [options.mapOptions={ interactive: false, trackResize: false, attributionControl: false }] Maplibre map options.
44525
- * @param {string} [options.style="travic_v2"] The geOps Maps api style.
44526
- * @param {string} [options.url="https://maps.geops.io"] The geOps Maps api url.
44537
+ * @param {string} [options.style="travic_v2"] The geOps Maps API style.
44538
+ * @param {string} [options.url="https://maps.geops.io"] The geOps Maps API url.
44527
44539
  */
44528
44540
  constructor(options) {
44529
44541
  super({
@@ -45664,7 +45676,8 @@ uniform ${i3} ${s3} u_${a3};
45664
45676
  }
45665
45677
  const vehicles = [];
45666
45678
  for (let i = 0; i < trajectories.length; i += 1) {
45667
- if (trajectories[i].properties.coordinate && containsCoordinate(ext, trajectories[i].properties.coordinate)) {
45679
+ const { coordinate: trajcoord } = trajectories[i].properties;
45680
+ if (trajcoord && containsCoordinate(ext, trajcoord)) {
45668
45681
  vehicles.push(trajectories[i]);
45669
45682
  }
45670
45683
  if (vehicles.length === nb) {
@@ -45673,7 +45686,7 @@ uniform ${i3} ${s3} u_${a3};
45673
45686
  }
45674
45687
  return Promise.resolve({
45675
45688
  layer: this,
45676
- features: vehicles,
45689
+ features: vehicles.map((vehicle) => this.format.readFeature(vehicle)),
45677
45690
  coordinate
45678
45691
  });
45679
45692
  }
@@ -45681,7 +45694,7 @@ uniform ${i3} ${s3} u_${a3};
45681
45694
  * Request the stopSequence and the fullTrajectory informations for a vehicle.
45682
45695
  *
45683
45696
  * @param {string} id The vehicle identifier (the train_id property).
45684
- * @return {Promise<{stopSequence: StopSequence, fullTrajectory: FullTrajectory>} A promise that will be resolved with the trajectory informations.
45697
+ * @return {Promise<{stopSequence: RealtimeStopSequence, fullTrajectory: RealtimeFullTrajectory>} A promise that will be resolved with the trajectory informations.
45685
45698
  */
45686
45699
  getTrajectoryInfos(id) {
45687
45700
  const promises = [
@@ -45708,9 +45721,9 @@ uniform ${i3} ${s3} u_${a3};
45708
45721
  purgeOutOfDateTrajectories() {
45709
45722
  Object.entries(this.trajectories || {}).forEach(([key, trajectory]) => {
45710
45723
  const timeIntervals = trajectory?.properties?.time_intervals;
45711
- if (this.time && timeIntervals.length) {
45724
+ if (this.time && timeIntervals?.length) {
45712
45725
  const lastTimeInterval = timeIntervals[timeIntervals.length - 1][0];
45713
- if (lastTimeInterval < this.time) {
45726
+ if (lastTimeInterval < this.time.getTime()) {
45714
45727
  this.removeTrajectory(key);
45715
45728
  }
45716
45729
  }
@@ -45745,7 +45758,10 @@ uniform ${i3} ${s3} u_${a3};
45745
45758
  if (!this.trajectories) {
45746
45759
  this.trajectories = {};
45747
45760
  }
45748
- this.trajectories[trajectory.properties.train_id] = trajectory;
45761
+ const id = trajectory.properties.train_id;
45762
+ if (id !== void 0) {
45763
+ this.trajectories[id] = trajectory;
45764
+ }
45749
45765
  this.renderTrajectories();
45750
45766
  }
45751
45767
  removeTrajectory(trajectoryOrId) {
@@ -45755,7 +45771,7 @@ uniform ${i3} ${s3} u_${a3};
45755
45771
  } else {
45756
45772
  id = trajectoryOrId;
45757
45773
  }
45758
- if (this.trajectories) {
45774
+ if (id !== void 0 && this.trajectories) {
45759
45775
  delete this.trajectories[id];
45760
45776
  }
45761
45777
  }
@@ -46125,7 +46141,11 @@ uniform ${i3} ${s3} u_${a3};
46125
46141
  const vehicles = [];
46126
46142
  for (let i = 0; i < trajectories.length; i += 1) {
46127
46143
  const trajectory = trajectories[i];
46128
- if (trajectory.properties.coordinate && containsCoordinate(ext, trajectory.properties.coordinate)) {
46144
+ if (
46145
+ // @ts-expect-error coordinate is added by the RealtimeLayer
46146
+ trajectory.properties.coordinate && // @ts-expect-error coordinate is added by the RealtimeLayer
46147
+ containsCoordinate(ext, trajectory.properties.coordinate)
46148
+ ) {
46129
46149
  vehicles.push(trajectories[i]);
46130
46150
  }
46131
46151
  if (vehicles.length === nb) {
@@ -46429,6 +46449,21 @@ uniform ${i3} ${s3} u_${a3};
46429
46449
  };
46430
46450
  var RealtimeLayer_default = RealtimeLayer;
46431
46451
 
46452
+ // src/ol/layers/Layer.ts
46453
+ var Layer2 = class _Layer extends MobilityLayerMixin_default(Layer_default) {
46454
+ constructor(options) {
46455
+ super(options);
46456
+ console.warn("Layer is deprecated. Use an OpenLayers Layer instead.");
46457
+ }
46458
+ clone(newOptions) {
46459
+ return new _Layer({
46460
+ ...this.options || {},
46461
+ ...newOptions || {}
46462
+ });
46463
+ }
46464
+ };
46465
+ var Layer_default4 = Layer2;
46466
+
46432
46467
  // src/ol/utils/getFeatureInfoAtCoordinate.ts
46433
46468
  var format3 = new GeoJSON_default();
46434
46469
  var getFeaturesFromWMS = (source, options, abortController) => {
@@ -46517,7 +46552,7 @@ uniform ${i3} ${s3} u_${a3};
46517
46552
  var maplibre_exports = {};
46518
46553
  __export(maplibre_exports, {
46519
46554
  CopyrightControl: () => CopyrightControl_default2,
46520
- Layer: () => Layer_default4,
46555
+ Layer: () => Layer_default5,
46521
46556
  RealtimeAPI: () => RealtimeAPI_default,
46522
46557
  RealtimeLayer: () => RealtimeLayer_default2,
46523
46558
  RealtimeModes: () => RealtimeModes,
@@ -46653,7 +46688,7 @@ uniform ${i3} ${s3} u_${a3};
46653
46688
 
46654
46689
  // src/maplibre/layers/Layer.ts
46655
46690
  var import_maplibre_gl2 = __toESM(require_maplibre_gl());
46656
- var Layer2 = class extends import_maplibre_gl2.Evented {
46691
+ var Layer3 = class extends import_maplibre_gl2.Evented {
46657
46692
  constructor(options = {}) {
46658
46693
  super();
46659
46694
  this.options = {};
@@ -46673,7 +46708,7 @@ uniform ${i3} ${s3} u_${a3};
46673
46708
  render(gl) {
46674
46709
  }
46675
46710
  };
46676
- var Layer_default4 = Layer2;
46711
+ var Layer_default5 = Layer3;
46677
46712
 
46678
46713
  // node_modules/@turf/helpers/dist/es/index.js
46679
46714
  var earthRadius = 63710088e-1;
@@ -47205,19 +47240,26 @@ uniform ${i3} ${s3} u_${a3};
47205
47240
  var toMercatorExtent_default = toMercatorExtent;
47206
47241
 
47207
47242
  // src/maplibre/layers/RealtimeLayer.ts
47208
- var RealtimeLayer2 = class extends RealtimeLayerMixin_default(Layer_default4) {
47243
+ var RealtimeLayer2 = class extends RealtimeLayerMixin_default(Layer_default5) {
47209
47244
  /**
47210
47245
  * Constructor.
47211
47246
  *
47212
47247
  * @param {RealtimeLayerOptions} options
47213
47248
  * @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
47249
+ * @param {FilterFunction} options.filter Filter out a train. This function must be fast, it is executed for every trajectory on every render frame.
47250
+ * @param {getMotsByZoomFunction} options.getMotsByZoom Returns for each zoom level the list of MOTs to display. It filters trains on backend side.
47251
+ * @param {number} [options.minZoomInterpolation=8] Minimal zoom level where to start to interpolate train positions.
47252
+ * @param {RealtimeMode} [options.mode='topographic'] The realtime mode to use.
47253
+ * @param {SortFunction} options.sort Sort trains. This function must be fast, it is executed on every render frame.
47254
+ * @param {RealtimeStyleFunction} options.style Function to style the trajectories.
47255
+ * @param {RealtimeTenant} options.tenant Filter trains by its tenant. It filters trains on backend side.
47214
47256
  * @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
47215
- *
47216
47257
  */
47217
47258
  constructor(options = {}) {
47218
47259
  const canvas2 = document.createElement("canvas");
47219
47260
  super({
47220
47261
  canvas: canvas2,
47262
+ id: "realtime",
47221
47263
  ...options
47222
47264
  });
47223
47265
  this.source = {