@pirireis/webglobeplugins 0.9.11 → 0.9.13
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/angle-calculation.js +9 -11
- package/Math/arc.js +38 -41
- package/Math/bounds/line-bbox.js +79 -83
- package/Math/constants.js +4 -9
- package/Math/frustum/types.js +1 -2
- package/Math/juction/arc-plane.js +33 -36
- package/Math/juction/line-sphere.js +15 -18
- package/Math/juction/plane-plane.js +20 -23
- package/Math/line.js +42 -47
- package/Math/methods.js +69 -92
- package/Math/plane.js +33 -38
- package/Math/quaternion.js +48 -55
- package/Math/types.js +1 -2
- package/Math/utils.js +2 -4
- package/Math/vec3.js +46 -52
- package/algorithms/search-binary.js +5 -8
- package/altitude-locator/draw-subset-obj.js +8 -11
- package/altitude-locator/plugin.js +114 -133
- package/altitude-locator/types.js +1 -3
- package/arrowfield/adaptor.js +3 -7
- package/arrowfield/index.js +3 -10
- package/arrowfield/plugin.js +63 -69
- package/bearing-line/index.js +2 -8
- package/bearing-line/plugin.js +218 -248
- package/circle-line-chain/chain-list-map.js +82 -92
- package/circle-line-chain/plugin.js +147 -182
- package/circle-line-chain/util.js +1 -5
- package/compass-rose/compass-rose-padding-flat.js +111 -140
- package/compass-rose/compass-text-writer.js +63 -75
- package/compass-rose/index.js +3 -7
- package/compassrose/compassrose.js +50 -57
- package/compassrose/index.js +2 -8
- package/heatwave/index.js +3 -10
- package/heatwave/isobar/objectarraylabels.js +50 -56
- package/heatwave/isobar/plugin.js +111 -170
- package/heatwave/isobar/quadtreecontours.js +78 -96
- package/heatwave/plugins/heatwaveglobeshell.js +73 -94
- package/index.js +12 -58
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +32 -70
- package/partialrings/index.js +2 -41
- package/partialrings/plugin.js +55 -98
- package/partialrings/program.js +141 -59
- package/pin/pin-object-array.js +89 -97
- package/pin/pin-point-totem.js +21 -22
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +11 -14
- package/point-heat-map/plugin-webworker.js +45 -53
- package/point-heat-map/point-to-heat-map-flow.js +46 -51
- package/point-tracks/key-methods.js +2 -5
- package/point-tracks/plugin.js +141 -170
- package/programs/arrowfield/index.js +2 -7
- package/programs/arrowfield/logic.js +172 -67
- package/programs/arrowfield/object.js +35 -43
- package/programs/data2legend/density-to-legend.js +47 -26
- package/programs/data2legend/point-to-density-texture.js +56 -34
- package/programs/float2legendwithratio/index.js +2 -8
- package/programs/float2legendwithratio/logic.js +88 -45
- package/programs/float2legendwithratio/object.js +45 -54
- package/programs/globe-util/is-globe-moved.js +10 -13
- package/programs/globeshell/index.js +2 -8
- package/programs/globeshell/wiggle/index.js +2 -8
- package/programs/globeshell/wiggle/logic.js +191 -101
- package/programs/globeshell/wiggle/object.js +35 -43
- package/programs/helpers/blender/program.js +36 -22
- package/programs/helpers/fadeaway/index.js +2 -7
- package/programs/helpers/fadeaway/logic.js +36 -17
- package/programs/helpers/fadeaway/object.js +11 -18
- package/programs/helpers/index.js +2 -8
- package/programs/index.js +9 -58
- package/programs/line-on-globe/angled-line.js +95 -39
- package/programs/line-on-globe/circle-accurate-3d.js +86 -39
- package/programs/line-on-globe/circle-accurate-flat.js +116 -64
- package/programs/line-on-globe/circle-accurate.js +113 -46
- package/programs/line-on-globe/circle.js +106 -44
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +89 -42
- package/programs/line-on-globe/lines-color-instanced-flat.js +84 -43
- package/programs/line-on-globe/linestrip.js +126 -63
- package/programs/line-on-globe/naive-accurate-flexible.js +126 -59
- package/programs/line-on-globe/to-the-surface.js +62 -35
- package/programs/line-on-globe/util.js +2 -5
- package/programs/picking/pickable-renderer.js +127 -46
- package/programs/point-on-globe/element-globe-surface-glow.js +83 -46
- package/programs/point-on-globe/element-point-glow.js +112 -47
- package/programs/point-on-globe/square-pixel-point.js +80 -34
- package/programs/programcache.js +14 -19
- package/programs/rings/distancering/circleflatprogram.js +76 -70
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +168 -194
- package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -200
- package/programs/rings/distancering/index.js +5 -14
- package/programs/rings/distancering/paddyflatprogram.js +87 -70
- package/programs/rings/distancering/paddyflatprogram2d.js +89 -72
- package/programs/rings/distancering/paddyflatprogram3d.js +87 -70
- package/programs/rings/index.js +1 -17
- package/programs/rings/partial-ring/piece-of-pie.js +144 -44
- package/programs/totems/camerauniformblock.js +65 -56
- package/programs/totems/canvas-webglobe-info.js +49 -45
- package/programs/totems/gpu-selection-uniform-block.js +45 -45
- package/programs/totems/index.js +2 -40
- package/programs/two-d/pixel-padding-for-compass.js +94 -36
- package/programs/util.js +7 -10
- package/programs/vectorfields/index.js +3 -23
- package/programs/vectorfields/logics/drawrectangleparticles.js +73 -35
- package/programs/vectorfields/logics/index.js +4 -12
- package/programs/vectorfields/logics/pixelbased.js +94 -41
- package/programs/vectorfields/logics/ubo.js +32 -32
- package/programs/vectorfields/pingpongbuffermanager.js +30 -37
- package/rangerings/enum.js +2 -5
- package/rangerings/index.js +5 -15
- package/rangerings/plugin.js +223 -286
- package/rangerings/rangeringangletext.js +122 -137
- package/rangerings/ring-account.js +53 -75
- package/shaders/fragment-toy/firework.js +55 -4
- package/shaders/fragment-toy/singularity.js +56 -5
- package/timetracks/adaptors-line-strip.js +27 -44
- package/timetracks/adaptors.js +48 -67
- package/timetracks/index.js +5 -19
- package/timetracks/plugin-line-strip.js +65 -79
- package/timetracks/plugin.js +71 -85
- package/timetracks/program-line-strip.js +297 -107
- package/timetracks/program.js +421 -118
- package/timetracks/programpoint-line-strip.js +98 -48
- package/timetracks/programpoint.js +91 -48
- package/util/account/bufferoffsetmanager.js +72 -98
- package/util/account/index.js +3 -23
- package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -48
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -98
- package/util/account/single-attribute-buffer-management/index.js +4 -9
- package/util/account/single-attribute-buffer-management/object-store.js +29 -34
- package/util/account/single-attribute-buffer-management/types.js +1 -2
- package/util/account/util.js +2 -8
- package/util/algorithms/search-binary.js +5 -8
- package/util/check/get.js +5 -9
- package/util/check/typecheck.js +13 -24
- package/util/geometry/index.js +10 -18
- package/util/gl-util/buffer/attribute-loader.js +10 -26
- package/util/gl-util/buffer/index.js +2 -5
- package/util/gl-util/draw-options/methods.js +10 -15
- package/util/gl-util/uniform-block/manager.js +69 -72
- package/util/heatwavedatamanager/datamanager.js +56 -119
- package/util/heatwavedatamanager/index.js +3 -10
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +38 -47
- package/util/heatwavedatamanager/pointcoordsmeta.js +9 -13
- package/util/index.js +13 -57
- package/util/interpolation/timetrack/index.js +2 -5
- package/util/interpolation/timetrack/timetrack-interpolator.js +30 -36
- package/util/interpolation/timetrack/web-worker-str.js +180 -5
- package/util/interpolation/timetrack/web-worker.js +4 -6
- package/util/jshelpers/data-filler.js +8 -11
- package/util/jshelpers/equality.js +1 -3
- package/util/jshelpers/index.js +2 -37
- package/util/jshelpers/timefilters.js +8 -10
- package/util/picking/fence.js +8 -11
- package/util/picking/picker-displayer.js +49 -58
- package/util/programs/draw-texture-on-canvas.js +41 -26
- package/util/programs/index.js +1 -17
- package/util/programs/shapesonglobe.js +104 -68
- package/util/programs/supersampletotextures.js +45 -43
- package/util/programs/texturetoglobe.js +99 -52
- package/util/shaderfunctions/geometrytransformations.js +323 -35
- package/util/shaderfunctions/index.js +2 -18
- package/util/shaderfunctions/nodata.js +8 -5
- package/util/shaderfunctions/noisefunctions.js +40 -12
- package/util/surface-line-data/arcs-to-cuts.js +20 -23
- package/util/webglobe/gldefaultstates.js +1 -4
- package/util/webglobe/index.js +2 -18
- package/util/webglobe/rasteroverlay.js +36 -41
- package/util/webglobjectbuilders.js +70 -93
- package/util/webglobjectbuilders1.js +63 -82
- package/waveparticles/adaptor.js +7 -10
- package/waveparticles/index.js +3 -10
- package/waveparticles/plugin.js +82 -90
- package/wind/imagetovectorfieldandmagnitude.js +16 -19
- package/wind/index.js +5 -14
- package/wind/plugin.js +454 -291
- package/wind/vectorfieldimage.js +6 -8
- package/write-text/attached-text-writer.js +48 -54
- package/write-text/context-text.js +52 -63
- package/write-text/context-text3.js +71 -80
- package/write-text/index.js +1 -5
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var fidKey = "__fid__";
|
|
6
|
-
var object = {
|
|
1
|
+
import { CSObjectArrayUpdateTypes, } from "@pirireis/webglobe";
|
|
2
|
+
import { ENUM_HIDE, ENUM_TEXT_HIDE } from "./enum";
|
|
3
|
+
const fidKey = "__fid__";
|
|
4
|
+
const object = {
|
|
7
5
|
"displayName": "RangeRingAngleText",
|
|
8
6
|
"layerType": 3,
|
|
9
7
|
"wkbGeom": null,
|
|
@@ -16,15 +14,14 @@ var object = {
|
|
|
16
14
|
"MVTXYZName": "hd_seyp",
|
|
17
15
|
"rasterize": false,
|
|
18
16
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.style, style = _c === void 0 ? null : _c, _d = _b.hideAll, hideAll = _d === void 0 ? false : _d, _e = _b.opacity, opacity = _e === void 0 ? 1 : _e;
|
|
17
|
+
export default class RangeRingAngleText {
|
|
18
|
+
constructor(globe, id, { style = null, hideAll = false, opacity = 1 } = {}) {
|
|
22
19
|
this.globe = globe;
|
|
23
20
|
this.ObjectArray = globe.ObjectArray;
|
|
24
21
|
this.id = id;
|
|
25
22
|
this._hideAll = hideAll;
|
|
26
23
|
this._opacity = opacity;
|
|
27
|
-
|
|
24
|
+
const style_ = style !== null ? style : this.getDefaultStyle();
|
|
28
25
|
this.object = Object.assign({}, object, { style: style_, id: this.id });
|
|
29
26
|
this._centerCollection = new Map();
|
|
30
27
|
// new inner MAP params
|
|
@@ -32,11 +29,11 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
32
29
|
// textHide
|
|
33
30
|
this.ObjectArray.Add(this.object);
|
|
34
31
|
}
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
getDefaultStyle() {
|
|
33
|
+
const style = this.ObjectArray.GetDefaultStyle();
|
|
37
34
|
style.fidKey = fidKey;
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const { labels } = style;
|
|
36
|
+
const label = labels[0];
|
|
40
37
|
label.offset = { x: 0, y: 0 };
|
|
41
38
|
label.fontFamily.hollowWidth = 1;
|
|
42
39
|
label.vAlignment = 2;
|
|
@@ -45,24 +42,24 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
45
42
|
// eslint-disable-next-line
|
|
46
43
|
label.text = "`${aci}`";
|
|
47
44
|
return style;
|
|
48
|
-
}
|
|
49
|
-
|
|
45
|
+
}
|
|
46
|
+
setStyle(style) {
|
|
50
47
|
if (style === null)
|
|
51
48
|
return;
|
|
52
49
|
style.opacity = this._opacity;
|
|
53
50
|
this.object.style = style;
|
|
54
51
|
this.ObjectArray.StyleChanged(this.object);
|
|
55
|
-
}
|
|
56
|
-
|
|
52
|
+
}
|
|
53
|
+
setOpacity(opacity) {
|
|
57
54
|
this._opacity = opacity;
|
|
58
|
-
|
|
55
|
+
const { style } = this.object;
|
|
59
56
|
style.opacity = opacity;
|
|
60
57
|
this.ObjectArray.StyleChanged(this.object);
|
|
61
|
-
}
|
|
62
|
-
|
|
58
|
+
}
|
|
59
|
+
free() {
|
|
63
60
|
this.flush();
|
|
64
61
|
this.ObjectArray.Delete(this.id);
|
|
65
|
-
}
|
|
62
|
+
}
|
|
66
63
|
/**
|
|
67
64
|
* @param {Array<{centerID,stepAngle, long,lat, rings>} ringDatas
|
|
68
65
|
* centerID: string | ObjectArray fidKey de kullanilir
|
|
@@ -73,29 +70,25 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
73
70
|
* eger bir centerID zaten var ise: Onceki noktalar dusurulur ve yeniden eklenir
|
|
74
71
|
*
|
|
75
72
|
* */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
insertBulk(ringDatas) {
|
|
74
|
+
const { _hideAll } = this;
|
|
75
|
+
const addBucket = {
|
|
79
76
|
coords: [],
|
|
80
77
|
coordsZ: [],
|
|
81
78
|
attribs: []
|
|
82
79
|
};
|
|
83
|
-
|
|
80
|
+
const deleteBucket = {
|
|
84
81
|
coords: [],
|
|
85
82
|
coordsZ: [],
|
|
86
83
|
attribs: []
|
|
87
84
|
};
|
|
88
|
-
for (
|
|
89
|
-
var _a = ringDatas_1[_i], centerID = _a.centerID, long = _a.long, lat = _a.lat, rings = _a.rings, stepAngle = _a.stepAngle, _b = _a.hide, hide = _b === void 0 ? enum_1.ENUM_HIDE.SHOW : _b, _c = _a.textHide, textHide = _c === void 0 ? enum_1.ENUM_TEXT_HIDE.SHOW : _c;
|
|
85
|
+
for (const { centerID, long, lat, rings, stepAngle, hide = ENUM_HIDE.SHOW, textHide = ENUM_TEXT_HIDE.SHOW } of ringDatas) {
|
|
90
86
|
if (this._centerCollection.has(centerID)) {
|
|
91
87
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
92
88
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}, 0);
|
|
97
|
-
var textHide_ = _hideAll ? enum_1.ENUM_TEXT_HIDE.HIDE : textHide;
|
|
98
|
-
var show = hide !== enum_1.ENUM_HIDE.HIDE && textHide_ === enum_1.ENUM_TEXT_HIDE.SHOW;
|
|
89
|
+
const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
|
|
90
|
+
const textHide_ = _hideAll ? ENUM_TEXT_HIDE.HIDE : textHide;
|
|
91
|
+
const show = hide !== ENUM_HIDE.HIDE && textHide_ === ENUM_TEXT_HIDE.SHOW;
|
|
99
92
|
if (show)
|
|
100
93
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
|
|
101
94
|
this._centerCollection.set(centerID, new Map([
|
|
@@ -110,33 +103,32 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
110
103
|
if (this._hideAll)
|
|
111
104
|
return;
|
|
112
105
|
if (deleteBucket.coords.length > 0)
|
|
113
|
-
this._updateData(deleteBucket,
|
|
106
|
+
this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
|
|
114
107
|
if (addBucket.coords.length > 0)
|
|
115
|
-
this._updateData(addBucket,
|
|
116
|
-
}
|
|
108
|
+
this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
|
|
109
|
+
}
|
|
117
110
|
/**
|
|
118
111
|
* @param {Array<{centerID, x,y}>} centerDatas
|
|
119
112
|
* aci ve radiuslarin tutulmasi gereklidir.
|
|
120
113
|
* */
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
updateCentersXY(centerDatas) {
|
|
115
|
+
const updateBucket = {
|
|
123
116
|
coords: [],
|
|
124
117
|
coordsZ: [],
|
|
125
118
|
attribs: []
|
|
126
119
|
};
|
|
127
|
-
for (
|
|
128
|
-
var _a = centerDatas_1[_i], centerID = _a.centerID, long = _a.long, lat = _a.lat;
|
|
120
|
+
for (const { centerID, long, lat } of centerDatas) {
|
|
129
121
|
if (this._centerCollection.has(centerID)) {
|
|
130
|
-
|
|
122
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
131
123
|
centerMap.set("long", long);
|
|
132
124
|
centerMap.set("lat", lat);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
const hide = centerMap.get("hide");
|
|
126
|
+
const textHide = centerMap.get("textHide");
|
|
127
|
+
const isHidden = hide === ENUM_HIDE.HIDE || textHide === ENUM_TEXT_HIDE.HIDE;
|
|
136
128
|
if (isHidden)
|
|
137
129
|
continue;
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
131
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
140
132
|
// long, lat, radius, step, centerID, outBucket
|
|
141
133
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
|
|
142
134
|
}
|
|
@@ -145,38 +137,37 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
145
137
|
// delete attribs["aci"];
|
|
146
138
|
// }
|
|
147
139
|
if (updateBucket.coords.length > 0) {
|
|
148
|
-
this._updateData(updateBucket,
|
|
140
|
+
this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
|
|
149
141
|
}
|
|
150
|
-
}
|
|
142
|
+
}
|
|
151
143
|
/**
|
|
152
144
|
*
|
|
153
145
|
* @param {Array<{centerID:string, hide: bool}>} centerHides
|
|
154
146
|
*/
|
|
155
|
-
|
|
147
|
+
updateCentersHide(centerHides) {
|
|
156
148
|
if (this._hideAll) {
|
|
157
149
|
console.warn("Tum mesafe halkasi yazilari gizli durum. Islem yapilamaz");
|
|
158
150
|
return;
|
|
159
151
|
}
|
|
160
152
|
;
|
|
161
|
-
|
|
153
|
+
const addBucket = {
|
|
162
154
|
coords: [],
|
|
163
155
|
coordsZ: [],
|
|
164
156
|
attribs: []
|
|
165
157
|
};
|
|
166
|
-
|
|
158
|
+
const deleteBucket = {
|
|
167
159
|
coords: [],
|
|
168
160
|
coordsZ: [],
|
|
169
161
|
attribs: []
|
|
170
162
|
};
|
|
171
|
-
for (
|
|
172
|
-
var _a = centerHides_1[_i], centerID = _a.centerID, _b = _a.textHide, textHide = _b === void 0 ? null : _b, _c = _a.hide, hide = _c === void 0 ? null : _c;
|
|
163
|
+
for (const { centerID, textHide = null, hide = null } of centerHides) {
|
|
173
164
|
if (!this._centerCollection.has(centerID))
|
|
174
165
|
continue;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
167
|
+
const isHidden = centerMap.get("hide") === ENUM_HIDE.HIDE || centerMap.get("textHide") === ENUM_TEXT_HIDE.HIDE;
|
|
168
|
+
const _hide = hide !== null ? hide : centerMap.get("hide");
|
|
169
|
+
const _textHide = textHide !== null ? textHide : centerMap.get("textHide");
|
|
170
|
+
const show = (_hide !== ENUM_HIDE.HIDE) && (_textHide === ENUM_TEXT_HIDE.SHOW);
|
|
180
171
|
if (!isHidden && !show) {
|
|
181
172
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
182
173
|
}
|
|
@@ -189,95 +180,92 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
189
180
|
centerMap.set("textHide", textHide);
|
|
190
181
|
}
|
|
191
182
|
if (deleteBucket.coords.length > 0)
|
|
192
|
-
this._updateData(deleteBucket,
|
|
183
|
+
this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
|
|
193
184
|
if (addBucket.coords.length > 0)
|
|
194
|
-
this._updateData(addBucket,
|
|
195
|
-
}
|
|
185
|
+
this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
|
|
186
|
+
}
|
|
196
187
|
// TODO : Implement this
|
|
197
|
-
|
|
198
|
-
|
|
188
|
+
removeCenters(centerIDs) {
|
|
189
|
+
const deleteBucket = {
|
|
199
190
|
coords: [],
|
|
200
191
|
coordsZ: [],
|
|
201
192
|
attribs: []
|
|
202
193
|
};
|
|
203
|
-
for (
|
|
204
|
-
var centerID = centerIDs_1[_i];
|
|
194
|
+
for (const centerID of centerIDs) {
|
|
205
195
|
if (this._centerCollection.has(centerID)) {
|
|
206
196
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
207
197
|
this._centerCollection.delete(centerID);
|
|
208
198
|
}
|
|
209
199
|
}
|
|
210
|
-
this._updateData(deleteBucket,
|
|
211
|
-
}
|
|
212
|
-
|
|
200
|
+
this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
|
|
201
|
+
}
|
|
202
|
+
hideAll() {
|
|
213
203
|
this._hideAll = true;
|
|
214
|
-
|
|
204
|
+
const deleteBucket = {
|
|
215
205
|
coords: [],
|
|
216
206
|
coordsZ: [],
|
|
217
207
|
attribs: []
|
|
218
208
|
};
|
|
219
|
-
for (
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (hide === enum_1.ENUM_HIDE.HIDE)
|
|
209
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
210
|
+
const hide = centerMap.get("hide");
|
|
211
|
+
const hideText = centerMap.get("textHide");
|
|
212
|
+
centerMap.set("textHide", ENUM_TEXT_HIDE.HIDE);
|
|
213
|
+
if (hide === ENUM_HIDE.HIDE)
|
|
225
214
|
continue;
|
|
226
|
-
|
|
215
|
+
const isHidden = hideText === ENUM_TEXT_HIDE.HIDE;
|
|
227
216
|
if (!isHidden)
|
|
228
217
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
229
218
|
}
|
|
230
|
-
this._updateData(deleteBucket,
|
|
231
|
-
}
|
|
232
|
-
|
|
219
|
+
this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
|
|
220
|
+
}
|
|
221
|
+
showAll() {
|
|
233
222
|
this._hideAll = false;
|
|
234
|
-
|
|
223
|
+
const addBucket = {
|
|
235
224
|
coords: [],
|
|
236
225
|
coordsZ: [],
|
|
237
226
|
attribs: []
|
|
238
227
|
};
|
|
239
|
-
for (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (hide === enum_1.ENUM_HIDE.HIDE)
|
|
228
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
229
|
+
const hide = centerMap.get("hide");
|
|
230
|
+
if (hide === ENUM_HIDE.HIDE)
|
|
243
231
|
continue;
|
|
244
|
-
|
|
245
|
-
|
|
232
|
+
const hideText = centerMap.get("textHide");
|
|
233
|
+
const isHidden = hideText === ENUM_TEXT_HIDE.HIDE;
|
|
246
234
|
if (isHidden) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
235
|
+
const long = centerMap.get("long");
|
|
236
|
+
const lat = centerMap.get("lat");
|
|
237
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
238
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
251
239
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
|
|
252
|
-
centerMap.set("hide",
|
|
253
|
-
centerMap.set("textHide",
|
|
240
|
+
centerMap.set("hide", ENUM_HIDE.SHOW);
|
|
241
|
+
centerMap.set("textHide", ENUM_TEXT_HIDE.SHOW);
|
|
254
242
|
}
|
|
255
243
|
}
|
|
256
244
|
if (addBucket.coords.length)
|
|
257
|
-
this._updateData(addBucket,
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
245
|
+
this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
|
|
246
|
+
}
|
|
247
|
+
flush() {
|
|
248
|
+
const data = {
|
|
261
249
|
coords: [],
|
|
262
250
|
coordsZ: [],
|
|
263
251
|
attribs: []
|
|
264
252
|
};
|
|
265
253
|
this._idCollector = new Set();
|
|
266
254
|
this.ObjectArray.SetData(this.object, data);
|
|
267
|
-
}
|
|
255
|
+
}
|
|
268
256
|
//------------------PRIVATE METHODS------------------//
|
|
269
|
-
|
|
257
|
+
_appendCircle(long, lat, radius, step, centerID, outBucket) {
|
|
270
258
|
this.__realCoords(long, lat, radius, step, centerID, outBucket);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
for (
|
|
277
|
-
|
|
259
|
+
}
|
|
260
|
+
__realCoords(longCenter, latCenter, radius, stepAngle, centerID, outBucket) {
|
|
261
|
+
const { globe } = this;
|
|
262
|
+
const { coords, coordsZ, attribs } = outBucket;
|
|
263
|
+
let i = 1;
|
|
264
|
+
for (let aci = stepAngle; aci < 360; aci += stepAngle) {
|
|
265
|
+
const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, aci);
|
|
278
266
|
coords.push(long, lat);
|
|
279
267
|
coordsZ.push(0);
|
|
280
|
-
|
|
268
|
+
const key = this._key(centerID, i);
|
|
281
269
|
i++;
|
|
282
270
|
// fidkey is the key
|
|
283
271
|
attribs.push({
|
|
@@ -286,56 +274,53 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
286
274
|
});
|
|
287
275
|
}
|
|
288
276
|
{ // add 0
|
|
289
|
-
|
|
277
|
+
const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, 0);
|
|
290
278
|
coords.push(long, lat);
|
|
291
279
|
coordsZ.push(0);
|
|
292
|
-
|
|
280
|
+
const key = this._key(centerID, 0);
|
|
293
281
|
// fidkey is the key
|
|
294
282
|
attribs.push({
|
|
295
283
|
"__fid__": key,
|
|
296
284
|
"aci": "K"
|
|
297
285
|
});
|
|
298
286
|
}
|
|
299
|
-
}
|
|
300
|
-
|
|
287
|
+
}
|
|
288
|
+
_updateData(bucket, mode) {
|
|
301
289
|
this.ObjectArray.UpdateData(this.object, mode, [bucket], { attribs: false, icon: false, text: false });
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
return
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
for (
|
|
312
|
-
|
|
290
|
+
}
|
|
291
|
+
_key(centerRingKey, limpIndex) {
|
|
292
|
+
return `${centerRingKey}_${limpIndex}`;
|
|
293
|
+
}
|
|
294
|
+
_fillDeleteBucket(centerID, outDeleteBucket) {
|
|
295
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
296
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
297
|
+
const { coords, coordsZ, attribs } = outDeleteBucket;
|
|
298
|
+
let i = 0;
|
|
299
|
+
for (let aci = 0; aci < 360; aci += stepAngle) {
|
|
300
|
+
const key = this._key(centerID, i++);
|
|
313
301
|
coords.push(0, 0);
|
|
314
302
|
coordsZ.push(0);
|
|
315
303
|
attribs.push({
|
|
316
304
|
"__fid__": key,
|
|
317
305
|
});
|
|
318
306
|
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
307
|
+
}
|
|
308
|
+
_updateAll() {
|
|
309
|
+
const updateBucket = {
|
|
322
310
|
coords: [],
|
|
323
311
|
coordsZ: [],
|
|
324
312
|
attribs: []
|
|
325
313
|
};
|
|
326
|
-
for (
|
|
327
|
-
|
|
328
|
-
var isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
314
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
315
|
+
const isHidden = centerMap.get("hide") === ENUM_HIDE.HIDE || centerMap.get("textHide") === ENUM_TEXT_HIDE.HIDE;
|
|
329
316
|
if (isHidden)
|
|
330
317
|
continue;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
318
|
+
const long = centerMap.get("long");
|
|
319
|
+
const lat = centerMap.get("lat");
|
|
320
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
321
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
335
322
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
|
|
336
323
|
}
|
|
337
|
-
this._updateData(updateBucket,
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
}());
|
|
341
|
-
exports.default = RangeRingAngleText;
|
|
324
|
+
this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -1,60 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This account interacts with buffer orchestrations and buffers.
|
|
4
3
|
* For rings, coordinates and paddings
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ringBigPaddingKeyMethod = exports.ringKeyMethod = exports.RingAccount = void 0;
|
|
19
|
-
var ringKeyMethod = function (centerID, ringID) { return "".concat(centerID, "_").concat(ringID); };
|
|
20
|
-
exports.ringKeyMethod = ringKeyMethod;
|
|
21
|
-
var ringBigPaddingKeyMethod = function (centerID, ringID, angle) { return "".concat(centerID, "_").concat(ringID, "_").concat(angle); };
|
|
22
|
-
exports.ringBigPaddingKeyMethod = ringBigPaddingKeyMethod;
|
|
5
|
+
const ringKeyMethod = (centerID, ringID) => `${centerID}_${ringID}`;
|
|
6
|
+
const ringBigPaddingKeyMethod = (centerID, ringID, angle) => `${centerID}_${ringID}_${angle}`;
|
|
23
7
|
/**
|
|
24
8
|
* @typedef { Array < { ringID, radius, paddingRange } >} rings
|
|
25
9
|
* @param { Array < centerID: string, x: number, y: number, stepAngle: number, rgba: [4 numbers], rings: rings } items
|
|
26
10
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
class RingAccount {
|
|
12
|
+
constructor() {
|
|
29
13
|
this._centralMap = new Map(); // key, new MAP(x,y, rings:[])
|
|
30
14
|
}
|
|
31
15
|
/**
|
|
32
16
|
* @typedef {centerID, long,lat, rings} centralItem
|
|
33
17
|
*
|
|
34
18
|
*/
|
|
35
|
-
|
|
36
|
-
centralItem.rings.forEach(
|
|
19
|
+
insertCenter(centralItem) {
|
|
20
|
+
centralItem.rings.forEach((ring) => {
|
|
37
21
|
ring.__identity__ = ringKeyMethod(centralItem.centerID, ring.ringID);
|
|
38
22
|
});
|
|
39
|
-
this._centralMap.set(centralItem.centerID,
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
this._centralMap.set(centralItem.centerID, {
|
|
24
|
+
...centralItem,
|
|
25
|
+
rgba: new Float32Array(centralItem.rgba),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getCenter(centerID) {
|
|
42
29
|
return this._centralMap.get(centerID);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (
|
|
46
|
-
|
|
47
|
-
var center = this.getCenter(centerID);
|
|
30
|
+
}
|
|
31
|
+
updateCentersCoordinate(items) {
|
|
32
|
+
for (const { centerID, long, lat } of items) {
|
|
33
|
+
const center = this.getCenter(centerID);
|
|
48
34
|
if (center) {
|
|
49
35
|
center.long = long;
|
|
50
36
|
center.lat = lat;
|
|
51
37
|
}
|
|
52
38
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
for (
|
|
56
|
-
|
|
57
|
-
var center = this.getCenter(centerID);
|
|
39
|
+
}
|
|
40
|
+
updateCentersHide(items) {
|
|
41
|
+
for (const { centerID, hide = null, textHide = null } of items) {
|
|
42
|
+
const center = this.getCenter(centerID);
|
|
58
43
|
if (center) {
|
|
59
44
|
if (hide !== null)
|
|
60
45
|
center.hide = hide;
|
|
@@ -62,73 +47,66 @@ var RingAccount = /** @class */ (function () {
|
|
|
62
47
|
center.textHide = textHide;
|
|
63
48
|
}
|
|
64
49
|
}
|
|
65
|
-
}
|
|
50
|
+
}
|
|
66
51
|
/**
|
|
67
52
|
*
|
|
68
53
|
* @param {Array<{centerID, rgba}>} centersColor
|
|
69
54
|
*/
|
|
70
|
-
|
|
71
|
-
for (
|
|
72
|
-
|
|
73
|
-
var center = this.getCenter(centerID);
|
|
55
|
+
updateCentersColor(centersColor) {
|
|
56
|
+
for (const { centerID, rgba } of centersColor) {
|
|
57
|
+
const center = this.getCenter(centerID);
|
|
74
58
|
if (center) {
|
|
75
59
|
center.rgba = new Float32Array(rgba);
|
|
76
60
|
}
|
|
77
61
|
}
|
|
78
|
-
}
|
|
62
|
+
}
|
|
79
63
|
// to delete rings and one degree paddings from buffer
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
ringKeys(centerID) {
|
|
65
|
+
const result = [];
|
|
66
|
+
const center = this.getCenter(centerID);
|
|
83
67
|
if (center) {
|
|
84
|
-
|
|
85
|
-
for (
|
|
86
|
-
var __identity__ = rings_1[_i].__identity__;
|
|
68
|
+
const rings = center.rings;
|
|
69
|
+
for (const { __identity__ } of rings) {
|
|
87
70
|
result.push(__identity__);
|
|
88
71
|
}
|
|
89
72
|
}
|
|
90
73
|
return result;
|
|
91
|
-
}
|
|
74
|
+
}
|
|
92
75
|
// To delete big paddings from buffer
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
ringBigPaddingKeys(centerID) {
|
|
77
|
+
const result = [];
|
|
78
|
+
const center = this.getCenter(centerID);
|
|
96
79
|
if (!center)
|
|
97
80
|
return [];
|
|
98
|
-
|
|
99
|
-
for (
|
|
100
|
-
|
|
101
|
-
var angle = 0;
|
|
81
|
+
const { rings, stepAngle } = center;
|
|
82
|
+
for (const { ringID } of rings) {
|
|
83
|
+
let angle = 0;
|
|
102
84
|
while (angle < 360) {
|
|
103
85
|
result.push(ringBigPaddingKeyMethod(centerID, ringID, angle));
|
|
104
86
|
angle += stepAngle;
|
|
105
87
|
}
|
|
106
88
|
}
|
|
107
89
|
return result;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
centerIDs.forEach(
|
|
90
|
+
}
|
|
91
|
+
removeCenters(centerIDs) {
|
|
92
|
+
const centralMap = this._centralMap;
|
|
93
|
+
centerIDs.forEach((centerID) => {
|
|
112
94
|
centralMap.delete(centerID);
|
|
113
95
|
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var center = this.getCenter(centerID);
|
|
96
|
+
}
|
|
97
|
+
textUpdate(centerID, textWriterObjs, dataPreAdaptor = null) {
|
|
98
|
+
const center = this.getCenter(centerID);
|
|
118
99
|
if (!center)
|
|
119
100
|
return;
|
|
120
|
-
|
|
121
|
-
textWriterObjs.forEach(
|
|
101
|
+
const data = (dataPreAdaptor) ? dataPreAdaptor(center) : center;
|
|
102
|
+
textWriterObjs.forEach((writer) => {
|
|
122
103
|
writer.insertTextBulk(data.rings, data);
|
|
123
104
|
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this._centralMap.forEach(function (center) {
|
|
129
|
-
_this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
|
|
105
|
+
}
|
|
106
|
+
updateAllText(textWriterObjs, dataPreAdaptor = null) {
|
|
107
|
+
this._centralMap.forEach((center) => {
|
|
108
|
+
this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
|
|
130
109
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
exports.RingAccount = RingAccount;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export { RingAccount, ringKeyMethod, ringBigPaddingKeyMethod };
|