@pirireis/webglobeplugins 0.1.10 → 0.3.0

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.
@@ -0,0 +1,12 @@
1
+ export function bearingRealAngle(long, lat, endLong, endLat) {
2
+ const rLong = Radians * long;
3
+ const rLat = Radians * lat;
4
+ const rEndLong = Radians * endLong;
5
+ const rEndLat = Radians * endLat;
6
+ const delta_long = rEndLong - rLong;
7
+ const x = Math.sin(delta_long) * Math.cos(rEndLat);
8
+ const y = Math.cos(rLat) * Math.sin(rEndLat) - Math.sin(rLat) * Math.cos(rEndLat) * Math.cos(delta_long);
9
+ let initialBearing = Math.atan2(x, y) / Radians;
10
+ initialBearing = (initialBearing + 360) % 360;
11
+ return initialBearing;
12
+ }
package/Math/index.js ADDED
File without changes
@@ -0,0 +1,2 @@
1
+ import BearingLinePlugin from "./plugin"
2
+ export { BearingLinePlugin };
@@ -0,0 +1,319 @@
1
+ import { programCache as ringProgramCache } from '../partialrings/program';
2
+ import { LineOnGlobeCache } from '../programs/line-on-globe/naive';
3
+ import { CircleCache } from '../programs/line-on-globe/circle';
4
+ import { BufferOrchestrator, BufferManager } from '../util/account';
5
+ import { AngledLineProgramCache } from '../programs/line-on-globe/angled-line';
6
+ import { ContextTextWriter } from '../write-text/context-text'
7
+ export const RINGPARTIAL_DRAW_MODE = Object.freeze({
8
+ LINE_STRIP: "LINE_STRIP",
9
+ TRIANGLE_FAN: "TRIANGLE_FAN",
10
+ });
11
+
12
+
13
+ /**
14
+ * @typedef {Object}textContextInjection
15
+ * @property {string} id
16
+ * @property {function} coordsAdaptor
17
+ * @property {function} textAdaptor
18
+ * @property {ContextTextWriter} writer
19
+ *
20
+ */
21
+
22
+ export default class Plugin {
23
+
24
+
25
+ constructor(id, { opacity = 1, textContextInjectionMap = new Map() } = {}) {
26
+ this.id = id;
27
+ this._opacity = opacity;
28
+ this.bufferOrchestrator = new BufferOrchestrator({ capacity: 10 });
29
+ this._textContextInjectionMap = textContextInjectionMap;
30
+ }
31
+
32
+
33
+ settextContextInjectionMap(textContextInjectionMap, data = null) {
34
+ this._textContextInjectionMap = textContextInjectionMap;
35
+ this._textContextInjectionMap.forEach(({ writer }) => writer.clear());
36
+ if (data) {
37
+ for (const item of data) {
38
+ this._insertTexts(item);
39
+ }
40
+ }
41
+
42
+ }
43
+
44
+ setOpacity(opacity) {
45
+ this._opacity = opacity;
46
+ this.globe.DrawRender();
47
+ }
48
+
49
+ init(globe, gl) {
50
+ this.gl = gl;
51
+ this.globe = globe;
52
+ this.lineProgram = LineOnGlobeCache.get(globe);
53
+ this.ringProgram = ringProgramCache.get(globe);
54
+ this.angledLineProgram = AngledLineProgramCache.get(globe);
55
+ this.circleProgram = CircleCache.get(globe);
56
+ // this.angleTextContext = new ContextTextWriter(globe);
57
+ // this.distanceTextContext = new ContextTextWriter(globe);
58
+ {
59
+ // createBuffers
60
+ const bufferType = "DYNAMIC_DRAW";
61
+ const initialCapacity = this.bufferOrchestrator.capacity;
62
+ this.bufferManagersCompMap = new Map(
63
+ [
64
+ ["centerCoords", {
65
+ 'bufferManager': new BufferManager(gl, 2, { bufferType, initialCapacity }),
66
+ 'adaptor': (item) => new Float32Array([item.long, item.lat]),
67
+ }],
68
+ ["targetCoords", {
69
+ 'bufferManager': new BufferManager(gl, 2, { bufferType, initialCapacity }),
70
+ 'adaptor': (item) => new Float32Array([item.endLong, item.endLat])
71
+ }],
72
+ ["startAngle", {
73
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
74
+ 'adaptor': (item) => new Float32Array([item.startAngle])
75
+ }],
76
+ ["tailAngle", {
77
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
78
+ 'adaptor': (item) => new Float32Array([item.tailAngle])
79
+ }],
80
+ ["rgba", {
81
+ 'bufferManager': new BufferManager(gl, 4, { bufferType, initialCapacity }),
82
+ 'adaptor': (item) => new Float32Array(item.rgba)
83
+ }],
84
+ ["radius", {
85
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
86
+ 'adaptor': (item) => new Float32Array([item.radius])
87
+ }],
88
+ ["rgbaMode", {
89
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
90
+ 'adaptor': (item) => new Float32Array([item.rgbaMode])
91
+ }],
92
+ ["dashRatio", {
93
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
94
+ 'adaptor': (item) => new Float32Array([item.dashRatio])
95
+ }],
96
+ ["bearingAngle", {
97
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
98
+ 'adaptor': (item) => new Float32Array([item.bearingAngle])
99
+ }],
100
+ ["bigRadius", {
101
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
102
+ 'adaptor': (item) => new Float32Array([item.bigRadius])
103
+ }],
104
+ ["dashOpacity", {
105
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
106
+ 'adaptor': (item) => new Float32Array([item.dashOpacity])
107
+ }],
108
+ ["circleDashRatio", {
109
+ 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
110
+ 'adaptor': (item) => new Float32Array([item.circleDashRatio])
111
+ }]
112
+ ]
113
+ );
114
+ }
115
+
116
+
117
+ const obj = function (bufferManagerComp) {
118
+ return { 'buffer': bufferManagerComp.bufferManager.buffer, 'stride': 0, 'offset': 0 }
119
+ };
120
+
121
+ this.lineVao = this.lineProgram.createVAO(
122
+ ...['centerCoords', 'targetCoords', 'dashRatio', 'rgba'].map(key => obj(this.bufferManagersCompMap.get(key))));
123
+ this.ringVao = this.ringProgram.createVAO(
124
+ ...['centerCoords', 'startAngle', 'tailAngle', 'rgba', 'radius', 'rgbaMode'].map(key => obj(this.bufferManagersCompMap.get(key))));
125
+ {
126
+ const angledLineBuffers = ["centerCoords", "bearingAngle", "bigRadius", "rgba", "dashRatio"].map(key => obj(this.bufferManagersCompMap.get(key)));
127
+ // dashOpacity is same as rgba.a to eleminate effect of dashOpacity.
128
+ const colorBuffer = this.bufferManagersCompMap.get("rgba");
129
+ angledLineBuffers.push(
130
+ { 'buffer': colorBuffer.bufferManager.buffer, 'stride': 16, 'offset': 12 },
131
+ )
132
+ this.angledLineVao = this.angledLineProgram.createVAO(...angledLineBuffers);
133
+ }
134
+ // centerObj, startAngleObj, radiusObj, colorObj, dashRatioObj, dashOpacityObj
135
+ this.circleVao = this.circleProgram.createVAO(
136
+ ...["centerCoords", "startAngle", "bigRadius", "rgba", "circleDashRatio", "dashOpacity"].map(key => obj(this.bufferManagersCompMap.get(key))));
137
+ }
138
+
139
+
140
+
141
+ draw3D() {
142
+ const { gl } = this;
143
+ this.lineProgram.draw(this.lineVao, this.bufferOrchestrator.length, this._opacity);
144
+ gl.disable(gl.DEPTH_TEST);
145
+ this.ringProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity * 0.8, RINGPARTIAL_DRAW_MODE.TRIANGLE_FAN);
146
+ this.ringProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity, RINGPARTIAL_DRAW_MODE.LINE_STRIP);
147
+ this.angledLineProgram.draw(this.angledLineVao, this.bufferOrchestrator.length, this._opacity * 0.8);
148
+ this.circleProgram.draw(this.circleVao, this.bufferOrchestrator.length, this._opacity);
149
+ this._textContextInjectionMap.forEach((e) => { e.writer.draw(); });
150
+ gl.enable(gl.DEPTH_TEST);
151
+ }
152
+
153
+
154
+ /**
155
+ *
156
+ * @param {Array<{key, long, lat, endLong, endLat, bearingAngle, radius, rgba:[4numbers]}>} items
157
+ */
158
+
159
+ insertBulk(items) {
160
+ const { globe, bufferOrchestrator, bufferManagersCompMap } = this;// angleTextContext, distanceTextContext,
161
+ const data = []
162
+ for (let item of items) {
163
+ this._insertTexts(item);
164
+ data.push(this.__insertAdaptor(item));
165
+
166
+
167
+ }
168
+ bufferOrchestrator.insertBulk(data, bufferManagersCompMap);
169
+ globe.DrawRender();
170
+ }
171
+
172
+
173
+
174
+
175
+ deleteBulk(keys) {
176
+ this.bufferOrchestrator.deleteBulk(keys, this.bufferManagersCompMap, ["radius", "centerCoords", "targetCoords", "rgba"]);
177
+
178
+ this._deleteTexts(keys);
179
+ this.globe.DrawRender();
180
+ }
181
+
182
+
183
+ defrag() {
184
+ this.bufferOrchestrator.defrag(this.bufferManagersCompMap);
185
+ // this.globe.DrawRender();
186
+ }
187
+
188
+ /**
189
+ *
190
+ * @param {Array<{key, long, lat, endLong, endLat, bearing}>} items // TODO
191
+ */
192
+ updateCoordinatesBulk(items) { //TODO
193
+ const { globe, bufferOrchestrator, bufferManagersCompMap, angleTextContext, distanceTextContext } = this;
194
+ const data = []
195
+ for (let item of items) {
196
+ this._insertTexts(item);
197
+ data.push(this.__updateCoordsAdaptor(item));
198
+ }
199
+
200
+ bufferOrchestrator.updateBulk(data, bufferManagersCompMap, ["centerCoords", "targetCoords", "startAngle", "tailAngle", "bearingAngle", "bigRadius", "radius"]);
201
+ globe.DrawRender();
202
+ }
203
+
204
+
205
+ __insertAdaptor(item) {
206
+ const lat = radian(item.lat)
207
+ const long = radian(item.long)
208
+ const endLat = radian(item.endLat)
209
+ const endLong = radian(item.endLong)
210
+ const rgba = item.rgba !== undefined ? item.rgba : [0, 0, 0, 0];
211
+ const rgbaMode = item.rgbaMode !== undefined ? item.rgbaMode : 0;
212
+ const dashRatio = item.dashRatio !== undefined ? item.dashRatio : 1.0;
213
+ const dashOpacity = item.dashOpacity !== undefined ? item.dashOpacity : 0.9;
214
+ const circleDashRatio = item.circleDashAngle !== undefined ? (item.circleDashAngle / 360) : 1.0;
215
+ console.log("cicleDashRati", circleDashRatio);
216
+ const bigRadius = item.bigRadius !== undefined ? item.bigRadius : this.globe.Math.GetDist3D(item.long, item.lat, item.endLong, item.endLat);
217
+ const radius = item.radius !== undefined ? item.radius : bigRadius * 0.2;
218
+ const startAngle = calculateStartAngle(long, lat, endLong, endLat);
219
+ const bearingAngle = radian(item.bearingAngle - 90);
220
+ let tailAngle = bearingAngle - startAngle;
221
+ if (tailAngle > 0) {
222
+ tailAngle -= Math.PI * 2;
223
+ }
224
+ return {
225
+ key: item.key,
226
+ lat,
227
+ long,
228
+ endLat,
229
+ endLong,
230
+ bearingAngle,
231
+ radius,
232
+ bigRadius,
233
+ startAngle,
234
+ tailAngle,
235
+ rgba,
236
+ dashRatio,
237
+ dashOpacity,
238
+ circleDashRatio,
239
+ rgbaMode
240
+ };
241
+ }
242
+
243
+ __updateCoordsAdaptor(item) {
244
+ const lat = radian(item.lat)
245
+ const long = radian(item.long)
246
+ const endLat = radian(item.endLat)
247
+ const endLong = radian(item.endLong)
248
+
249
+ const bigRadius = item.bigRadius !== undefined ? item.bigRadius : this.globe.Math.GetDist3D(item.long, item.lat, item.endLong, item.endLat);
250
+ const radius = item.radius !== undefined ? item.radius : bigRadius * 0.2;
251
+ const startAngle = calculateStartAngle(long, lat, endLong, endLat);
252
+ const bearingAngle = radian(item.bearingAngle - 90);
253
+ let tailAngle = bearingAngle - startAngle;
254
+ if (tailAngle > 0) {
255
+ tailAngle -= Math.PI * 2;
256
+ }
257
+ return {
258
+ key: item.key,
259
+ lat,
260
+ long,
261
+ endLat,
262
+ endLong,
263
+ bearingAngle,
264
+ radius,
265
+ bigRadius,
266
+ startAngle,
267
+ tailAngle,
268
+ };
269
+ }
270
+
271
+
272
+ //TODO free
273
+ free() {
274
+ if (this.isFreed) return;
275
+ this.bufferManagersCompMap.forEach(({ bufferManager, adaptor }) => {
276
+ bufferManager.free();
277
+ });
278
+ LineOnGlobeCache.release(this.globe);
279
+ ringProgramCache.release(this.globe);
280
+ CircleCache.release(this.globe);
281
+ AngledLineProgramCache.release(this.globe);
282
+ this.isFreed = true;
283
+ }
284
+
285
+
286
+
287
+ _insertTexts(item) {
288
+ this._textContextInjectionMap.forEach((v) => {
289
+ const { coordsAdaptor, textAdaptor, writer } = v
290
+ const { lat, long } = coordsAdaptor(item);
291
+ const text = textAdaptor(item);
292
+ writer.insertText(item.key, lat, long, text);
293
+ });
294
+ }
295
+
296
+ _deleteTexts(keys) {
297
+ this._textContextInjectionMap.forEach((e) => {
298
+ e.writer.deleteTextBulk(keys);
299
+ });
300
+ }
301
+
302
+ }
303
+
304
+
305
+
306
+ const radian = (degree) => degree * Math.PI / 180;
307
+
308
+ const integralSec = (angle) => {
309
+ return Math.log(Math.tan(angle / 2 + Math.PI / 4));
310
+ }
311
+
312
+ const calculateStartAngle = (long, lat, endLong, endLat) => {
313
+ const dLat = (integralSec(endLat) - integralSec(lat)); // Because lines are strectes toward poles.
314
+ const dLong = endLong - long;
315
+
316
+ let angle = -Math.atan2(dLat, dLong);
317
+ return angle;
318
+ }
319
+
@@ -0,0 +1,15 @@
1
+ # Two problems:
2
+ lines are curved to to arrive perpendicular to the longitude lines
3
+ patrial rings are not fit to the lines nor the bearing angle
4
+
5
+
6
+
7
+ # AngledLine
8
+
9
+ Does not render
10
+ Check:
11
+ [-] VAO
12
+ [-] Attributes are loaded with data
13
+ Assign constants to attributes.
14
+ [x] Uniforms are loaded // program was not used before setting opacity
15
+ [x] Check geometry // Assigning a constant to the geometry made all edges of the line overlap and the line was not visible
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.1.10",
3
+ "version": "0.3.0",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -0,0 +1,89 @@
1
+ import BufferOffsetManager from "../util/account/bufferoffsetmanager";
2
+
3
+
4
+
5
+ const ITEM_SIZE = 10;
6
+ export default class BufferManager extends BufferOffsetManager {
7
+ constructor(globe, gl, buffer, { initialCapacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
8
+ super(ITEM_SIZE, { capacity: initialCapacity });
9
+ this.globe = globe;
10
+ this.gl = gl;
11
+ this.buffer = buffer;
12
+ this.bufferType = bufferType;
13
+
14
+
15
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
16
+ gl.bufferData(gl.ARRAY_BUFFER, initialCapacity * ITEM_SIZE * 4, gl[bufferType]);
17
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
23
+ * @returns
24
+ */
25
+ insertBulk(items) {
26
+ if (items.length === 0) return;
27
+ this.autoExtendBuffer(items.length);
28
+ const { gl, buffer } = this;
29
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
30
+ for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
31
+ const offset = this.getOffset(key) | this.nextOffset();
32
+ this.setOffset(key, offset);
33
+ const block = new Float32Array([
34
+ long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode]);
35
+ gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
36
+ // 2 1 1 1 4 1 = 10
37
+ }
38
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
39
+ this.globe.DrawRender();
40
+ }
41
+
42
+
43
+ /**
44
+ * @param {Array<{key, long, lat, startAngle, tailAngle}>} items
45
+ *
46
+ * */
47
+ updateCenterAndAngleBulk(items) {
48
+ const { gl, buffer } = this;
49
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
50
+ for (let { key, long, lat, startAngle, tailAngle } of items) {
51
+ const offset = this.getOffset(key);
52
+ if (offset === null) {
53
+ console.warn(`key ${key} not found`);
54
+ continue;
55
+ }
56
+ const block = new Float32Array([long, lat, startAngle, tailAngle]);
57
+ gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
58
+ }
59
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
60
+ this.globe.DrawRender();
61
+ }
62
+ /**
63
+ *
64
+ * @param {Array<{key:string, payload:Float32Array}} items
65
+ * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
66
+ * @returns
67
+ */
68
+ updatePartial(items, part) {
69
+ const { gl, buffer } = this;
70
+ this._updatePartial(items, part, gl, buffer);
71
+ this.globe.DrawRender();
72
+
73
+ }
74
+
75
+
76
+
77
+ deleteBulk(keys) {
78
+ this._deleteBulk(keys);
79
+ this.globe.DrawRender();
80
+ }
81
+
82
+
83
+
84
+
85
+ free() {
86
+ this.gl.deleteBuffer(this.buffer);
87
+ this.buffer = null;
88
+ }
89
+ }
@@ -1,3 +1,3 @@
1
1
  import PartialRing, { RINGPARTIAL_ALPHA_MODE, RINGPARTIAL_DRAW_MODE, PART_OFFSET_LOOPUP } from './plugin';
2
2
 
3
- export { PartialRing, RINGPARTIAL_ALPHA_MODE, RINGPARTIAL_DRAW_MODE, PART_OFFSET_LOOPUP };
3
+ export { PartialRing, RINGPARTIAL_ALPHA_MODE, RINGPARTIAL_DRAW_MODE, PART_OFFSET_LOOPUP };
@@ -20,12 +20,13 @@ export const RINGPARTIAL_ALPHA_MODE = Object.freeze({
20
20
 
21
21
 
22
22
  export const PART_OFFSET_LOOPUP = Object.freeze({
23
- CENTER: 0,
23
+ LONG: 0,
24
+ LAT: 1,
24
25
  START_ANGLE: 2,
25
26
  TAIL_ANGLE: 3,
26
- COLOR: 4,
27
+ RGBA: 4,
27
28
  RADIUS: 8,
28
- COLOR_MODE: 9,
29
+ RGBA_MODE: 9,
29
30
  });
30
31
 
31
32
 
@@ -47,8 +48,6 @@ export default class {
47
48
  const { vao, buffer } = this.program.getVaoBuffer();
48
49
  this.vao = vao;
49
50
  this.buffer = buffer;
50
-
51
-
52
51
  }
53
52
 
54
53
 
@@ -57,7 +56,7 @@ export default class {
57
56
 
58
57
  if (LOD < this.startLod || LOD > this.endLod) return;
59
58
  this.program.draw(
60
- this.bufferManager,
59
+ this.bufferManager.length,
61
60
  this.vao,
62
61
  this.edgeCount,
63
62
  this.alphaMultiplier,
@@ -82,8 +81,8 @@ export default class {
82
81
  if (endLod !== null) this.endLod = endLod;
83
82
  }
84
83
 
85
- createBufferMAnager(initialCapacity = 10, extendRatio = 1.2, bufferType = 'DYNAMIC_DRAW') {
86
- if (!this.bufferManager) { this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, bufferType, { initialCapacity, extendRatio }); }
84
+ createBufferMAnager(initialCapacity = 10, bufferType = 'DYNAMIC_DRAW') {
85
+ if (!this.bufferManager) { this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, { initialCapacity, bufferType, }); }
87
86
  return this.bufferManager;
88
87
  }
89
88
 
@@ -96,13 +95,12 @@ export default class {
96
95
 
97
96
  class BufferManager extends BufferOffsetManager {
98
97
 
99
- constructor(globe, gl, buffer, bufferType, { initialCapacity = 10, extendRatio = 1.2 } = {}) {
100
- super(10, { capacity: initialCapacity });
98
+ constructor(globe, gl, buffer, { initialCapacity = 10, bufferType, } = {}) {
99
+ super(10, { capacity: initialCapacity, bufferType, });
101
100
  this.globe = globe;
102
101
  this.gl = gl;
103
102
  this.buffer = buffer;
104
103
  this.bufferType = bufferType;
105
- this.extendRatio = extendRatio;
106
104
 
107
105
 
108
106
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
@@ -112,22 +110,20 @@ class BufferManager extends BufferOffsetManager {
112
110
 
113
111
  /**
114
112
  *
115
- * @param { Array<{key, center[2], startAngle, tailAngle, radius, color[4], color_mode }>} rings
113
+ * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
116
114
  * @returns
117
115
  */
118
- insertRings(rings) {
119
- if (rings.length === 0) return;
120
- this.autoExtendBuffer(rings.length);
116
+ insertBulk(items) {
117
+ if (items.length === 0) return;
118
+ console.log(items)
119
+ this.autoExtendBuffer(items.length);
121
120
  const { gl, buffer } = this;
122
121
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
123
- for (let { key, center, startAngle, tailAngle, color, radius, colorMode } of rings) {
124
- let offset = this.getOffset(key);
125
- if (offset === undefined) {
126
- offset = this.nextOffset();
127
- this.setOffset(key, offset);
128
- }
122
+ for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
123
+ const offset = this.getOffset(key) | this.nextOffset();
124
+ this.setOffset(key, offset);
129
125
  const block = new Float32Array([
130
- ...center, startAngle, tailAngle, ...color, radius, colorMode]);
126
+ long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode]);
131
127
  gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
132
128
  // 2 1 1 1 4 1 = 10
133
129
  }
@@ -138,13 +134,13 @@ class BufferManager extends BufferOffsetManager {
138
134
 
139
135
  /**
140
136
  *
141
- * @param {Array<{key:string, payload:Float32Array}} rings
142
- * @param {PART_OFFSET_LOOPUP} part | CENTER, START_ANGLE, ROTATION_ANGLE, RADIUS, COLOR, COLOR_MODE
137
+ * @param {Array<{key:string, payload:Float32Array}} items
138
+ * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
143
139
  * @returns
144
140
  */
145
- updatePartial(rings, part) {
141
+ updatePartial(items, part) {
146
142
  const { gl, buffer } = this;
147
- this._updatePartial(rings, part, gl, buffer);
143
+ this._updatePartial(items, part, gl, buffer);
148
144
  this.globe.DrawRender();
149
145
 
150
146
  }
@@ -157,8 +153,6 @@ class BufferManager extends BufferOffsetManager {
157
153
  }
158
154
 
159
155
 
160
-
161
-
162
156
  free() {
163
157
  this.gl.deleteBuffer(this.buffer);
164
158
  this.buffer = null;