mobility-toolbox-js 1.7.8-beta.4 → 1.7.8-beta.7

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.
@@ -77,7 +77,7 @@ class TralisAPI {
77
77
  }
78
78
 
79
79
  const { apiKey } = opt;
80
- let { url, projection, bbox, buffer = [100, 200] } = opt;
80
+ let { url, projection, bbox, buffer = [100, 100] } = opt;
81
81
  const conn = new WebSocketConnector();
82
82
 
83
83
  if (apiKey) {
@@ -183,7 +183,7 @@ class WebSocketConnector {
183
183
  source += params.args ? ` ${params.args}` : '';
184
184
 
185
185
  // Buffer channel message return a list of other channels to propagate to proper callbacks.
186
- const contents = Array.isArray(data.content) ? data.content : [data];
186
+ const contents = data.source === 'buffer' ? data.content : [data];
187
187
  contents.forEach((content) => {
188
188
  // Because of backend optimization, the last content is null.
189
189
  if (
@@ -440,7 +440,9 @@ const TrackerLayerMixin = (Base) =>
440
440
  this.stop();
441
441
  unByKey(this.visibilityRef);
442
442
  if (this.tracker) {
443
- this.clear();
443
+ const { canvas } = this.tracker;
444
+ const context = canvas.getContext('2d');
445
+ context.clearRect(0, 0, canvas.width, canvas.height);
444
446
  this.tracker = null;
445
447
  }
446
448
  super.terminate();