@pirireis/webglobeplugins 0.8.1 → 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
package/point-tracks/plugin.js
CHANGED
|
@@ -60,7 +60,7 @@ class PointTracksPlugin {
|
|
|
60
60
|
[
|
|
61
61
|
["pos3D", {
|
|
62
62
|
bufferManager: new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
63
|
-
adaptor: (item) => new Float32Array(wgs84ToCartesian3d(item.long, item.lat, item.height))
|
|
63
|
+
adaptor: (item) => new Float32Array(wgs84ToCartesian3d(item.long, item.lat, item.height / 1000)) // height is in meters
|
|
64
64
|
}],
|
|
65
65
|
["pos2D", {
|
|
66
66
|
bufferManager: new BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
@@ -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
|
}
|