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