mobility-toolbox-js 3.0.0-beta.7 → 3.0.0-beta.9
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.d.ts +31 -0
- package/api/RealtimeAPI.d.ts +359 -0
- package/api/RealtimeAPI.js +96 -89
- package/api/RoutingAPI.d.ts +37 -0
- package/api/StopsAPI.d.ts +38 -0
- package/api/WebSocketAPI.d.ts +153 -0
- package/api/index.d.ts +3 -0
- package/api/typedefs.d.ts +178 -0
- package/common/controls/StopFinderControlCommon.d.ts +53 -0
- package/common/index.d.ts +2 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +273 -0
- package/common/styles/index.d.ts +4 -0
- package/common/styles/realtimeDefaultStyle.d.ts +36 -0
- package/common/styles/realtimeDelayStyle.d.ts +12 -0
- package/common/styles/realtimeHeadingStyle.d.ts +12 -0
- package/common/styles/realtimeSimpleStyle.d.ts +4 -0
- package/common/typedefs.d.ts +212 -0
- package/common/utils/compareDepartures.d.ts +10 -0
- package/common/utils/constants.d.ts +5 -0
- package/common/utils/createCanvas.d.ts +10 -0
- package/common/utils/createDefaultCopyrightElt.d.ts +5 -0
- package/common/utils/createDefaultStopFinderElt.d.ts +5 -0
- package/common/utils/createRealtimeFilters.d.ts +12 -0
- package/common/utils/debounceDeparturesMessages.d.ts +12 -0
- package/common/utils/debounceWebsocketMessages.d.ts +11 -0
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.js +5 -1
- package/common/utils/getMapGlCopyrights.d.ts +17 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts +8 -0
- package/common/utils/getVehiclePosition.d.ts +16 -0
- package/common/utils/index.d.ts +16 -0
- package/common/utils/realtimeConfig.d.ts +64 -0
- package/common/utils/removeDuplicate.d.ts +9 -0
- package/common/utils/renderTrajectories.d.ts +16 -0
- package/common/utils/sortAndFilterDepartures.d.ts +15 -0
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/timeUtils.d.ts +23 -0
- package/common/utils/toMercatorExtent.d.ts +5 -0
- package/iife.d.ts +2 -0
- package/index.d.ts +9 -0
- package/maplibre/controls/CopyrightControl.d.ts +35 -0
- package/maplibre/controls/index.d.ts +1 -0
- package/maplibre/index.d.ts +5 -0
- package/maplibre/layers/Layer.d.ts +28 -0
- package/maplibre/layers/RealtimeLayer.d.ts +160 -0
- package/maplibre/layers/RealtimeLayer.js +2 -2
- package/maplibre/layers/index.d.ts +2 -0
- package/maplibre/utils/getMercatorResolution.d.ts +7 -0
- package/maplibre/utils/getSourceCoordinates.d.ts +7 -0
- package/maplibre/utils/index.d.ts +2 -0
- package/mbt.js +137 -114
- package/mbt.js.map +3 -3
- package/mbt.min.js +13 -13
- package/mbt.min.js.map +3 -3
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.js +18 -8
- package/ol/controls/RoutingControl.d.ts +209 -0
- package/ol/controls/RoutingControl.js +3 -0
- package/ol/controls/StopFinderControl.d.ts +37 -0
- package/ol/controls/StopFinderControl.js +3 -0
- package/ol/controls/index.d.ts +3 -0
- package/ol/index.d.ts +6 -0
- package/ol/layers/MapGlLayer.d.ts +144 -0
- package/ol/layers/MapGlLayer.js +3 -1
- package/ol/layers/MaplibreLayer.d.ts +63 -0
- package/ol/layers/MaplibreStyleLayer.d.ts +235 -0
- package/ol/layers/MaplibreStyleLayer.js +1 -1
- package/ol/layers/RealtimeLayer.d.ts +285 -0
- package/ol/layers/RealtimeLayer.js +13 -7
- package/ol/layers/index.d.ts +3 -0
- package/ol/mixins/MobilityLayerMixin.d.ts +98 -0
- package/ol/mixins/MobilityLayerMixin.js +1 -4
- package/ol/mixins/PropertiesLayerMixin.d.ts +127 -0
- package/ol/mixins/PropertiesLayerMixin.js +5 -4
- package/ol/renderers/MaplibreLayerRenderer.d.ts +20 -0
- package/ol/renderers/MaplibreStyleLayerRenderer.d.ts +20 -0
- package/ol/renderers/RealtimeLayerRenderer.d.ts +22 -0
- package/ol/renderers/RealtimeLayerRenderer.js +9 -9
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +6 -0
- package/ol/styles/fullTrajectoryStyle.d.ts +5 -0
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/routingStyle.d.ts +4 -0
- package/ol/utils/getFeatureInfoAtCoordinate.d.ts +8 -0
- package/ol/utils/getFeatureInfoAtCoordinate.js +1 -1
- package/ol/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/setupTests.d.ts +1 -0
package/mbt.js
CHANGED
|
@@ -19610,96 +19610,94 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
19610
19610
|
/**
|
|
19611
19611
|
* Constructor
|
|
19612
19612
|
*
|
|
19613
|
-
* @param {
|
|
19614
|
-
* @param {string} options.url Url to the [geOps realtime
|
|
19613
|
+
* @param {Object} options A string representing the url of the service or an object containing the url and the apiKey.
|
|
19614
|
+
* @param {string} options.url Url to the [geOps realtime API](https://developer.geops.io/apis/realtime/).
|
|
19615
19615
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
19616
|
-
* @param {
|
|
19616
|
+
* @param {string[]} options.bbox The bounding box to receive data from.
|
|
19617
|
+
* @public
|
|
19617
19618
|
*/
|
|
19618
19619
|
constructor(options = {}) {
|
|
19619
19620
|
this.version = "2";
|
|
19620
|
-
|
|
19621
|
-
this.onOpen = this.onOpen.bind(this);
|
|
19622
|
-
}
|
|
19623
|
-
defineProperties(options = {}) {
|
|
19624
|
-
let opt = options || {};
|
|
19621
|
+
let opt = options;
|
|
19625
19622
|
if (typeof options === "string") {
|
|
19626
19623
|
opt = { url: options };
|
|
19627
19624
|
}
|
|
19628
|
-
const { apiKey
|
|
19629
|
-
|
|
19625
|
+
const { apiKey } = opt;
|
|
19626
|
+
const { url } = opt;
|
|
19630
19627
|
const wsApi = new WebSocketAPI_default();
|
|
19631
|
-
|
|
19632
|
-
|
|
19628
|
+
let suffix = "";
|
|
19629
|
+
if (apiKey && !url?.includes("key=")) {
|
|
19630
|
+
suffix = `?key=${apiKey}`;
|
|
19633
19631
|
}
|
|
19634
|
-
|
|
19635
|
-
|
|
19632
|
+
this._url = (url || "wss://api.geops.io/tracker-ws/v1/") + suffix;
|
|
19633
|
+
this._buffer = opt.buffer || [100, 100];
|
|
19634
|
+
this.version = opt.version || "2";
|
|
19635
|
+
this.pingIntervalMs = opt.pingIntervalMs || 1e4;
|
|
19636
|
+
this.reconnectTimeoutMs = opt.reconnectTimeoutMs || 100;
|
|
19637
|
+
this.wsApi = wsApi;
|
|
19638
|
+
}
|
|
19639
|
+
get url() {
|
|
19640
|
+
return this._url;
|
|
19641
|
+
}
|
|
19642
|
+
set url(newUrl) {
|
|
19643
|
+
if (this._url !== newUrl) {
|
|
19644
|
+
this._url = newUrl;
|
|
19645
|
+
if (this.wsApi.open || this.wsApi.connecting) {
|
|
19646
|
+
this.open();
|
|
19647
|
+
}
|
|
19648
|
+
}
|
|
19649
|
+
}
|
|
19650
|
+
/**
|
|
19651
|
+
* The bounding box to receive data from.\
|
|
19652
|
+
* Example: [minX, minY, maxX, maxY, zoom, mots , gen_level, tenant, ...]\
|
|
19653
|
+
* \
|
|
19654
|
+
* Where:
|
|
19655
|
+
* - **minX**: a string representation of an integer (not a float) representing the minimal X coordinate (in EPSG:3857) of a bounding box\
|
|
19656
|
+
*
|
|
19657
|
+
* - **minY**: a string representation of an integer (not a float) representing the minimal Y coordinate (in EPSG:3857) of a bounding box\
|
|
19658
|
+
*
|
|
19659
|
+
* - **maxX**: a string representation of an integer (not a float) representing the maximal X coordinate (in EPSG:3857) of a bounding box\
|
|
19660
|
+
*
|
|
19661
|
+
* - **maxY**: a string representation of an integer (not a float) representing the maximal Y coordinate (in EPSG:3857) of a bounding box\
|
|
19662
|
+
*
|
|
19663
|
+
* - **zoom**: a string representation of an integer representing the zoom level (from 4 to 22). When zoom < 8 only the trains are displayed for performance reasons.\
|
|
19664
|
+
*
|
|
19665
|
+
* - **mots**: A comma separated list of modes of transport. **Optional**.\
|
|
19666
|
+
* Example: "mots=rail,subway".\
|
|
19667
|
+
*
|
|
19668
|
+
* - **gen_level**: An integer representing the generalization level. **Optional**.\
|
|
19669
|
+
* Example: "gen_level=5"\
|
|
19670
|
+
*
|
|
19671
|
+
* - **tenant**: A string representing the tenant. **Optional**.\
|
|
19672
|
+
* Example: "tenant=sbb"\
|
|
19673
|
+
*
|
|
19674
|
+
* - ...: Any other values added to the bbox will be send to the server
|
|
19675
|
+
*
|
|
19676
|
+
* @type {string[]}
|
|
19677
|
+
*
|
|
19678
|
+
* @public
|
|
19679
|
+
*/
|
|
19680
|
+
get bbox() {
|
|
19681
|
+
return this._bbox;
|
|
19682
|
+
}
|
|
19683
|
+
set bbox(newBbox) {
|
|
19684
|
+
if (JSON.stringify(newBbox) !== JSON.stringify(this._bbox)) {
|
|
19685
|
+
this._bbox = newBbox;
|
|
19686
|
+
if (this.wsApi && this._bbox) {
|
|
19687
|
+
this.wsApi.send(`BBOX ${this._bbox.join(" ")}`);
|
|
19688
|
+
}
|
|
19636
19689
|
}
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
}
|
|
19647
|
-
}
|
|
19648
|
-
},
|
|
19649
|
-
bbox: {
|
|
19650
|
-
get: () => bbox,
|
|
19651
|
-
set: (newBbox) => {
|
|
19652
|
-
if (JSON.stringify(newBbox) !== JSON.stringify(bbox)) {
|
|
19653
|
-
bbox = newBbox;
|
|
19654
|
-
if (this.wsApi && bbox) {
|
|
19655
|
-
this.wsApi.send(`BBOX ${bbox.join(" ")}`);
|
|
19656
|
-
}
|
|
19657
|
-
}
|
|
19658
|
-
}
|
|
19659
|
-
},
|
|
19660
|
-
buffer: {
|
|
19661
|
-
get: () => buffer2,
|
|
19662
|
-
set: (newBuffer) => {
|
|
19663
|
-
if (JSON.stringify(newBuffer) !== JSON.stringify(buffer2)) {
|
|
19664
|
-
buffer2 = newBuffer;
|
|
19665
|
-
if (this.wsApi) {
|
|
19666
|
-
this.wsApi.send(`BUFFER ${buffer2.join(" ")}`);
|
|
19667
|
-
}
|
|
19668
|
-
}
|
|
19669
|
-
}
|
|
19670
|
-
},
|
|
19671
|
-
version: {
|
|
19672
|
-
value: version,
|
|
19673
|
-
writable: true
|
|
19674
|
-
},
|
|
19675
|
-
/**
|
|
19676
|
-
* The websocket helper class to connect the websocket.
|
|
19677
|
-
*
|
|
19678
|
-
* @private
|
|
19679
|
-
*/
|
|
19680
|
-
wsApi: {
|
|
19681
|
-
value: wsApi,
|
|
19682
|
-
writable: true
|
|
19683
|
-
},
|
|
19684
|
-
/**
|
|
19685
|
-
* Interval between PING request in ms.
|
|
19686
|
-
* If equal to 0, no PING request are sent.
|
|
19687
|
-
* @type {number}
|
|
19688
|
-
* @private
|
|
19689
|
-
*/
|
|
19690
|
-
pingIntervalMs: {
|
|
19691
|
-
value: options.pingIntervalMs || 1e4,
|
|
19692
|
-
writable: true
|
|
19693
|
-
},
|
|
19694
|
-
/**
|
|
19695
|
-
* Timeout in ms after an automatic reconnection when the websoscket has been closed by the server.
|
|
19696
|
-
* @type {number}
|
|
19697
|
-
*/
|
|
19698
|
-
reconnectTimeoutMs: {
|
|
19699
|
-
value: options.pingIntervalMs || 100,
|
|
19700
|
-
writable: true
|
|
19690
|
+
}
|
|
19691
|
+
get buffer() {
|
|
19692
|
+
return this._buffer;
|
|
19693
|
+
}
|
|
19694
|
+
set buffer(newBuffer) {
|
|
19695
|
+
if (JSON.stringify(newBuffer) !== JSON.stringify(this._buffer)) {
|
|
19696
|
+
this._buffer = newBuffer;
|
|
19697
|
+
if (this.wsApi && this._buffer) {
|
|
19698
|
+
this.wsApi.send(`BUFFER ${this._buffer.join(" ")}`);
|
|
19701
19699
|
}
|
|
19702
|
-
}
|
|
19700
|
+
}
|
|
19703
19701
|
}
|
|
19704
19702
|
/**
|
|
19705
19703
|
* Open the websocket connection.
|
|
@@ -19707,7 +19705,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
19707
19705
|
* @public
|
|
19708
19706
|
*/
|
|
19709
19707
|
open() {
|
|
19710
|
-
this.wsApi.connect(this.url, this.onOpen);
|
|
19708
|
+
this.wsApi.connect(this.url, this.onOpen.bind(this));
|
|
19711
19709
|
if (this.wsApi.websocket) {
|
|
19712
19710
|
this.wsApi.websocket.onclose = () => {
|
|
19713
19711
|
this.onClose();
|
|
@@ -19725,7 +19723,6 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
19725
19723
|
/**
|
|
19726
19724
|
* Unsubscribe trajectory and deleted_vehicles channels. To resubscribe you have to set a new BBOX.
|
|
19727
19725
|
*/
|
|
19728
|
-
// eslint-disable-next-line class-methods-use-this
|
|
19729
19726
|
reset() {
|
|
19730
19727
|
this.wsApi.send("RESET");
|
|
19731
19728
|
}
|
|
@@ -20225,7 +20222,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
20225
20222
|
let flatLayers = [];
|
|
20226
20223
|
layers.forEach((layer) => {
|
|
20227
20224
|
flatLayers.push(layer);
|
|
20228
|
-
const children = layer.children || layer.get("children") ||
|
|
20225
|
+
const children = layer.children || layer.get("children") || layer.getLayers?.()?.getArray();
|
|
20229
20226
|
flatLayers = flatLayers.concat(getLayersAsFlatArray(children || []));
|
|
20230
20227
|
});
|
|
20231
20228
|
return flatLayers;
|
|
@@ -29162,6 +29159,9 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
29162
29159
|
element,
|
|
29163
29160
|
...options
|
|
29164
29161
|
});
|
|
29162
|
+
this.format = options.format || ((copyrights) => {
|
|
29163
|
+
return copyrights?.join(" | ");
|
|
29164
|
+
});
|
|
29165
29165
|
}
|
|
29166
29166
|
render({ frameState }) {
|
|
29167
29167
|
if (!frameState) {
|
|
@@ -29171,14 +29171,23 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
29171
29171
|
let copyrights = [];
|
|
29172
29172
|
frameState?.layerStatesArray.forEach((layerState) => {
|
|
29173
29173
|
const { layer } = layerState;
|
|
29174
|
-
if (frameState && inView(layerState, frameState.viewState)
|
|
29175
|
-
|
|
29176
|
-
|
|
29177
|
-
|
|
29174
|
+
if (frameState && inView(layerState, frameState.viewState)) {
|
|
29175
|
+
if (layer?.getSource()?.getAttributions()) {
|
|
29176
|
+
copyrights = copyrights.concat(
|
|
29177
|
+
layer.getSource().getAttributions()(frameState)
|
|
29178
|
+
);
|
|
29179
|
+
}
|
|
29180
|
+
if (layer?.get("copyrights")) {
|
|
29181
|
+
let copyProp = layer.get("copyrights");
|
|
29182
|
+
copyProp = !Array.isArray(copyProp) ? [copyProp] : copyProp;
|
|
29183
|
+
if (copyProp?.length) {
|
|
29184
|
+
copyrights.push(...copyProp);
|
|
29185
|
+
}
|
|
29186
|
+
}
|
|
29178
29187
|
}
|
|
29179
29188
|
});
|
|
29180
29189
|
const unique = removeDuplicate_default(copyrights) || [];
|
|
29181
|
-
this.element.innerHTML =
|
|
29190
|
+
this.element.innerHTML = this.format(unique);
|
|
29182
29191
|
}
|
|
29183
29192
|
};
|
|
29184
29193
|
var CopyrightControl_default = CopyrightControl;
|
|
@@ -44741,6 +44750,9 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
44741
44750
|
this.segments = [];
|
|
44742
44751
|
this.format = new GeoJSON_default({ featureProjection: "EPSG:3857" });
|
|
44743
44752
|
this.initialRouteDrag = {};
|
|
44753
|
+
if (!this.element) {
|
|
44754
|
+
this.createDefaultElement();
|
|
44755
|
+
}
|
|
44744
44756
|
this.loading = false;
|
|
44745
44757
|
this.active = options.active || true;
|
|
44746
44758
|
this.graphs = options.graphs || [["osm", 0, 99]];
|
|
@@ -45421,6 +45433,9 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
45421
45433
|
const coord = fromLonLat(suggestion.geometry.coordinates);
|
|
45422
45434
|
this.getMap()?.getView().setCenter(coord);
|
|
45423
45435
|
}
|
|
45436
|
+
search(q, abortController) {
|
|
45437
|
+
return this.controller.search(q, abortController);
|
|
45438
|
+
}
|
|
45424
45439
|
};
|
|
45425
45440
|
var StopFinderControl_default = StopFinderControl;
|
|
45426
45441
|
|
|
@@ -45432,8 +45447,9 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
45432
45447
|
|
|
45433
45448
|
// src/ol/mixins/PropertiesLayerMixin.ts
|
|
45434
45449
|
function PropertiesLayerMixin(Base) {
|
|
45435
|
-
return class extends Base {
|
|
45436
|
-
constructor(
|
|
45450
|
+
return class PropertiesLayer extends Base {
|
|
45451
|
+
constructor(...args) {
|
|
45452
|
+
const options = args[0];
|
|
45437
45453
|
super(options);
|
|
45438
45454
|
this.options = {};
|
|
45439
45455
|
this.olListenersKeys = [];
|
|
@@ -45517,6 +45533,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
45517
45533
|
set visible(newValue) {
|
|
45518
45534
|
this.setVisible(newValue);
|
|
45519
45535
|
}
|
|
45536
|
+
// @ts-expect-error - this is a mixin
|
|
45520
45537
|
setMapInternal(map) {
|
|
45521
45538
|
super.setMapInternal(map);
|
|
45522
45539
|
if (map) {
|
|
@@ -45568,10 +45585,10 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
45568
45585
|
|
|
45569
45586
|
// src/ol/mixins/MobilityLayerMixin.ts
|
|
45570
45587
|
function MobilityLayerMixin(Base) {
|
|
45571
|
-
return class extends PropertiesLayerMixin_default(Base) {
|
|
45572
|
-
constructor(options = {}) {
|
|
45573
|
-
|
|
45574
|
-
}
|
|
45588
|
+
return class MobilityLayer extends PropertiesLayerMixin_default(Base) {
|
|
45589
|
+
// constructor(options: MobilityLayerOptions = {}) {
|
|
45590
|
+
// super(options);
|
|
45591
|
+
// }
|
|
45575
45592
|
};
|
|
45576
45593
|
}
|
|
45577
45594
|
var MobilityLayerMixin_default = MobilityLayerMixin;
|
|
@@ -45619,6 +45636,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
45619
45636
|
style: "travic_v2",
|
|
45620
45637
|
url: "https://maps.geops.io",
|
|
45621
45638
|
...options || {},
|
|
45639
|
+
// @ts-expect-error mapOptions must be saved by the mixin in this.options
|
|
45622
45640
|
mapOptions: {
|
|
45623
45641
|
interactive: false,
|
|
45624
45642
|
trackResize: false,
|
|
@@ -46057,7 +46075,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
46057
46075
|
}
|
|
46058
46076
|
}
|
|
46059
46077
|
this.olListenersKeys.push(
|
|
46060
|
-
// @ts-expect-error 'load' is a custom event
|
|
46078
|
+
// @ts-expect-error 'load' is a custom event
|
|
46061
46079
|
this.maplibreLayer.on("load", this.onLoad.bind(this)),
|
|
46062
46080
|
this.on("change:visible", (evt) => {
|
|
46063
46081
|
this.applyLayoutVisibility(evt);
|
|
@@ -47215,7 +47233,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47215
47233
|
this.container.style.position = "absolute";
|
|
47216
47234
|
this.container.style.width = "100%";
|
|
47217
47235
|
this.container.style.height = "100%";
|
|
47218
|
-
if (canvas2) {
|
|
47236
|
+
if (canvas2 instanceof HTMLCanvasElement) {
|
|
47219
47237
|
canvas2.style.position = "absolute";
|
|
47220
47238
|
canvas2.style.top = "0";
|
|
47221
47239
|
canvas2.style.left = "0";
|
|
@@ -47239,17 +47257,20 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47239
47257
|
canvas2?.height
|
|
47240
47258
|
);
|
|
47241
47259
|
} else {
|
|
47242
|
-
const
|
|
47243
|
-
const
|
|
47244
|
-
|
|
47245
|
-
|
|
47246
|
-
|
|
47247
|
-
|
|
47248
|
-
|
|
47249
|
-
|
|
47250
|
-
|
|
47251
|
-
|
|
47252
|
-
|
|
47260
|
+
const map = this.getLayer().getMapInternal();
|
|
47261
|
+
const pixelCenterRendered = map?.getPixelFromCoordinate(renderedCenter);
|
|
47262
|
+
const pixelCenter = map?.getPixelFromCoordinate(center);
|
|
47263
|
+
if (pixelCenterRendered && pixelCenter) {
|
|
47264
|
+
this.container.style.transform = composeCssTransform(
|
|
47265
|
+
pixelCenterRendered[0] - pixelCenter[0],
|
|
47266
|
+
pixelCenterRendered[1] - pixelCenter[1],
|
|
47267
|
+
renderedResolution / resolution,
|
|
47268
|
+
renderedResolution / resolution,
|
|
47269
|
+
rotation - renderedRotation,
|
|
47270
|
+
0,
|
|
47271
|
+
0
|
|
47272
|
+
);
|
|
47273
|
+
}
|
|
47253
47274
|
}
|
|
47254
47275
|
}
|
|
47255
47276
|
return this.container;
|
|
@@ -47290,7 +47311,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47290
47311
|
}
|
|
47291
47312
|
const layer = this.getLayer();
|
|
47292
47313
|
const map = layer.getMapInternal();
|
|
47293
|
-
const resolution = map
|
|
47314
|
+
const resolution = map?.getView()?.getResolution() || 1;
|
|
47294
47315
|
const nb = 10;
|
|
47295
47316
|
const ext = buffer(
|
|
47296
47317
|
[...coordinate, ...coordinate],
|
|
@@ -47327,7 +47348,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47327
47348
|
* @param {RealtimeLayerOptions} options
|
|
47328
47349
|
* @param {boolean} [options.allowRenderWhenAnimating=false] Allow rendering of the layer when the map is animating.
|
|
47329
47350
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
47330
|
-
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps
|
|
47351
|
+
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps realtime API url.
|
|
47331
47352
|
*
|
|
47332
47353
|
*/
|
|
47333
47354
|
constructor(options) {
|
|
@@ -47377,6 +47398,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47377
47398
|
this.olListenersKeys.push(
|
|
47378
47399
|
...this.map.on(
|
|
47379
47400
|
["moveend", "change:target"],
|
|
47401
|
+
// @ts-expect-error - bad ol definitions
|
|
47380
47402
|
(evt) => {
|
|
47381
47403
|
const view = (evt.map || evt.target).getView();
|
|
47382
47404
|
if (view.getAnimating() || view.getInteracting()) {
|
|
@@ -47457,8 +47479,9 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47457
47479
|
isRendered = blockRendering ? false : super.renderTrajectoriesInternal(viewState, noInterpolate);
|
|
47458
47480
|
if (isRendered) {
|
|
47459
47481
|
this.renderedViewState = { ...viewState };
|
|
47460
|
-
|
|
47461
|
-
|
|
47482
|
+
const { container } = this.getRenderer();
|
|
47483
|
+
if (container) {
|
|
47484
|
+
container.style.transform = "";
|
|
47462
47485
|
}
|
|
47463
47486
|
}
|
|
47464
47487
|
return isRendered;
|
|
@@ -47550,7 +47573,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47550
47573
|
return super.purgeTrajectory(
|
|
47551
47574
|
trajectory,
|
|
47552
47575
|
extent || this.map.getView().calculateExtent(),
|
|
47553
|
-
zoom || this.map.getView().getZoom()
|
|
47576
|
+
zoom || this.map.getView().getZoom() || 0
|
|
47554
47577
|
);
|
|
47555
47578
|
}
|
|
47556
47579
|
/**
|
|
@@ -47561,7 +47584,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47561
47584
|
setBbox(extent, zoom) {
|
|
47562
47585
|
super.setBbox(
|
|
47563
47586
|
extent || this.map.getView().calculateExtent(),
|
|
47564
|
-
zoom || this.map.getView().getZoom()
|
|
47587
|
+
zoom || this.map.getView().getZoom() || 0
|
|
47565
47588
|
);
|
|
47566
47589
|
}
|
|
47567
47590
|
/**
|
|
@@ -47639,7 +47662,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
47639
47662
|
}
|
|
47640
47663
|
const source = layer?.getSource();
|
|
47641
47664
|
if (source?.getFeatureInfoUrl) {
|
|
47642
|
-
const id = getUid(
|
|
47665
|
+
const id = getUid(layer);
|
|
47643
47666
|
abortControllers[id]?.abort();
|
|
47644
47667
|
abortControllers[id] = new AbortController();
|
|
47645
47668
|
const resolution = map?.getView()?.getResolution();
|
|
@@ -48400,7 +48423,7 @@ uniform ${i3} ${s3} u_${a3};
|
|
|
48400
48423
|
*
|
|
48401
48424
|
* @param {RealtimeLayerOptions} options
|
|
48402
48425
|
* @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
|
|
48403
|
-
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps
|
|
48426
|
+
* @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps realtime API url.
|
|
48404
48427
|
*
|
|
48405
48428
|
*/
|
|
48406
48429
|
constructor(options = {}) {
|