@pirireis/webglobeplugins 0.6.43-a → 0.6.44-a
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 +1 -1
- package/rangerings/plugin.js +2 -10
- package/rangerings/ring-account.js +10 -4
package/package.json
CHANGED
package/rangerings/plugin.js
CHANGED
|
@@ -247,12 +247,6 @@ class RangeRings {
|
|
|
247
247
|
* @method removeCenters @param { Array < { centerID } >} centerIDs
|
|
248
248
|
*/
|
|
249
249
|
removeCenters(centerIDs) {
|
|
250
|
-
// Algorithm
|
|
251
|
-
/**
|
|
252
|
-
* 1. ask centerRingAccount for existing rings
|
|
253
|
-
* 2. delete from buffer orchestators
|
|
254
|
-
* 3. delete from centerRingAccount
|
|
255
|
-
*/
|
|
256
250
|
const { globe,
|
|
257
251
|
bufferOrchestrator, bufferManagersCompMap,
|
|
258
252
|
paddingBufferOrchestrator, bufferManagersCompMapPadding,
|
|
@@ -262,9 +256,9 @@ class RangeRings {
|
|
|
262
256
|
if (existingKeys.length) {
|
|
263
257
|
bufferOrchestrator.deleteBulk(existingKeys, bufferManagersCompMap);
|
|
264
258
|
this._textWritersMap.forEach((textWriter) => textWriter.deleteTextBulk(existingKeys));
|
|
259
|
+
|
|
265
260
|
}
|
|
266
261
|
}
|
|
267
|
-
|
|
268
262
|
for (const centerID of centerIDs) {
|
|
269
263
|
const paddingKeys = _ringAccount.ringBigPaddingKeys(centerID);
|
|
270
264
|
if (paddingKeys.length) {
|
|
@@ -272,9 +266,7 @@ class RangeRings {
|
|
|
272
266
|
}
|
|
273
267
|
}
|
|
274
268
|
this.textPlugin?.removeCenters(centerIDs);
|
|
275
|
-
|
|
276
|
-
// this.__contextTextWriterUpdate(centerIDs, null);
|
|
277
|
-
|
|
269
|
+
this._ringAccount.removeCenters(centerIDs);
|
|
278
270
|
globe.DrawRender();
|
|
279
271
|
}
|
|
280
272
|
|
|
@@ -13,7 +13,7 @@ const ringBigPaddingKeyMethod = (centerID, ringID, angle) => `${centerID}_${ring
|
|
|
13
13
|
*/
|
|
14
14
|
class RingAccount {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.
|
|
16
|
+
this._centralMap = new Map(); // key, new MAP(x,y, rings:[])
|
|
17
17
|
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ class RingAccount {
|
|
|
25
25
|
centralItem.rings.forEach((ring) => {
|
|
26
26
|
ring.__identity__ = ringKeyMethod(centralItem.centerID, ring.ringID);
|
|
27
27
|
});
|
|
28
|
-
this.
|
|
28
|
+
this._centralMap.set(centralItem.centerID, {
|
|
29
29
|
...centralItem,
|
|
30
30
|
rgba: new Float32Array(centralItem.rgba),
|
|
31
31
|
|
|
@@ -34,7 +34,7 @@ class RingAccount {
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
getCenter(centerID) {
|
|
37
|
-
return this.
|
|
37
|
+
return this._centralMap.get(centerID);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
updateCentersCoordinate(items) {
|
|
@@ -101,6 +101,12 @@ class RingAccount {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
|
|
104
|
+
removeCenters(centerIDs) {
|
|
105
|
+
const centralMap = this._centralMap;
|
|
106
|
+
centerIDs.forEach((centerID) => {
|
|
107
|
+
centralMap.delete(centerID);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
104
110
|
|
|
105
111
|
textUpdate(centerID, textWriterObjs, dataPreAdaptor = null) {
|
|
106
112
|
const center = this.getCenter(centerID);
|
|
@@ -113,7 +119,7 @@ class RingAccount {
|
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
updateAllText(textWriterObjs, dataPreAdaptor = null) {
|
|
116
|
-
this.
|
|
122
|
+
this._centralMap.forEach((center) => {
|
|
117
123
|
this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
|
|
118
124
|
});
|
|
119
125
|
}
|