@pirireis/webglobeplugins 0.1.1 → 0.1.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
|
@@ -27,9 +27,9 @@ out vec4 v_color;
|
|
|
27
27
|
out vec2 v_limp;
|
|
28
28
|
|
|
29
29
|
void main() {
|
|
30
|
-
if( flag == 1.0 || radius == 0.0) return; // 1.0 is hide
|
|
30
|
+
if( flag == 1.0 || radius == 0.0) return; // flag 1.0 is hide
|
|
31
31
|
v_color = color;
|
|
32
|
-
|
|
32
|
+
if ( gl_VertexID == 270 ) v_color.rgb += 0.2;
|
|
33
33
|
float angle = 3.1415926535897932384626433832795 * 2.0 * (float(gl_VertexID) / circle_edge_count);
|
|
34
34
|
if ( is3D ){
|
|
35
35
|
gl_Position = projection * view * vec4(
|
|
@@ -14,7 +14,6 @@ const vertexShader = `#version 300 es ` +
|
|
|
14
14
|
shaderfunctions.longLatRadToCartesian3D +
|
|
15
15
|
shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
16
16
|
shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
17
|
-
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistancePadding +
|
|
18
17
|
shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
19
18
|
|
|
20
19
|
in vec2 center;
|
|
@@ -51,7 +50,6 @@ void main() {
|
|
|
51
50
|
if ( compass == 1 ){
|
|
52
51
|
limp = circleLimpFromLongLatRadCenterMercatorCompass(center , radius_, angle);
|
|
53
52
|
} else {
|
|
54
|
-
// limp = circleLimpFromLongLatRadCenterMercatorRealDistancePadding(center, radius_, angle);
|
|
55
53
|
limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
56
54
|
}
|
|
57
55
|
v_limp = limp;
|
|
@@ -116,11 +116,11 @@ export default class RangeRingAngleText {
|
|
|
116
116
|
|
|
117
117
|
for (const { centerID, x, y, rings, stepAngle, hide = ENUM_HIDE.SHOW, textHide = ENUM_TEXT_HIDE.SHOW } of ringDatas) {
|
|
118
118
|
if (this._centerCollection.has(centerID)) {
|
|
119
|
-
|
|
120
|
-
this._fillDeleteBucket(centerID, stepAngle, deleteBucket);
|
|
119
|
+
this._fillDeleteBucket(centerID, deleteBucket);
|
|
121
120
|
}
|
|
122
121
|
const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
|
|
123
|
-
|
|
122
|
+
const show = hide !== ENUM_HIDE.HIDE && textHide === ENUM_TEXT_HIDE.SHOW;
|
|
123
|
+
if (show) this._appendCircle(x, y, maxRadius, stepAngle, centerID, addBucket);
|
|
124
124
|
this._centerCollection.set(centerID,
|
|
125
125
|
new Map([
|
|
126
126
|
["stepAngle", stepAngle],
|
|
@@ -208,7 +208,7 @@ export default class RangeRingAngleText {
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
// TODO : Implement this
|
|
211
|
-
|
|
211
|
+
removeCenters(centerIDs) {
|
|
212
212
|
const deleteBucket = {
|
|
213
213
|
coords: [],
|
|
214
214
|
coordsZ: [],
|
package/rangerings/rangerings.js
CHANGED
|
@@ -22,11 +22,11 @@ const { CircleFlatProgram, PaddyFlatProgram, CirclePaddySharedBuffer } = rings;
|
|
|
22
22
|
|
|
23
23
|
export default class {
|
|
24
24
|
|
|
25
|
-
constructor(id, { oneDegreePadding = true, compass = COMPASS_MODES.COMPASS,
|
|
25
|
+
constructor(id, { oneDegreePadding = true, compass = COMPASS_MODES.COMPASS, showNumbers = true } = {}) {
|
|
26
26
|
this.id = id;
|
|
27
27
|
this.compass = compass;
|
|
28
28
|
this._showNumbers = showNumbers;
|
|
29
|
-
this.circleEdgeCount =
|
|
29
|
+
this.circleEdgeCount = 360;
|
|
30
30
|
this._onedegreepaddingOn = oneDegreePadding;
|
|
31
31
|
this.bufferManager = null;
|
|
32
32
|
}
|
|
@@ -57,16 +57,6 @@ export default class {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
// // TODO: Client should reinsert all data to be able to see numbers. Think Better Solution.
|
|
61
|
-
// setShowNumbers(showNumbers) {
|
|
62
|
-
// this._showNumbers = showNumbers;
|
|
63
|
-
// if (this._showNumbers) {
|
|
64
|
-
// this._textPlugin = new RangeRingAngleText(this.globe);
|
|
65
|
-
// } else {
|
|
66
|
-
// this._textPlugin?.free();
|
|
67
|
-
// this._textPlugin = null;
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
60
|
|
|
71
61
|
setGeometry() {
|
|
72
62
|
this._textPlugin?.setGeometry();
|
|
@@ -116,6 +106,9 @@ export default class {
|
|
|
116
106
|
const insertData = ringItemsToCircleBufferInsertDataAdaptor(items);
|
|
117
107
|
|
|
118
108
|
this.bufferManager.insertBulk(insertData);
|
|
109
|
+
for (const item of items) {
|
|
110
|
+
item.paddingAngles = angleToPaddingAngles(item.stepAngle, 0);
|
|
111
|
+
}
|
|
119
112
|
this.paddingBufferManager.insertBulk(items);
|
|
120
113
|
this._textPlugin?.insertBulk(items);
|
|
121
114
|
this.globe.DrawRender();
|
|
@@ -162,7 +155,7 @@ export default class {
|
|
|
162
155
|
const ringItemsToCircleBufferInsertDataAdaptor = (ringItems) => {
|
|
163
156
|
|
|
164
157
|
const result = [];
|
|
165
|
-
for (const { centerID, x, y,
|
|
158
|
+
for (const { centerID, x, y, rgba, rings, hide = 0, textHide = 0 } of ringItems) {
|
|
166
159
|
const resultRings = [];
|
|
167
160
|
for (const { ringID, radius, padding } of rings) {
|
|
168
161
|
resultRings.push({
|
|
@@ -178,8 +171,12 @@ const ringItemsToCircleBufferInsertDataAdaptor = (ringItems) => {
|
|
|
178
171
|
x,
|
|
179
172
|
y,
|
|
180
173
|
rings: resultRings,
|
|
181
|
-
hide
|
|
174
|
+
hide,
|
|
175
|
+
textHide
|
|
182
176
|
});
|
|
183
177
|
}
|
|
184
178
|
return result;
|
|
185
|
-
};
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const angleToPaddingAngles = (gapDegree, offsetDegree = 0) => Array.from({ length: Math.ceil(360 / gapDegree) }, (_, i) => (i * gapDegree + offsetDegree) * Math.PI / 180);
|
|
182
|
+
|