mobility-toolbox-js 3.0.1-beta.3 → 3.0.1-beta.4

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.
@@ -112,6 +112,7 @@ class RealtimeLayer extends Layer {
112
112
  this.onMoveEndDebounced = debounce(this.onMoveEnd, 100);
113
113
  }
114
114
  attachToMap() {
115
+ var _a;
115
116
  this.engine.attachToMap();
116
117
  const mapInternal = this.getMapInternal();
117
118
  if (mapInternal) {
@@ -120,6 +121,9 @@ class RealtimeLayer extends Layer {
120
121
  this.engine.start();
121
122
  }
122
123
  const index = mapInternal.getLayers().getArray().indexOf(this);
124
+ if (this.vectorLayer.getMapInternal() === mapInternal) {
125
+ (_a = this.getMapInternal()) === null || _a === void 0 ? void 0 : _a.removeLayer(this.vectorLayer);
126
+ }
123
127
  mapInternal.getLayers().insertAt(index, this.vectorLayer);
124
128
  this.olEventsKeys.push(...mapInternal.on(['moveend', 'change:target'],
125
129
  // @ts-expect-error - bad ol definitions
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mobility-toolbox-js",
3
3
  "license": "MIT",
4
4
  "description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
5
- "version": "3.0.1-beta.3",
5
+ "version": "3.0.1-beta.4",
6
6
  "homepage": "https://mobility-toolbox-js.geops.io/",
7
7
  "exports": {
8
8
  ".": "./index.js",