@pirireis/webglobeplugins 0.9.11 → 0.9.12

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.
Files changed (166) hide show
  1. package/Math/angle-calculation.js +8 -8
  2. package/Math/arc.js +18 -18
  3. package/Math/bounds/line-bbox.js +78 -80
  4. package/Math/constants.js +3 -3
  5. package/Math/juction/arc-plane.js +23 -23
  6. package/Math/juction/line-sphere.js +11 -11
  7. package/Math/juction/plane-plane.js +11 -11
  8. package/Math/line.js +14 -16
  9. package/Math/methods.js +65 -70
  10. package/Math/plane.js +16 -18
  11. package/Math/quaternion.js +45 -49
  12. package/Math/utils.js +2 -2
  13. package/Math/vec3.js +42 -45
  14. package/algorithms/search-binary.js +4 -4
  15. package/altitude-locator/draw-subset-obj.js +7 -8
  16. package/altitude-locator/plugin.js +98 -114
  17. package/arrowfield/adaptor.js +3 -4
  18. package/arrowfield/index.js +2 -2
  19. package/arrowfield/plugin.js +62 -65
  20. package/bearing-line/index.js +1 -1
  21. package/bearing-line/plugin.js +200 -226
  22. package/circle-line-chain/chain-list-map.js +82 -88
  23. package/circle-line-chain/plugin.js +134 -165
  24. package/circle-line-chain/util.js +1 -1
  25. package/compass-rose/compass-rose-padding-flat.js +108 -133
  26. package/compass-rose/compass-text-writer.js +62 -70
  27. package/compass-rose/index.js +2 -2
  28. package/compassrose/compassrose.js +46 -50
  29. package/compassrose/index.js +1 -1
  30. package/heatwave/index.js +2 -2
  31. package/heatwave/isobar/objectarraylabels.js +44 -48
  32. package/heatwave/isobar/plugin.js +104 -123
  33. package/heatwave/isobar/quadtreecontours.js +76 -92
  34. package/heatwave/plugins/heatwaveglobeshell.js +69 -87
  35. package/index.js +11 -11
  36. package/package.json +1 -1
  37. package/partialrings/buffer-manager.js +32 -64
  38. package/partialrings/index.js +1 -1
  39. package/partialrings/plugin.js +48 -84
  40. package/partialrings/program.js +136 -47
  41. package/pin/pin-object-array.js +83 -86
  42. package/pin/pin-point-totem.js +21 -22
  43. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
  44. package/point-heat-map/plugin-webworker.js +40 -45
  45. package/point-heat-map/point-to-heat-map-flow.js +40 -42
  46. package/point-tracks/key-methods.js +1 -1
  47. package/point-tracks/plugin.js +137 -162
  48. package/programs/arrowfield/index.js +1 -1
  49. package/programs/arrowfield/logic.js +170 -62
  50. package/programs/arrowfield/object.js +33 -35
  51. package/programs/data2legend/density-to-legend.js +45 -21
  52. package/programs/data2legend/point-to-density-texture.js +52 -27
  53. package/programs/float2legendwithratio/index.js +1 -1
  54. package/programs/float2legendwithratio/logic.js +88 -42
  55. package/programs/float2legendwithratio/object.js +43 -46
  56. package/programs/globe-util/is-globe-moved.js +10 -11
  57. package/programs/globeshell/index.js +1 -1
  58. package/programs/globeshell/wiggle/index.js +1 -1
  59. package/programs/globeshell/wiggle/logic.js +191 -98
  60. package/programs/globeshell/wiggle/object.js +33 -35
  61. package/programs/helpers/blender/program.js +36 -19
  62. package/programs/helpers/fadeaway/index.js +1 -1
  63. package/programs/helpers/fadeaway/logic.js +35 -13
  64. package/programs/helpers/fadeaway/object.js +9 -10
  65. package/programs/helpers/index.js +1 -1
  66. package/programs/index.js +8 -8
  67. package/programs/line-on-globe/angled-line.js +91 -32
  68. package/programs/line-on-globe/circle-accurate-3d.js +82 -32
  69. package/programs/line-on-globe/circle-accurate-flat.js +108 -50
  70. package/programs/line-on-globe/circle-accurate.js +103 -33
  71. package/programs/line-on-globe/circle.js +97 -32
  72. package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
  73. package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
  74. package/programs/line-on-globe/linestrip.js +111 -45
  75. package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
  76. package/programs/line-on-globe/to-the-surface.js +58 -29
  77. package/programs/line-on-globe/util.js +1 -1
  78. package/programs/picking/pickable-renderer.js +117 -33
  79. package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
  80. package/programs/point-on-globe/element-point-glow.js +103 -35
  81. package/programs/point-on-globe/square-pixel-point.js +76 -27
  82. package/programs/programcache.js +13 -13
  83. package/programs/rings/distancering/circleflatprogram.js +63 -21
  84. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
  85. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
  86. package/programs/rings/distancering/index.js +4 -4
  87. package/programs/rings/distancering/paddyflatprogram.js +73 -20
  88. package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
  89. package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
  90. package/programs/rings/partial-ring/piece-of-pie.js +137 -35
  91. package/programs/totems/camerauniformblock.js +64 -51
  92. package/programs/totems/canvas-webglobe-info.js +48 -40
  93. package/programs/totems/gpu-selection-uniform-block.js +44 -40
  94. package/programs/totems/index.js +1 -1
  95. package/programs/two-d/pixel-padding-for-compass.js +90 -29
  96. package/programs/util.js +6 -7
  97. package/programs/vectorfields/index.js +1 -1
  98. package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
  99. package/programs/vectorfields/logics/index.js +3 -3
  100. package/programs/vectorfields/logics/pixelbased.js +91 -35
  101. package/programs/vectorfields/logics/ubo.js +31 -25
  102. package/programs/vectorfields/pingpongbuffermanager.js +30 -34
  103. package/rangerings/index.js +4 -4
  104. package/rangerings/plugin.js +202 -258
  105. package/rangerings/rangeringangletext.js +108 -120
  106. package/rangerings/ring-account.js +52 -69
  107. package/shaders/fragment-toy/firework.js +55 -1
  108. package/shaders/fragment-toy/singularity.js +55 -1
  109. package/timetracks/adaptors-line-strip.js +26 -37
  110. package/timetracks/adaptors.js +47 -61
  111. package/timetracks/index.js +4 -4
  112. package/timetracks/plugin-line-strip.js +63 -71
  113. package/timetracks/plugin.js +69 -77
  114. package/timetracks/program-line-strip.js +296 -103
  115. package/timetracks/program.js +419 -113
  116. package/timetracks/programpoint-line-strip.js +97 -44
  117. package/timetracks/programpoint.js +90 -44
  118. package/util/account/bufferoffsetmanager.js +72 -95
  119. package/util/account/index.js +1 -1
  120. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
  121. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
  122. package/util/account/single-attribute-buffer-management/index.js +3 -3
  123. package/util/account/single-attribute-buffer-management/object-store.js +29 -30
  124. package/util/account/util.js +2 -4
  125. package/util/algorithms/search-binary.js +4 -4
  126. package/util/check/get.js +5 -5
  127. package/util/check/typecheck.js +13 -15
  128. package/util/geometry/index.js +9 -11
  129. package/util/gl-util/buffer/attribute-loader.js +8 -20
  130. package/util/gl-util/buffer/index.js +1 -1
  131. package/util/gl-util/draw-options/methods.js +8 -9
  132. package/util/gl-util/uniform-block/manager.js +67 -67
  133. package/util/heatwavedatamanager/datamanager.js +56 -116
  134. package/util/heatwavedatamanager/index.js +2 -2
  135. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
  136. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
  137. package/util/index.js +6 -6
  138. package/util/interpolation/timetrack/index.js +1 -1
  139. package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
  140. package/util/interpolation/timetrack/web-worker-str.js +179 -1
  141. package/util/interpolation/timetrack/web-worker.js +4 -4
  142. package/util/jshelpers/data-filler.js +7 -7
  143. package/util/jshelpers/timefilters.js +7 -7
  144. package/util/picking/fence.js +7 -7
  145. package/util/picking/picker-displayer.js +46 -52
  146. package/util/programs/draw-texture-on-canvas.js +39 -21
  147. package/util/programs/shapesonglobe.js +104 -64
  148. package/util/programs/supersampletotextures.js +45 -39
  149. package/util/programs/texturetoglobe.js +98 -48
  150. package/util/shaderfunctions/geometrytransformations.js +322 -27
  151. package/util/shaderfunctions/nodata.js +7 -1
  152. package/util/shaderfunctions/noisefunctions.js +39 -9
  153. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  154. package/util/webglobe/rasteroverlay.js +35 -37
  155. package/util/webglobjectbuilders.js +55 -60
  156. package/util/webglobjectbuilders1.js +48 -49
  157. package/waveparticles/adaptor.js +6 -7
  158. package/waveparticles/index.js +2 -2
  159. package/waveparticles/plugin.js +79 -84
  160. package/wind/imagetovectorfieldandmagnitude.js +15 -15
  161. package/wind/index.js +4 -4
  162. package/wind/plugin.js +453 -251
  163. package/wind/vectorfieldimage.js +5 -5
  164. package/write-text/attached-text-writer.js +46 -48
  165. package/write-text/context-text.js +51 -58
  166. package/write-text/context-text3.js +69 -74
