@pirireis/webglobeplugins 0.9.10 → 0.9.11

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