@pirireis/webglobeplugins 0.8.2 → 0.8.3

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": "@pirireis/webglobeplugins",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -161,13 +161,20 @@ class PointTracksPlugin {
161
161
  throw new Error("Too many points, Point count cannot exceed 2147483647");
162
162
  }
163
163
  const { _bufferManagersMap, _bufferOrchestrator } = this;
164
- console.log("point tracks plugin insert bulk", flattenedPoints);
165
164
  _bufferOrchestrator.insertBulk(flattenedPoints, _bufferManagersMap);
166
165
  this.globe?.DrawRender();
167
166
 
168
167
  }
169
168
 
170
169
 
170
+ flush() {
171
+ const capacity = 100
172
+ this._bufferOrchestrator?.flush({ capacity });
173
+ this._bufferManagersMap.forEach(({ bufferManager }) => bufferManager.resetWithCapacity(capacity));
174
+ this._tracksToPointsMap.clear();
175
+ this.globe?.DrawRender();
176
+ }
177
+
171
178
  /**
172
179
  * @param {string} trackID
173
180
  */
@@ -237,7 +244,6 @@ class PointTracksPlugin {
237
244
  const w = this.globe.api_ScrW();
238
245
  const h = this.globe.api_ScrH();
239
246
  if (w === this._lastWH.w && h === this._lastWH.h) return;
240
- console.log("point tracks plugin resize", w, h);
241
247
 
242
248
  this._lastWH.w = w;
243
249
  this._lastWH.h = h;
@@ -166,8 +166,9 @@ export class BufferOrchestrator {
166
166
  * Flushes metadata and sets length to 0 without actualize change on buffers
167
167
  * This method created for cases in which data is loaded on each frame
168
168
  */
169
- flush() {
169
+ flush({ capacity = 10 } = {}) {
170
170
  this._length = 0;
171
+ this._capacity = capacity;
171
172
  this.tombstoneOffSet = []
172
173
  this.offsetMap.clear();
173
174
  }