mobility-toolbox-js 2.0.0-beta.28 → 2.0.0-beta.30

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.
@@ -229,6 +229,9 @@ const RealtimeLayerMixin = (Base) => class extends Base {
229
229
  }
230
230
  }
231
231
  renderTrajectoriesInternal(viewState, noInterpolate) {
232
+ if (!this.map) {
233
+ return false;
234
+ }
232
235
  const time = this.live ? Date.now() : this.time;
233
236
  const trajectories = Object.values(this.trajectories);
234
237
  if (this.sort) {
@@ -158,13 +158,19 @@ class RealtimeLayer extends mixin(Layer) {
158
158
  super.setBbox(newExtent, newZoom);
159
159
  }
160
160
  onMove() {
161
- const extent = getSourceCoordinates(this.map, this.pixelRatio);
162
- const source = this.map.getSource(this.key);
163
- if (source) {
164
- source.setCoordinates(extent);
165
- }
166
161
  this.renderTrajectories();
167
162
  }
163
+ renderTrajectoriesInternal(viewState, noInterpolate) {
164
+ const render = super.renderTrajectoriesInternal(viewState, noInterpolate);
165
+ if (render) {
166
+ const extent = getSourceCoordinates(this.map, this.pixelRatio);
167
+ const source = this.map.getSource(this.key);
168
+ if (source) {
169
+ source.setCoordinates(extent);
170
+ }
171
+ }
172
+ return render;
173
+ }
168
174
  onMoveEnd() {
169
175
  this.renderTrajectories();
170
176
  if (this.visible && this.isUpdateBboxOnMoveEnd) {
package/mbt.js CHANGED
@@ -48762,6 +48762,9 @@ uniform ${i3} ${o3} u_${a3};
48762
48762
  }
48763
48763
  }
48764
48764
  renderTrajectoriesInternal(viewState, noInterpolate) {
48765
+ if (!this.map) {
48766
+ return false;
48767
+ }
48765
48768
  const time = this.live ? Date.now() : this.time;
48766
48769
  const trajectories = Object.values(this.trajectories);
48767
48770
  if (this.sort) {
@@ -49144,6 +49147,9 @@ uniform ${i3} ${o3} u_${a3};
49144
49147
  }, noInterpolate);
49145
49148
  }
49146
49149
  renderTrajectoriesInternal(viewState, noInterpolate) {
49150
+ if (!this.map) {
49151
+ return false;
49152
+ }
49147
49153
  let isRendered = false;
49148
49154
  const blockRendering = this.map.getView().getAnimating() || this.map.getView().getInteracting();
49149
49155
  isRendered = blockRendering ? false : super.renderTrajectoriesInternal(viewState, noInterpolate);
@@ -49153,6 +49159,7 @@ uniform ${i3} ${o3} u_${a3};
49153
49159
  this.transformContainer.style.transform = "";
49154
49160
  }
49155
49161
  }
49162
+ return isRendered;
49156
49163
  }
49157
49164
  getRefreshTimeInMs() {
49158
49165
  return super.getRefreshTimeInMs(this.map.getView().getZoom());
@@ -50051,13 +50058,19 @@ uniform ${i3} ${o3} u_${a3};
50051
50058
  super.setBbox(newExtent, newZoom);
50052
50059
  }
50053
50060
  onMove() {
50054
- const extent = getSourceCoordinates(this.map, this.pixelRatio);
50055
- const source = this.map.getSource(this.key);
50056
- if (source) {
50057
- source.setCoordinates(extent);
50058
- }
50059
50061
  this.renderTrajectories();
50060
50062
  }
50063
+ renderTrajectoriesInternal(viewState, noInterpolate) {
50064
+ const render = super.renderTrajectoriesInternal(viewState, noInterpolate);
50065
+ if (render) {
50066
+ const extent = getSourceCoordinates(this.map, this.pixelRatio);
50067
+ const source = this.map.getSource(this.key);
50068
+ if (source) {
50069
+ source.setCoordinates(extent);
50070
+ }
50071
+ }
50072
+ return render;
50073
+ }
50061
50074
  onMoveEnd() {
50062
50075
  this.renderTrajectories();
50063
50076
  if (this.visible && this.isUpdateBboxOnMoveEnd) {