@openglobus/og 0.13.10 → 0.13.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openglobus/og",
3
- "version": "0.13.10",
3
+ "version": "0.13.12",
4
4
  "description": "[OpenGlobus](https://www.openglobus.org/) is a javascript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers and 3d objects. It uses the WebGL technology, open source and completely free.",
5
5
  "directories": {
6
6
  "example": "./sandbox"
@@ -85,8 +85,7 @@ class LabelHandler extends BillboardHandler {
85
85
  }
86
86
 
87
87
  _addLabelToArrays(label) {
88
- this._renderer.labelWorker.make(label);
89
- console.time(`label${label.id}`)
88
+ this._renderer.labelWorker.make({ handler: this, label: label });
90
89
  }
91
90
 
92
91
  assignFontAtlas(label) {
@@ -122,8 +121,6 @@ class LabelHandler extends BillboardHandler {
122
121
  label.update();
123
122
 
124
123
  this.refresh();
125
- console.timeEnd(`label${label.id}`)
126
- console.log(label)
127
124
  }
128
125
  }
129
126
 
@@ -14,33 +14,30 @@ class LabelWorker extends BaseWorker {
14
14
  }
15
15
 
16
16
  _onMessage(e) {
17
+ let s = this._source.get(e.data.id);
17
18
 
18
- let label = this._source.get(e.data.id);
19
-
20
- if (label._lockId === LOCK_UPDATE) {
19
+ if (s.label._lockId === LOCK_UPDATE) {
21
20
  requestAnimationFrame(() => {
22
- this.make(label);
21
+ this.make({ handler: s.handler, label: s.label });
23
22
  });
24
23
  } else {
25
- label._handler.workerCallback(e.data, label);
24
+ s.handler.workerCallback(e.data, s.label);
26
25
  }
27
26
 
28
27
  this._source.delete(e.data.id);
29
- super._onMessage(e)
30
-
31
- this.check();
32
28
  }
33
29
 
34
30
 
35
- make() {
36
- const label = arguments[0],
37
- handler = label._handler;
31
+ make(data) {
32
+ let label = data.label,
33
+ handler = data.handler;
34
+
38
35
  if (handler._entityCollection) {
39
36
 
40
37
  if (this._workerQueue.length) {
41
38
  var w = this._workerQueue.pop();
42
39
 
43
- this._source.set(this._id, label);
40
+ this._source.set(this._id, data);
44
41
 
45
42
  let labelData = new Float32Array([
46
43
  /*0*/this._id++,
@@ -67,7 +64,7 @@ class LabelWorker extends BaseWorker {
67
64
  labelData.buffer,
68
65
  ]);
69
66
  } else {
70
- this._pendingQueue.push(label);
67
+ this._pendingQueue.push(data);
71
68
  }
72
69
  }
73
70
  }
@@ -4,6 +4,6 @@ export class LabelWorker extends BaseWorker {
4
4
  constructor(numWorkers?: number);
5
5
  _source: Map<any, any>;
6
6
  _onMessage(e: any): void;
7
- make(...args: any[]): void;
7
+ make(data: any): void;
8
8
  }
9
9
  import { BaseWorker } from "../utils/BaseWorker.js";