@pirireis/webglobeplugins 0.15.8-alpha → 0.15.9-alpha
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
|
@@ -9,10 +9,10 @@ export const circleDataAdaptor = (globe, chain) => {
|
|
|
9
9
|
const { chainKey, chainProperties, nodes } = chain;
|
|
10
10
|
for (let i = 0; i < nodes.length - 1; i++) {
|
|
11
11
|
const node = nodes[i];
|
|
12
|
-
const circleOn = nodes[i + 1]?.circleOn ?? true; // Default to true if not specified
|
|
12
|
+
// const circleOn = nodes[i + 1]?.circleOn ?? true; // Default to true if not specified
|
|
13
|
+
const { key, long, lat, circleProperties, circleOn = true } = node;
|
|
13
14
|
if (!circleOn)
|
|
14
15
|
continue; // Skip if circle is not enabled for this node
|
|
15
|
-
const { key, long, lat, circleProperties } = node;
|
|
16
16
|
const color = circleProperties?.rgba ?? chainProperties.rgba ?? [1, 1, 1, 1]; // Default color if not specifie
|
|
17
17
|
const radius = globe.Math.GetDist2D(long, lat, nodes[i + 1].long, nodes[i + 1].lat);
|
|
18
18
|
const nodeKey = keyMethod(chainKey, key);
|
|
@@ -31,11 +31,9 @@ export function arcDataAdaptor(chain) {
|
|
|
31
31
|
const { chainKey, chainProperties, nodes } = chain;
|
|
32
32
|
for (let i = 0; i < nodes.length - 1; i++) {
|
|
33
33
|
const node = nodes[i];
|
|
34
|
-
const arcOn = nodes[i + 1]?.arcOn ?? true; // Default to true if not specified
|
|
35
|
-
if (!arcOn)
|
|
36
|
-
continue; // Skip if arc is not enabled for this node
|
|
34
|
+
// const arcOn = nodes[i + 1]?.arcOn ?? true; // Default to true if not specified
|
|
37
35
|
const nextNode = nodes[i + 1];
|
|
38
|
-
const { key, long, lat, lineProperties } = node;
|
|
36
|
+
const { key, long, lat, lineProperties, arcOn = true } = node;
|
|
39
37
|
if (!arcOn)
|
|
40
38
|
continue; // Skip if arc is not enabled for this node
|
|
41
39
|
const nodeKey = keyMethod(chainKey, key);
|
|
@@ -57,10 +55,10 @@ export function lineDataAdaptor(chain) {
|
|
|
57
55
|
for (let i = 0; i < nodes.length - 1; i++) {
|
|
58
56
|
const node = nodes[i];
|
|
59
57
|
const nextNode = nodes[i + 1];
|
|
60
|
-
const lineOn = nextNode?.lineOn ?? true; // Default to true if not specified
|
|
58
|
+
// const lineOn = nextNode?.lineOn ?? true; // Default to true if not specified
|
|
59
|
+
const { key, long, lat, lineProperties, lineOn = true } = node;
|
|
61
60
|
if (!lineOn)
|
|
62
61
|
continue; // Skip if line is not enabled for this node
|
|
63
|
-
const { key, long, lat, lineProperties } = node;
|
|
64
62
|
const nodeKey = keyMethod(chainKey, key);
|
|
65
63
|
const { long: nextLong, lat: nextLat } = nextNode;
|
|
66
64
|
const color = lineProperties?.rgba ?? chainProperties.rgba ?? [1, 1, 1, 1]; // Default color if not specified
|
|
@@ -114,13 +114,13 @@ export class ChainListMap {
|
|
|
114
114
|
chain[index] = node;
|
|
115
115
|
}
|
|
116
116
|
updateNodesProperties(chainKey, nodes) {
|
|
117
|
+
const chain = this._chainMap.get(chainKey);
|
|
118
|
+
if (!chain)
|
|
119
|
+
return;
|
|
117
120
|
nodes.forEach((node) => {
|
|
118
121
|
const index = this.getIndexOfNode(chainKey, node.key);
|
|
119
122
|
if (index === undefined)
|
|
120
123
|
return;
|
|
121
|
-
const chain = this._chainMap.get(chainKey);
|
|
122
|
-
if (!chain)
|
|
123
|
-
return;
|
|
124
124
|
const chainNode = chain[index];
|
|
125
125
|
if (node.circleProperties) {
|
|
126
126
|
if (typeof chainNode.circleProperties !== 'object')
|
|
@@ -197,18 +197,18 @@ export class CircleLineChainPlugin {
|
|
|
197
197
|
this._updateTexts(chainKeysToReconstruct, Array.from(this._textWritersMap.keys()));
|
|
198
198
|
this.globe?.DrawRender();
|
|
199
199
|
}
|
|
200
|
-
updateNodesProperties(chainKey,
|
|
200
|
+
updateNodesProperties(chainKey, nodesAndPropertyList, { textWriterIDs = [] } = {}) {
|
|
201
201
|
if (this._freed) {
|
|
202
202
|
console.warn("CircleLineChainPlugin is freed, cannot update nodes properties.");
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
|
-
this._chainListMap.updateNodesProperties(chainKey,
|
|
205
|
+
this._chainListMap.updateNodesProperties(chainKey, nodesAndPropertyList);
|
|
206
206
|
this._cleanChainsFromSemiPlugins([chainKey]);
|
|
207
207
|
this._reconstructChains([chainKey]);
|
|
208
208
|
this._updateTexts([chainKey], textWriterIDs);
|
|
209
209
|
this.globe?.DrawRender();
|
|
210
210
|
}
|
|
211
|
-
updateChainDrawOptionsProperties(chainKey, drawOptions
|
|
211
|
+
updateChainDrawOptionsProperties(chainKey, drawOptions) {
|
|
212
212
|
if (this._freed) {
|
|
213
213
|
console.warn("CircleLineChainPlugin is freed, cannot update chain draw options properties.");
|
|
214
214
|
return;
|
|
@@ -232,7 +232,7 @@ export class CircleLineChainPlugin {
|
|
|
232
232
|
});
|
|
233
233
|
this._cleanChainsFromSemiPlugins([chainKey]);
|
|
234
234
|
this._reconstructChains([chainKey]);
|
|
235
|
-
this._updateTexts([chainKey],
|
|
235
|
+
this._updateTexts([chainKey], Array.from(this._textWritersMap.keys()));
|
|
236
236
|
this.globe?.DrawRender();
|
|
237
237
|
}
|
|
238
238
|
updateCoordinatesBulk(chains, { textWriterIDs = [] } = {}) {
|