@@ -37,11 +37,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.IsobarRasterToVector = void 0;
40
- var util_1 = require("../../util");
41
- var quadtreecontours_1 = __importStar(require("./quadtreecontours"));
42
- var objectarraylabels_1 = __importDefault(require("./objectarraylabels"));
43
- var typecheck_1 = require("../../util/check/typecheck");
44
- var IsobarRasterToVector = /** @class */ (function () {
40
+ const util_1 = require("../../util");
41
+ const quadtreecontours_1 = __importStar(require("./quadtreecontours"));
42
+ const objectarraylabels_1 = __importDefault(require("./objectarraylabels"));
43
+ const typecheck_1 = require("../../util/check/typecheck");
44
+ class IsobarRasterToVector {
45
45
  /**
46
46
  * @typedef {Object} IsobarData
47
47
  * @property {number} threshold
@@ -59,9 +59,7 @@ var IsobarRasterToVector = /** @class */ (function () {
59
59
  * @param {boolean} options.isLabelsOn
60
60
  * @param {Object} options.labelStyle
61
61
  */
62
- function IsobarRasterToVector(id, dataManager, isobars, width, height, _a, _b) {
63
- var _c = _a === void 0 ? [-180, -90, 180, 90] : _a, minLon = _c[0], minLat = _c[1], maxLon = _c[2], maxLat = _c[3];
64
- var _d = _b === void 0 ? {} : _b, _e = _d.xFlip, xFlip = _e === void 0 ? false : _e, _f = _d.yFlip, yFlip = _f === void 0 ? true : _f, _g = _d.isOn, isOn = _g === void 0 ? true : _g, _h = _d.isLabelsOn, isLabelsOn = _h === void 0 ? true : _h, _j = _d.labelStyle, labelStyle = _j === void 0 ? null : _j, _k = _d.maxMipmapLevel, maxMipmapLevel = _k === void 0 ? null : _k;
62
+ constructor(id, dataManager, isobars, width, height, [minLon, minLat, maxLon, maxLat] = [-180, -90, 180, 90], { xFlip = false, yFlip = true, isOn = true, isLabelsOn = true, labelStyle = null, maxMipmapLevel = null } = {}) {
65
63
  this.id = id;
66
64
  this._isobarsCheckAndComplete(isobars);
67
65
  this.isobars = isobars;
@@ -84,8 +82,7 @@ var IsobarRasterToVector = /** @class */ (function () {
84
82
  // this._transformationMethod = null;
85
83
  }
86
84
  // API
87
- IsobarRasterToVector.prototype.setData = function (data, on) {
88
- if (on === void 0) { on = false; }
85
+ setData(data, on = false) {
89
86
  if (!data)
90
87
  return;
91
88
  this._data = data;
@@ -93,42 +90,41 @@ var IsobarRasterToVector = /** @class */ (function () {
93
90
  this._isOn = true;
94
91
  if (this._isOn)
95
92
  this._calculateAll(data);
96
- };
97
- IsobarRasterToVector.prototype.on = function () {
93
+ }
94
+ on() {
98
95
  this._isOn = true;
99
96
  if (this._data)
100
97
  this._calculateAll(this._data);
101
- };
102
- IsobarRasterToVector.prototype.off = function () {
98
+ }
99
+ off() {
103
100
  this._isOn = false;
104
101
  this.clean();
105
- };
106
- IsobarRasterToVector.prototype.clean = function () {
102
+ }
103
+ clean() {
107
104
  this.flush();
108
105
  this.globe.DrawRender();
109
- };
110
- IsobarRasterToVector.prototype.setFlip = function (xFlip, yFlip) {
106
+ }
107
+ setFlip(xFlip, yFlip) {
111
108
  (0, typecheck_1.isBoolean)(xFlip);
112
109
  (0, typecheck_1.isBoolean)(yFlip);
113
110
  if (this.xFlip === xFlip && this.yFlip === yFlip)
114
111
  return;
115
112
  this.xFlip = xFlip;
116
113
  this.yFlip = yFlip;
117
- var _a = this.bbox, minLon = _a[0], minLat = _a[1], maxLon = _a[2], maxLat = _a[3];
118
- var _b = this, width = _b.width, height = _b.height;
114
+ const [minLon, minLat, maxLon, maxLat] = this.bbox;
115
+ const { width, height } = this;
119
116
  this._transformationMethod = getTransformationMethod(xFlip, yFlip, width, height, minLon, minLat, maxLon, maxLat);
120
117
  this._calculateLines();
121
118
  this.globe.DrawRender();
122
- };
123
- IsobarRasterToVector.prototype.setBoundingBox = function (_a) {
124
- var minLon = _a[0], minLat = _a[1], maxLon = _a[2], maxLat = _a[3];
119
+ }
120
+ setBoundingBox([minLon, minLat, maxLon, maxLat]) {
125
121
  this.bbox = [minLon, minLat, maxLon, maxLat];
126
- var _b = this, width = _b.width, height = _b.height, xFlip = _b.xFlip, yFlip = _b.yFlip;
122
+ const { width, height, xFlip, yFlip } = this;
127
123
  this._transformationMethod = getTransformationMethod(xFlip, yFlip, width, height, minLon, minLat, maxLon, maxLat);
128
124
  this._calculateLines();
129
125
  this.globe.DrawRender();
130
- };
131
- IsobarRasterToVector.prototype.setIsLabelsOn = function (isLabelsOn) {
126
+ }
127
+ setIsLabelsOn(isLabelsOn) {
132
128
  (0, typecheck_1.isBoolean)(isLabelsOn);
133
129
  if (this._isLabelsOn === isLabelsOn)
134
130
  return;
@@ -142,58 +138,56 @@ var IsobarRasterToVector = /** @class */ (function () {
142
138
  this._labelsLayer.addToMap();
143
139
  this._createBufferData();
144
140
  }
145
- };
146
- IsobarRasterToVector.prototype.getIsobars = function () {
141
+ }
142
+ getIsobars() {
147
143
  return this.isobars;
148
- };
149
- IsobarRasterToVector.prototype.setIsobars = function (isobars) {
144
+ }
145
+ setIsobars(isobars) {
150
146
  this._isobarsCheckAndComplete(isobars);
151
147
  this.isobars = isobars;
152
148
  this._calculateLines();
153
149
  this.globe.DrawRender();
154
- };
155
- IsobarRasterToVector.prototype.setWidthHeight = function (width, height) {
150
+ }
151
+ setWidthHeight(width, height) {
156
152
  this.width = width;
157
153
  this.height = height;
158
- var _a = this, xFlip = _a.xFlip, yFlip = _a.yFlip;
159
- var _b = this.bbox, minLon = _b[0], minLat = _b[1], maxLon = _b[2], maxLat = _b[3];
154
+ const { xFlip, yFlip } = this;
155
+ const [minLon, minLat, maxLon, maxLat] = this.bbox;
160
156
  this._transformationMethod = getTransformationMethod(xFlip, yFlip, width, height, minLon, minLat, maxLon, maxLat);
161
157
  this._calculateLines();
162
158
  this.globe.DrawRender();
163
- };
164
- IsobarRasterToVector.prototype.getLabelStyle = function () {
159
+ }
160
+ getLabelStyle() {
165
161
  return this._labelsLayer.getLabelStyle();
166
- };
167
- IsobarRasterToVector.prototype.setOpacity = function (opacity) {
162
+ }
163
+ setOpacity(opacity) {
168
164
  (0, typecheck_1.opacityCheck)(opacity);
169
165
  this.program.setOpacity(opacity);
170
- };
171
- IsobarRasterToVector.prototype.setLabelStyle = function (style) {
166
+ }
167
+ setLabelStyle(style) {
172
168
  this._labelStyle = style;
173
169
  if (this._labelsLayer)
174
170
  this._labelsLayer.setLabelStyle(style);
175
- var lastState = this._isLabelsOn;
171
+ const lastState = this._isLabelsOn;
176
172
  this.setIsLabelsOn(false);
177
173
  this.setIsLabelsOn(lastState);
178
174
  if (lastState)
179
175
  this._createBufferData();
180
- };
181
- IsobarRasterToVector.prototype.setMaxMipmapLevel = function (maxMipmapLevel) {
182
- if (maxMipmapLevel === void 0) { maxMipmapLevel = null; }
176
+ }
177
+ setMaxMipmapLevel(maxMipmapLevel = null) {
183
178
  this._maxMipmapLevel = maxMipmapLevel;
184
179
  this._calculateLines();
185
180
  this.globe.DrawRender();
186
- };
187
- IsobarRasterToVector.prototype.flush = function () {
181
+ }
182
+ flush() {
188
183
  this.program.setBufferData(new Float32Array(0));
189
184
  this._lineStrignRanges = [];
190
185
  if (this._isLabelsOn)
191
186
  this._labelsLayer.flush();
192
- };
187
+ }
193
188
  //
194
189
  // implicit methods
195
- IsobarRasterToVector.prototype.init = function (globe, gl) {
196
- var _this = this;
190
+ init(globe, gl) {
197
191
  this.gl = gl;
198
192
  this.globe = globe;
199
193
  this.program = new util_1.ShapesOnGlobeProgram(gl, globe, 'line_strip');
@@ -201,67 +195,62 @@ var IsobarRasterToVector = /** @class */ (function () {
201
195
  this._createLabelsLayer();
202
196
  this._labelsLayer.addToMap();
203
197
  }
204
- this.dataManager.register(this.id, function (ratio, t1, t2) {
198
+ this.dataManager.register(this.id, (ratio, t1, t2) => {
205
199
  if (!t1 || !t2) {
206
- _this.clean();
200
+ this.clean();
207
201
  return;
208
202
  }
209
- var data = dataMixer(t1, t2, ratio);
210
- if (_this._isOn)
211
- _this.setData(data);
203
+ const data = dataMixer(t1, t2, ratio);
204
+ if (this._isOn)
205
+ this.setData(data);
212
206
  });
213
- };
214
- IsobarRasterToVector.prototype.resize = function (width, height) {
207
+ }
208
+ resize(width, height) {
215
209
  this.program.resize(width, height);
216
- };
217
- IsobarRasterToVector.prototype.draw3D = function (projMatrix, modelviewMatrix, transPos) {
210
+ }
211
+ draw3D(projMatrix, modelviewMatrix, transPos) {
218
212
  if (!this._ready)
219
213
  return;
220
214
  this._drawContour(projMatrix, modelviewMatrix, transPos);
221
- };
222
- IsobarRasterToVector.prototype._calculateLines = function () {
215
+ }
216
+ _calculateLines() {
223
217
  this._calculateContours();
224
218
  this._bufferData = this._createBufferData();
225
219
  this.program.setBufferData(this._bufferData);
226
- };
227
- IsobarRasterToVector.prototype._drawContour = function (projMatrix, modelviewMatrix, transPos) {
220
+ }
221
+ _drawContour(projMatrix, modelviewMatrix, transPos) {
228
222
  this.program.draw(projMatrix, modelviewMatrix, transPos, this._lineStrignRanges);
229
- };
230
- IsobarRasterToVector.prototype._calculateIntersections = function (threshold) {
231
- var _transformationMethod = this._transformationMethod;
232
- var lines = this.contourMipmap.contour([threshold], { maxMipmapLevel: this._maxMipmapLevel }).map(function (coords) {
233
- return coords.map(function (_a) {
234
- var x = _a[0], y = _a[1];
235
- return _transformationMethod(x, y);
236
- });
223
+ }
224
+ _calculateIntersections(threshold) {
225
+ const { _transformationMethod } = this;
226
+ const lines = this.contourMipmap.contour([threshold], { maxMipmapLevel: this._maxMipmapLevel }).map(coords => {
227
+ return coords.map(([x, y]) => _transformationMethod(x, y));
237
228
  });
238
229
  return lines;
239
- };
240
- IsobarRasterToVector.prototype._calculateAll = function (data) {
230
+ }
231
+ _calculateAll(data) {
241
232
  this.contourMipmap = new quadtreecontours_1.default(data, this.width, this.height);
242
233
  this._calculateContours();
243
234
  this._bufferData = this._createBufferData();
244
235
  this.program.setBufferData(this._bufferData);
245
236
  this.globe.DrawRender();
246
237
  this._ready = true;
247
- };
248
- IsobarRasterToVector.prototype._calculateContours = function () {
249
- var isobars = this.isobars;
250
- for (var _i = 0, isobars_1 = isobars; _i < isobars_1.length; _i++) {
251
- var isobar = isobars_1[_i];
252
- var threshold = isobar.threshold;
253
- var lines = this._calculateIntersections(threshold);
238
+ }
239
+ _calculateContours() {
240
+ const { isobars } = this;
241
+ for (const isobar of isobars) {
242
+ const { threshold } = isobar;
243
+ const lines = this._calculateIntersections(threshold);
254
244
  isobar.lines = lines;
255
245
  }
256
- };
257
- IsobarRasterToVector.prototype._isobarsCheckAndComplete = function (isobars) {
246
+ }
247
+ _isobarsCheckAndComplete(isobars) {
258
248
  window.isobars = isobars;
259
249
  if (!Array.isArray(isobars))
260
250
  throw new Error("isobars must be an array");
261
251
  if (isobars.length === 0)
262
252
  throw new Error("isobars must contain at least one element");
263
- for (var _i = 0, isobars_2 = isobars; _i < isobars_2.length; _i++) {
264
- var isobar = isobars_2[_i];
253
+ for (const isobar of isobars) {
265
254
  if (!isobar || typeof isobar !== 'object')
266
255
  throw new Error("isobar must be an object");
267
256
  if (typeof isobar.threshold !== 'number')
@@ -269,8 +258,7 @@ var IsobarRasterToVector = /** @class */ (function () {
269
258
  if (isobar.color) {
270
259
  if (!Array.isArray(isobar.color) || isobar.color.length !== 3)
271
260
  throw new Error("isobar.color must be an array with 3 elements");
272
- for (var _a = 0, _b = isobar.color; _a < _b.length; _a++) {
273
- var color = _b[_a];
261
+ for (const color of isobar.color) {
274
262
  if (color < 0 || color > 1)
275
263
  throw new Error("isobar.color elements must be between 0 and 1");
276
264
  }
@@ -278,33 +266,27 @@ var IsobarRasterToVector = /** @class */ (function () {
278
266
  if (!isobar.color)
279
267
  isobar.color = [1, 1, 1];
280
268
  }
281
- };
282
- IsobarRasterToVector.prototype._createBufferData = function () {
283
- var isobars = this.isobars;
284
- var pointCount = isobars.reduce(function (acc, _a) {
285
- var lines = _a.lines;
286
- return acc + lines.reduce(function (acc, line) { return acc + line.length; }, 0);
287
- }, 0);
288
- var bufferData = new Float32Array(pointCount * 6);
289
- var index = 0;
290
- var pointCounter = 0;
269
+ }
270
+ _createBufferData() {
271
+ const { isobars } = this;
272
+ const pointCount = isobars.reduce((acc, { lines }) => acc + lines.reduce((acc, line) => acc + line.length, 0), 0);
273
+ const bufferData = new Float32Array(pointCount * 6);
274
+ let index = 0;
275
+ let pointCounter = 0;
291
276
  this._lineStrignRanges = [];
292
277
  // gather label data label
293
- var labelPoints = {
278
+ const labelPoints = {
294
279
  coords: [],
295
280
  coordsZ: [],
296
281
  attribs: []
297
282
  };
298
- var coords = labelPoints.coords, coordsZ = labelPoints.coordsZ, attribs = labelPoints.attribs;
299
- var fidCounter = 0;
300
- for (var _i = 0, isobars_3 = isobars; _i < isobars_3.length; _i++) {
301
- var _a = isobars_3[_i], lines = _a.lines, color = _a.color, threshold = _a.threshold;
302
- for (var _b = 0, lines_1 = lines; _b < lines_1.length; _b++) {
303
- var line = lines_1[_b];
304
- var startIndex = pointCounter;
305
- for (var _c = 0, line_1 = line; _c < line_1.length; _c++) {
306
- var _d = line_1[_c], x = _d[0], y = _d[1];
307
- var pixXY = (0, util_1.latLongToPixelXY)(y, x);
283
+ const { coords, coordsZ, attribs } = labelPoints;
284
+ let fidCounter = 0;
285
+ for (const { lines, color, threshold } of isobars) {
286
+ for (const line of lines) {
287
+ let startIndex = pointCounter;
288
+ for (const [x, y] of line) {
289
+ const pixXY = (0, util_1.latLongToPixelXY)(y, x);
308
290
  bufferData[index++] = pixXY.x;
309
291
  bufferData[index++] = pixXY.y;
310
292
  bufferData[index++] = color[0];
@@ -322,40 +304,39 @@ var IsobarRasterToVector = /** @class */ (function () {
322
304
  if (this._isLabelsOn)
323
305
  this._labelsLayer.setData(labelPoints);
324
306
  return bufferData;
325
- };
326
- IsobarRasterToVector.prototype._createLabelsLayer = function () {
307
+ }
308
+ _createLabelsLayer() {
327
309
  this._labelsLayer = new objectarraylabels_1.default(this._labelsLayerId, this.globe, this._labelStyle);
328
- };
329
- IsobarRasterToVector.prototype.setGeometry = function () {
310
+ }
311
+ setGeometry() {
330
312
  this.program.setGeometry();
331
- };
332
- IsobarRasterToVector.prototype.free = function () {
313
+ }
314
+ free() {
333
315
  this.flush();
334
316
  this.program.free();
335
317
  if (this._isLabelsOn)
336
318
  this._labelsLayer.removeFromMap();
337
319
  this.dataManager.unregister(this.id);
338
- };
339
- return IsobarRasterToVector;
340
- }());
320
+ }
321
+ }
341
322
  exports.IsobarRasterToVector = IsobarRasterToVector;
342
- var getTransformationMethod = function (xFlip, yFlip, width, height, minX, minY, maxX, maxY) {
343
- var _a = (0, quadtreecontours_1.scaleParameters)(minX, minY, maxX, maxY, width, height), scaleX = _a.scaleX, scaleY = _a.scaleY;
323
+ const getTransformationMethod = (xFlip, yFlip, width, height, minX, minY, maxX, maxY) => {
324
+ const { scaleX, scaleY } = (0, quadtreecontours_1.scaleParameters)(minX, minY, maxX, maxY, width, height);
344
325
  if (xFlip && yFlip)
345
- return function (x, y) { return [maxX - x * scaleX, maxY - y * scaleY]; };
326
+ return (x, y) => [maxX - x * scaleX, maxY - y * scaleY];
346
327
  if (xFlip && !yFlip)
347
- return function (x, y) { return [maxX - x * scaleX, minY + y * scaleY]; };
328
+ return (x, y) => [maxX - x * scaleX, minY + y * scaleY];
348
329
  if (!xFlip && yFlip)
349
- return function (x, y) { return [minX + x * scaleX, maxY - y * scaleY]; };
350
- return function (x, y) { return [minX + x * scaleX, minY + y * scaleY]; };
330
+ return (x, y) => [minX + x * scaleX, maxY - y * scaleY];
331
+ return (x, y) => [minX + x * scaleX, minY + y * scaleY];
351
332
  };
352
333
  function dataMixer(data1, data2, ratio) {
353
334
  if (!data1 || !data2)
354
335
  return null;
355
336
  if (data1.length !== data2.length)
356
337
  throw new Error("Data length mismatch");
357
- var data = new Float32Array(data1.length);
358
- for (var i = 0; i < data1.length; i++) {
338
+ const data = new Float32Array(data1.length);
339
+ for (let i = 0; i < data1.length; i++) {
359
340
  data[i] = data1[i] * (1 - ratio) + data2[i] * ratio;
360
341
  }
361
342
  return data;