@pirireis/webglobeplugins 0.15.28 → 0.15.30
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/Math/vec3.js
CHANGED
|
@@ -60,7 +60,7 @@ function length(a) {
|
|
|
60
60
|
function normalize(outVec, inVec) {
|
|
61
61
|
const len = length(inVec);
|
|
62
62
|
if (len === 0) {
|
|
63
|
-
console.warn('Cannot normalize a zero vector');
|
|
63
|
+
// console.warn('Cannot normalize a zero vector');
|
|
64
64
|
outVec[0] = 0;
|
|
65
65
|
outVec[1] = 0;
|
|
66
66
|
outVec[2] = 0;
|
package/package.json
CHANGED
|
@@ -19,9 +19,6 @@ export class CircleLineChainPlugin {
|
|
|
19
19
|
_textWritersMap;
|
|
20
20
|
_textDataPreAdaptor = undefined;
|
|
21
21
|
_chainListMap;
|
|
22
|
-
_arcAdaptor = arcDataAdaptor;
|
|
23
|
-
_lineAdaptor = lineDataAdaptor;
|
|
24
|
-
_circleAdaptor = circleDataAdaptor;
|
|
25
22
|
_semiPluginOptions = {
|
|
26
23
|
circleOnTerrainOptions: {
|
|
27
24
|
variativeColorsOn: false,
|
|
@@ -50,14 +47,11 @@ export class CircleLineChainPlugin {
|
|
|
50
47
|
opacity: 1.0,
|
|
51
48
|
}
|
|
52
49
|
};
|
|
53
|
-
constructor(id, { drawCircleOn, textWritersMap, textDataPreAdaptor, opacities,
|
|
50
|
+
constructor(id, { drawCircleOn, textWritersMap, textDataPreAdaptor, opacities, arcOnTerrainOptions, circleOnTerrainOptions, lineOptions } = {}) {
|
|
54
51
|
const defaults = {
|
|
55
52
|
drawCircleOn: true,
|
|
56
53
|
textWritersMap: new Map(),
|
|
57
54
|
textDataPreAdaptor: undefined,
|
|
58
|
-
lineAdaptor: lineDataAdaptor,
|
|
59
|
-
arcAdaptor: arcDataAdaptor,
|
|
60
|
-
circleAdaptor: circleDataAdaptor,
|
|
61
55
|
opacities: {
|
|
62
56
|
general: 1,
|
|
63
57
|
circle: null,
|
|
@@ -73,9 +67,6 @@ export class CircleLineChainPlugin {
|
|
|
73
67
|
drawCircleOn: drawCircleOn ?? defaults.drawCircleOn,
|
|
74
68
|
textWritersMap: textWritersMap ?? defaults.textWritersMap,
|
|
75
69
|
textDataPreAdaptor: textDataPreAdaptor ?? defaults.textDataPreAdaptor,
|
|
76
|
-
lineAdaptor: lineAdaptor ?? defaults.lineAdaptor,
|
|
77
|
-
arcAdaptor: arcAdaptor ?? defaults.arcAdaptor,
|
|
78
|
-
circleAdaptor: circleAdaptor ?? defaults.circleAdaptor,
|
|
79
70
|
opacities: finalOpacities
|
|
80
71
|
};
|
|
81
72
|
this._semiPluginOptions.circleOnTerrainOptions = {
|
|
@@ -95,9 +86,6 @@ export class CircleLineChainPlugin {
|
|
|
95
86
|
this._textWritersMap = config.textWritersMap;
|
|
96
87
|
this._textDataPreAdaptor = config.textDataPreAdaptor;
|
|
97
88
|
this._chainListMap = new ChainListMap(keyMethod);
|
|
98
|
-
this._arcAdaptor = config.arcAdaptor;
|
|
99
|
-
this._lineAdaptor = config.lineAdaptor;
|
|
100
|
-
this._circleAdaptor = config.circleAdaptor;
|
|
101
89
|
this._opacities = config.opacities;
|
|
102
90
|
this._checktextWritersMap(this._textWritersMap);
|
|
103
91
|
this._textWritersMap.forEach((writer) => {
|
|
@@ -182,6 +170,11 @@ export class CircleLineChainPlugin {
|
|
|
182
170
|
console.warn("CircleLineChainPlugin is freed, cannot delete chains.");
|
|
183
171
|
return;
|
|
184
172
|
}
|
|
173
|
+
// type check chainKeys
|
|
174
|
+
if (!Array.isArray(chainKeys) || chainKeys.some(key => typeof key !== "string")) {
|
|
175
|
+
console.warn("Invalid chainKeys array.");
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
185
178
|
for (const chainKey of chainKeys) {
|
|
186
179
|
const keys = this._chainListMap.deleteChainAndReturnChainKeys(chainKey, this._textWritersMap);
|
|
187
180
|
if (keys.length <= 1) {
|
|
@@ -378,9 +371,9 @@ export class CircleLineChainPlugin {
|
|
|
378
371
|
console.warn(`Chain with key ${chainKey} not found.`);
|
|
379
372
|
continue;
|
|
380
373
|
}
|
|
381
|
-
const lineInput =
|
|
382
|
-
const arcInput =
|
|
383
|
-
const circleInput =
|
|
374
|
+
const lineInput = lineDataAdaptor(chain);
|
|
375
|
+
const arcInput = arcDataAdaptor(chain);
|
|
376
|
+
const circleInput = circleDataAdaptor(globe, chain);
|
|
384
377
|
this.linePlugin?.insertBulk(lineInput);
|
|
385
378
|
this.arcPlugin?.insertBulk(arcInput);
|
|
386
379
|
this.circlePlugin?.insertBulk(circleInput);
|
package/rangerings/enum.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export const ENUM_HIDE = Object.freeze({ SHOW: 0, HIDE: 1, HIDE_1_DEGREE_PADDINGS: 2 });
|
|
2
|
+
export const ENUM_TEXT_HIDE = Object.freeze({ SHOW: 0, HIDE: 1 });
|
|
@@ -164,12 +164,12 @@ export class CircleOnTerrainPlugin {
|
|
|
164
164
|
const keys = [];
|
|
165
165
|
let newItemCount = 0;
|
|
166
166
|
for (const circleInput of circles) {
|
|
167
|
-
if (
|
|
167
|
+
if (circleInput.key == null || circleInput.center == null || circleInput.radius == null) {
|
|
168
168
|
console.warn(`CircleOnTerrainPlugin: Circle input is missing required properties: ${circleInput.radius} or ${circleInput.center} or ${circleInput.key}`);
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
171
|
if (circleInput.radius <= 0) {
|
|
172
|
-
console.warn(`CircleOnTerrainPlugin: Circle ${circleInput.key} has non-positive radius ${circleInput.radius}. Skipping.`);
|
|
172
|
+
// console.warn(`CircleOnTerrainPlugin: Circle ${circleInput.key} has non-positive radius ${circleInput.radius}. Skipping.`);
|
|
173
173
|
continue;
|
|
174
174
|
}
|
|
175
175
|
keys.push(circleInput.key);
|