mobility-toolbox-js 2.0.0-beta.26 → 2.0.0-beta.29

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.
@@ -169,7 +169,7 @@ const RealtimeLayerMixin = (Base) => class extends Base {
169
169
  writable: true
170
170
  },
171
171
  useThrottle: {
172
- value: options.useThrottle || true,
172
+ value: options.useThrottle !== false,
173
173
  writable: true
174
174
  },
175
175
  useDebounce: {
@@ -97,6 +97,9 @@ class RealtimeLayer extends mixin(Layer) {
97
97
  });
98
98
  }
99
99
  renderTrajectories(noInterpolate) {
100
+ if (!this.map) {
101
+ return;
102
+ }
100
103
  const { width, height } = this.map.getCanvas();
101
104
  const center = this.map.getCenter();
102
105
  const leftBottom = this.map.unproject({
@@ -155,13 +158,19 @@ class RealtimeLayer extends mixin(Layer) {
155
158
  super.setBbox(newExtent, newZoom);
156
159
  }
157
160
  onMove() {
158
- const extent = getSourceCoordinates(this.map, this.pixelRatio);
159
- const source = this.map.getSource(this.key);
160
- if (source) {
161
- source.setCoordinates(extent);
162
- }
163
161
  this.renderTrajectories();
164
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
+ }
165
174
  onMoveEnd() {
166
175
  this.renderTrajectories();
167
176
  if (this.visible && this.isUpdateBboxOnMoveEnd) {
package/mbt.js CHANGED
@@ -48702,7 +48702,7 @@ uniform ${i3} ${o3} u_${a3};
48702
48702
  writable: true
48703
48703
  },
48704
48704
  useThrottle: {
48705
- value: options.useThrottle || true,
48705
+ value: options.useThrottle !== false,
48706
48706
  writable: true
48707
48707
  },
48708
48708
  useDebounce: {
@@ -49990,6 +49990,9 @@ uniform ${i3} ${o3} u_${a3};
49990
49990
  });
49991
49991
  }
49992
49992
  renderTrajectories(noInterpolate) {
49993
+ if (!this.map) {
49994
+ return;
49995
+ }
49993
49996
  const { width, height } = this.map.getCanvas();
49994
49997
  const center = this.map.getCenter();
49995
49998
  const leftBottom = this.map.unproject({
@@ -50048,13 +50051,19 @@ uniform ${i3} ${o3} u_${a3};
50048
50051
  super.setBbox(newExtent, newZoom);
50049
50052
  }
50050
50053
  onMove() {
50051
- const extent = getSourceCoordinates(this.map, this.pixelRatio);
50052
- const source = this.map.getSource(this.key);
50053
- if (source) {
50054
- source.setCoordinates(extent);
50055
- }
50056
50054
  this.renderTrajectories();
50057
50055
  }
50056
+ renderTrajectoriesInternal(viewState, noInterpolate) {
50057
+ const render = super.renderTrajectoriesInternal(viewState, noInterpolate);
50058
+ if (render) {
50059
+ const extent = getSourceCoordinates(this.map, this.pixelRatio);
50060
+ const source = this.map.getSource(this.key);
50061
+ if (source) {
50062
+ source.setCoordinates(extent);
50063
+ }
50064
+ }
50065
+ return render;
50066
+ }
50058
50067
  onMoveEnd() {
50059
50068
  this.renderTrajectories();
50060
50069
  if (this.visible && this.isUpdateBboxOnMoveEnd) {