@gmgis/gm-sdk 1.12.5 → 2.0.2

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 (159) hide show
  1. package/dist/dist/index.js +1848 -0
  2. package/dist/gm.min.js +16983 -16483
  3. package/dist/index.js +1436 -1434
  4. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  5. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  8. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  9. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  10. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  11. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  12. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  13. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  14. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  15. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  16. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  17. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  18. package/dist/resources/Workers/{chunk-I2ITFFPX.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-PRGYLLJT.js → chunk-ARG42DC4.js} +2 -31
  21. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  22. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  23. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  24. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  25. package/dist/resources/Workers/{chunk-DI5NGJUP.js → chunk-D6AA5QVT.js} +2 -20
  26. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  27. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  28. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  29. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  30. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  31. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  32. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  33. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  34. package/dist/resources/Workers/{chunk-7JO7GPJN.js → chunk-GBYLG25F.js} +2 -15
  35. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  36. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  37. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  38. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  39. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  40. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  41. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  42. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  43. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  44. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  45. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  46. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  47. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  48. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  49. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  50. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  51. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  52. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  53. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  54. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  55. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  56. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  57. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  58. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  59. package/dist/resources/Workers/{chunk-6CHGCNMW.js → chunk-WZDE3RYP.js} +4 -34
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -40
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -32
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -209
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -175
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -121
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -481
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -199
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1237
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -542
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -34
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -205
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -45
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -38
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -33
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -35
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -32
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -210
  78. package/dist/resources/Workers/createGeometry.js +2 -144
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1582
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -198
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -98
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1381
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -509
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -470
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -354
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -251
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1246
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -453
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -374
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -92
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -92
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -466
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -361
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -359
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -236
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -539
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2252
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -729
  101. package/dist/resources/Workers/createWallGeometry.js +2 -464
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -312
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2642
  105. package/dist/resources/Workers/decodeI3S.js +2 -1319
  106. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  108. package/dist/resources/Workers/transcodeKTX2.js +29 -3360
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -793
  111. package/package.json +74 -74
  112. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  113. package/dist/resources/Workers/chunk-26GA3JAM.js +0 -139
  114. package/dist/resources/Workers/chunk-27HUZ7SA.js +0 -305
  115. package/dist/resources/Workers/chunk-2ZGOQXYU.js +0 -171
  116. package/dist/resources/Workers/chunk-3Q2L65QU.js +0 -1258
  117. package/dist/resources/Workers/chunk-472HQ3EH.js +0 -100
  118. package/dist/resources/Workers/chunk-5ODQSF26.js +0 -101
  119. package/dist/resources/Workers/chunk-5OOFQLKF.js +0 -634
  120. package/dist/resources/Workers/chunk-5PTXS2GO.js +0 -10390
  121. package/dist/resources/Workers/chunk-76BYBWHP.js +0 -122
  122. package/dist/resources/Workers/chunk-7BMOHCPM.js +0 -390
  123. package/dist/resources/Workers/chunk-7KTQP4VB.js +0 -59
  124. package/dist/resources/Workers/chunk-7O373FFS.js +0 -665
  125. package/dist/resources/Workers/chunk-AD63PIY6.js +0 -163
  126. package/dist/resources/Workers/chunk-BHQJ2NT7.js +0 -353
  127. package/dist/resources/Workers/chunk-C6YYBQXW.js +0 -102
  128. package/dist/resources/Workers/chunk-CKY7HOHV.js +0 -287
  129. package/dist/resources/Workers/chunk-DHYHSFFJ.js +0 -73
  130. package/dist/resources/Workers/chunk-E27BLMDD.js +0 -115
  131. package/dist/resources/Workers/chunk-E63IIM5T.js +0 -75
  132. package/dist/resources/Workers/chunk-E6V6SQZW.js +0 -456
  133. package/dist/resources/Workers/chunk-EJZTDTUH.js +0 -138
  134. package/dist/resources/Workers/chunk-FDOV2LBJ.js +0 -220
  135. package/dist/resources/Workers/chunk-FIGIZHAQ.js +0 -684
  136. package/dist/resources/Workers/chunk-GESF4OXQ.js +0 -1800
  137. package/dist/resources/Workers/chunk-GGZJN2TI.js +0 -2717
  138. package/dist/resources/Workers/chunk-GNBFYG7F.js +0 -1481
  139. package/dist/resources/Workers/chunk-GWCFU2SA.js +0 -300
  140. package/dist/resources/Workers/chunk-IBLIYJZR.js +0 -196
  141. package/dist/resources/Workers/chunk-JW4FOI6M.js +0 -476
  142. package/dist/resources/Workers/chunk-K4GQUNB5.js +0 -262
  143. package/dist/resources/Workers/chunk-M3GMB5OP.js +0 -834
  144. package/dist/resources/Workers/chunk-MXIZJAPH.js +0 -629
  145. package/dist/resources/Workers/chunk-N5KJGGCM.js +0 -1073
  146. package/dist/resources/Workers/chunk-NGPPMXRM.js +0 -435
  147. package/dist/resources/Workers/chunk-O3E4OAOE.js +0 -511
  148. package/dist/resources/Workers/chunk-PGRPDNHG.js +0 -1048
  149. package/dist/resources/Workers/chunk-S6MRMMQU.js +0 -157
  150. package/dist/resources/Workers/chunk-SMDOP47J.js +0 -945
  151. package/dist/resources/Workers/chunk-TGONEMZO.js +0 -421
  152. package/dist/resources/Workers/chunk-TKVT5GQM.js +0 -781
  153. package/dist/resources/Workers/chunk-U72QNFOJ.js +0 -758
  154. package/dist/resources/Workers/chunk-VJZB3WAV.js +0 -963
  155. package/dist/resources/Workers/chunk-VU2MNO7L.js +0 -239
  156. package/dist/resources/Workers/chunk-XY4BATBS.js +0 -500
  157. package/dist/resources/Workers/chunk-YFXQECWV.js +0 -2857
  158. package/dist/resources/Workers/chunk-YSGTGQQO.js +0 -398
  159. package/dist/resources/Workers/chunk-YZ733KKS.js +0 -368
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,361 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- Color_default
28
- } from "./chunk-5OOFQLKF.js";
29
- import {
30
- createTaskProcessorWorker_default
31
- } from "./chunk-5ODQSF26.js";
32
- import {
33
- OrientedBoundingBox_default
34
- } from "./chunk-M3GMB5OP.js";
35
- import {
36
- AttributeCompression_default
37
- } from "./chunk-NGPPMXRM.js";
38
- import "./chunk-CKY7HOHV.js";
39
- import "./chunk-S6MRMMQU.js";
40
- import "./chunk-3Q2L65QU.js";
41
- import "./chunk-2ZGOQXYU.js";
42
- import {
43
- IndexDatatype_default
44
- } from "./chunk-26GA3JAM.js";
45
- import "./chunk-VJZB3WAV.js";
46
- import {
47
- Rectangle_default
48
- } from "./chunk-5PTXS2GO.js";
49
- import "./chunk-K4GQUNB5.js";
50
- import {
51
- Cartesian3_default,
52
- Cartographic_default,
53
- Ellipsoid_default
54
- } from "./chunk-YFXQECWV.js";
55
- import {
56
- Math_default
57
- } from "./chunk-XY4BATBS.js";
58
- import "./chunk-MXIZJAPH.js";
59
- import "./chunk-6CHGCNMW.js";
60
- import "./chunk-7JO7GPJN.js";
61
- import "./chunk-AD63PIY6.js";
62
- import {
63
- defined_default
64
- } from "./chunk-E63IIM5T.js";
65
-
66
- // packages/engine/Source/Workers/createVectorTilePolygons.js
67
- var scratchCenter = new Cartesian3_default();
68
- var scratchEllipsoid = new Ellipsoid_default();
69
- var scratchRectangle = new Rectangle_default();
70
- var scratchScalars = {
71
- min: void 0,
72
- max: void 0,
73
- indexBytesPerElement: void 0
74
- };
75
- function unpackBuffer(buffer) {
76
- const packedBuffer = new Float64Array(buffer);
77
- let offset = 0;
78
- scratchScalars.indexBytesPerElement = packedBuffer[offset++];
79
- scratchScalars.min = packedBuffer[offset++];
80
- scratchScalars.max = packedBuffer[offset++];
81
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
82
- offset += Cartesian3_default.packedLength;
83
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
84
- offset += Ellipsoid_default.packedLength;
85
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
86
- }
87
- function packedBatchedIndicesLength(batchedIndices) {
88
- const length = batchedIndices.length;
89
- let count = 0;
90
- for (let i = 0; i < length; ++i) {
91
- count += Color_default.packedLength + 3 + batchedIndices[i].batchIds.length;
92
- }
93
- return count;
94
- }
95
- function packBuffer(indexDatatype, boundingVolumes, batchedIndices) {
96
- const numBVs = boundingVolumes.length;
97
- const length = 1 + 1 + numBVs * OrientedBoundingBox_default.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
98
- const packedBuffer = new Float64Array(length);
99
- let offset = 0;
100
- packedBuffer[offset++] = indexDatatype;
101
- packedBuffer[offset++] = numBVs;
102
- for (let i = 0; i < numBVs; ++i) {
103
- OrientedBoundingBox_default.pack(boundingVolumes[i], packedBuffer, offset);
104
- offset += OrientedBoundingBox_default.packedLength;
105
- }
106
- const indicesLength = batchedIndices.length;
107
- packedBuffer[offset++] = indicesLength;
108
- for (let j = 0; j < indicesLength; ++j) {
109
- const batchedIndex = batchedIndices[j];
110
- Color_default.pack(batchedIndex.color, packedBuffer, offset);
111
- offset += Color_default.packedLength;
112
- packedBuffer[offset++] = batchedIndex.offset;
113
- packedBuffer[offset++] = batchedIndex.count;
114
- const batchIds = batchedIndex.batchIds;
115
- const batchIdsLength = batchIds.length;
116
- packedBuffer[offset++] = batchIdsLength;
117
- for (let k = 0; k < batchIdsLength; ++k) {
118
- packedBuffer[offset++] = batchIds[k];
119
- }
120
- }
121
- return packedBuffer;
122
- }
123
- var maxShort = 32767;
124
- var scratchEncodedPosition = new Cartesian3_default();
125
- var scratchNormal = new Cartesian3_default();
126
- var scratchScaledNormal = new Cartesian3_default();
127
- var scratchMinHeightPosition = new Cartesian3_default();
128
- var scratchMaxHeightPosition = new Cartesian3_default();
129
- var scratchBVCartographic = new Cartographic_default();
130
- var scratchBVRectangle = new Rectangle_default();
131
- function createVectorTilePolygons(parameters, transferableObjects) {
132
- unpackBuffer(parameters.packedBuffer);
133
- let indices;
134
- const indexBytesPerElement = scratchScalars.indexBytesPerElement;
135
- if (indexBytesPerElement === 2) {
136
- indices = new Uint16Array(parameters.indices);
137
- } else {
138
- indices = new Uint32Array(parameters.indices);
139
- }
140
- const positions = new Uint16Array(parameters.positions);
141
- const counts = new Uint32Array(parameters.counts);
142
- const indexCounts = new Uint32Array(parameters.indexCounts);
143
- const batchIds = new Uint32Array(parameters.batchIds);
144
- const batchTableColors = new Uint32Array(parameters.batchTableColors);
145
- const boundingVolumes = new Array(counts.length);
146
- const center = scratchCenter;
147
- const ellipsoid = scratchEllipsoid;
148
- let rectangle = scratchRectangle;
149
- const minHeight = scratchScalars.min;
150
- const maxHeight = scratchScalars.max;
151
- let minimumHeights = parameters.minimumHeights;
152
- let maximumHeights = parameters.maximumHeights;
153
- if (defined_default(minimumHeights) && defined_default(maximumHeights)) {
154
- minimumHeights = new Float32Array(minimumHeights);
155
- maximumHeights = new Float32Array(maximumHeights);
156
- }
157
- let i;
158
- let j;
159
- let rgba;
160
- const positionsLength = positions.length / 2;
161
- const uBuffer = positions.subarray(0, positionsLength);
162
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
163
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer);
164
- const decodedPositions = new Float64Array(positionsLength * 3);
165
- for (i = 0; i < positionsLength; ++i) {
166
- const u = uBuffer[i];
167
- const v = vBuffer[i];
168
- const x = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
169
- const y = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
170
- const cart = Cartographic_default.fromRadians(x, y, 0, scratchBVCartographic);
171
- const decodedPosition = ellipsoid.cartographicToCartesian(
172
- cart,
173
- scratchEncodedPosition
174
- );
175
- Cartesian3_default.pack(decodedPosition, decodedPositions, i * 3);
176
- }
177
- const countsLength = counts.length;
178
- const offsets = new Array(countsLength);
179
- const indexOffsets = new Array(countsLength);
180
- let currentOffset = 0;
181
- let currentIndexOffset = 0;
182
- for (i = 0; i < countsLength; ++i) {
183
- offsets[i] = currentOffset;
184
- indexOffsets[i] = currentIndexOffset;
185
- currentOffset += counts[i];
186
- currentIndexOffset += indexCounts[i];
187
- }
188
- const batchedPositions = new Float32Array(positionsLength * 3 * 2);
189
- const batchedIds = new Uint16Array(positionsLength * 2);
190
- const batchedIndexOffsets = new Uint32Array(indexOffsets.length);
191
- const batchedIndexCounts = new Uint32Array(indexCounts.length);
192
- let batchedIndices = [];
193
- const colorToBuffers = {};
194
- for (i = 0; i < countsLength; ++i) {
195
- rgba = batchTableColors[i];
196
- if (!defined_default(colorToBuffers[rgba])) {
197
- colorToBuffers[rgba] = {
198
- positionLength: counts[i],
199
- indexLength: indexCounts[i],
200
- offset: 0,
201
- indexOffset: 0,
202
- batchIds: [i]
203
- };
204
- } else {
205
- colorToBuffers[rgba].positionLength += counts[i];
206
- colorToBuffers[rgba].indexLength += indexCounts[i];
207
- colorToBuffers[rgba].batchIds.push(i);
208
- }
209
- }
210
- let buffer;
211
- let byColorPositionOffset = 0;
212
- let byColorIndexOffset = 0;
213
- for (rgba in colorToBuffers) {
214
- if (colorToBuffers.hasOwnProperty(rgba)) {
215
- buffer = colorToBuffers[rgba];
216
- buffer.offset = byColorPositionOffset;
217
- buffer.indexOffset = byColorIndexOffset;
218
- const positionLength = buffer.positionLength * 2;
219
- const indexLength = buffer.indexLength * 2 + buffer.positionLength * 6;
220
- byColorPositionOffset += positionLength;
221
- byColorIndexOffset += indexLength;
222
- buffer.indexLength = indexLength;
223
- }
224
- }
225
- const batchedDrawCalls = [];
226
- for (rgba in colorToBuffers) {
227
- if (colorToBuffers.hasOwnProperty(rgba)) {
228
- buffer = colorToBuffers[rgba];
229
- batchedDrawCalls.push({
230
- color: Color_default.fromRgba(parseInt(rgba)),
231
- offset: buffer.indexOffset,
232
- count: buffer.indexLength,
233
- batchIds: buffer.batchIds
234
- });
235
- }
236
- }
237
- for (i = 0; i < countsLength; ++i) {
238
- rgba = batchTableColors[i];
239
- buffer = colorToBuffers[rgba];
240
- const positionOffset = buffer.offset;
241
- let positionIndex = positionOffset * 3;
242
- let batchIdIndex = positionOffset;
243
- const polygonOffset = offsets[i];
244
- const polygonCount = counts[i];
245
- const batchId = batchIds[i];
246
- let polygonMinimumHeight = minHeight;
247
- let polygonMaximumHeight = maxHeight;
248
- if (defined_default(minimumHeights) && defined_default(maximumHeights)) {
249
- polygonMinimumHeight = minimumHeights[i];
250
- polygonMaximumHeight = maximumHeights[i];
251
- }
252
- let minLat = Number.POSITIVE_INFINITY;
253
- let maxLat = Number.NEGATIVE_INFINITY;
254
- let minLon = Number.POSITIVE_INFINITY;
255
- let maxLon = Number.NEGATIVE_INFINITY;
256
- for (j = 0; j < polygonCount; ++j) {
257
- const position = Cartesian3_default.unpack(
258
- decodedPositions,
259
- polygonOffset * 3 + j * 3,
260
- scratchEncodedPosition
261
- );
262
- ellipsoid.scaleToGeodeticSurface(position, position);
263
- const carto = ellipsoid.cartesianToCartographic(
264
- position,
265
- scratchBVCartographic
266
- );
267
- const lat = carto.latitude;
268
- const lon = carto.longitude;
269
- minLat = Math.min(lat, minLat);
270
- maxLat = Math.max(lat, maxLat);
271
- minLon = Math.min(lon, minLon);
272
- maxLon = Math.max(lon, maxLon);
273
- const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
274
- let scaledNormal = Cartesian3_default.multiplyByScalar(
275
- normal,
276
- polygonMinimumHeight,
277
- scratchScaledNormal
278
- );
279
- const minHeightPosition = Cartesian3_default.add(
280
- position,
281
- scaledNormal,
282
- scratchMinHeightPosition
283
- );
284
- scaledNormal = Cartesian3_default.multiplyByScalar(
285
- normal,
286
- polygonMaximumHeight,
287
- scaledNormal
288
- );
289
- const maxHeightPosition = Cartesian3_default.add(
290
- position,
291
- scaledNormal,
292
- scratchMaxHeightPosition
293
- );
294
- Cartesian3_default.subtract(maxHeightPosition, center, maxHeightPosition);
295
- Cartesian3_default.subtract(minHeightPosition, center, minHeightPosition);
296
- Cartesian3_default.pack(maxHeightPosition, batchedPositions, positionIndex);
297
- Cartesian3_default.pack(minHeightPosition, batchedPositions, positionIndex + 3);
298
- batchedIds[batchIdIndex] = batchId;
299
- batchedIds[batchIdIndex + 1] = batchId;
300
- positionIndex += 6;
301
- batchIdIndex += 2;
302
- }
303
- rectangle = scratchBVRectangle;
304
- rectangle.west = minLon;
305
- rectangle.east = maxLon;
306
- rectangle.south = minLat;
307
- rectangle.north = maxLat;
308
- boundingVolumes[i] = OrientedBoundingBox_default.fromRectangle(
309
- rectangle,
310
- minHeight,
311
- maxHeight,
312
- ellipsoid
313
- );
314
- let indicesIndex = buffer.indexOffset;
315
- const indexOffset = indexOffsets[i];
316
- const indexCount = indexCounts[i];
317
- batchedIndexOffsets[i] = indicesIndex;
318
- for (j = 0; j < indexCount; j += 3) {
319
- const i0 = indices[indexOffset + j] - polygonOffset;
320
- const i1 = indices[indexOffset + j + 1] - polygonOffset;
321
- const i2 = indices[indexOffset + j + 2] - polygonOffset;
322
- batchedIndices[indicesIndex++] = i0 * 2 + positionOffset;
323
- batchedIndices[indicesIndex++] = i1 * 2 + positionOffset;
324
- batchedIndices[indicesIndex++] = i2 * 2 + positionOffset;
325
- batchedIndices[indicesIndex++] = i2 * 2 + 1 + positionOffset;
326
- batchedIndices[indicesIndex++] = i1 * 2 + 1 + positionOffset;
327
- batchedIndices[indicesIndex++] = i0 * 2 + 1 + positionOffset;
328
- }
329
- for (j = 0; j < polygonCount; ++j) {
330
- const v0 = j;
331
- const v1 = (j + 1) % polygonCount;
332
- batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
333
- batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
334
- batchedIndices[indicesIndex++] = v0 * 2 + positionOffset;
335
- batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
336
- batchedIndices[indicesIndex++] = v1 * 2 + 1 + positionOffset;
337
- batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
338
- }
339
- buffer.offset += polygonCount * 2;
340
- buffer.indexOffset = indicesIndex;
341
- batchedIndexCounts[i] = indicesIndex - batchedIndexOffsets[i];
342
- }
343
- batchedIndices = IndexDatatype_default.createTypedArray(
344
- batchedPositions.length / 3,
345
- batchedIndices
346
- );
347
- const batchedIndicesLength = batchedDrawCalls.length;
348
- for (let m = 0; m < batchedIndicesLength; ++m) {
349
- const tempIds = batchedDrawCalls[m].batchIds;
350
- let count = 0;
351
- const tempIdsLength = tempIds.length;
352
- for (let n = 0; n < tempIdsLength; ++n) {
353
- count += batchedIndexCounts[tempIds[n]];
354
- }
355
- batchedDrawCalls[m].count = count;
356
- }
357
- const indexDatatype = batchedIndices.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT;
358
- const packedBuffer = packBuffer(
359
- indexDatatype,
360
- boundingVolumes,
361
- batchedDrawCalls
362
- );
363
- transferableObjects.push(
364
- batchedPositions.buffer,
365
- batchedIndices.buffer,
366
- batchedIndexOffsets.buffer,
367
- batchedIndexCounts.buffer,
368
- batchedIds.buffer,
369
- packedBuffer.buffer
370
- );
371
- return {
372
- positions: batchedPositions.buffer,
373
- indices: batchedIndices.buffer,
374
- indexOffsets: batchedIndexOffsets.buffer,
375
- indexCounts: batchedIndexCounts.buffer,
376
- batchIds: batchedIds.buffer,
377
- packedBuffer: packedBuffer.buffer
378
- };
379
- }
380
- var createVectorTilePolygons_default = createTaskProcessorWorker_default(createVectorTilePolygons);
381
- export {
382
- createVectorTilePolygons_default as default
383
- };
26
+ import{a as R}from"./chunk-HMIYSTF6.js";import{a as It}from"./chunk-WZDE3RYP.js";import{a as M}from"./chunk-CNCV5UL7.js";import{a as bt}from"./chunk-DEPHB2WM.js";import"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as W}from"./chunk-OFUUQVMR.js";import"./chunk-4IW2T6GF.js";import{h as z}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as o,b as nt,d as j}from"./chunk-64RSHJUE.js";import{a as et}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import{e as A}from"./chunk-VTAIKJXX.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,238 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- createTaskProcessorWorker_default
28
- } from "./chunk-5ODQSF26.js";
29
- import {
30
- AttributeCompression_default
31
- } from "./chunk-NGPPMXRM.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-26GA3JAM.js";
35
- import {
36
- Rectangle_default,
37
- combine_default
38
- } from "./chunk-5PTXS2GO.js";
39
- import "./chunk-K4GQUNB5.js";
40
- import {
41
- Cartesian3_default,
42
- Cartographic_default,
43
- Ellipsoid_default
44
- } from "./chunk-YFXQECWV.js";
45
- import {
46
- Math_default
47
- } from "./chunk-XY4BATBS.js";
48
- import "./chunk-MXIZJAPH.js";
49
- import "./chunk-6CHGCNMW.js";
50
- import "./chunk-7JO7GPJN.js";
51
- import "./chunk-AD63PIY6.js";
52
- import "./chunk-E63IIM5T.js";
53
-
54
- // packages/engine/Source/Core/decodeVectorPolylinePositions.js
55
- var maxShort = 32767;
56
- var scratchBVCartographic = new Cartographic_default();
57
- var scratchEncodedPosition = new Cartesian3_default();
58
- function decodeVectorPolylinePositions(positions, rectangle, minimumHeight, maximumHeight, ellipsoid) {
59
- const positionsLength = positions.length / 3;
60
- const uBuffer = positions.subarray(0, positionsLength);
61
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
62
- const heightBuffer = positions.subarray(
63
- 2 * positionsLength,
64
- 3 * positionsLength
65
- );
66
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
67
- const decoded = new Float64Array(positions.length);
68
- for (let i = 0; i < positionsLength; ++i) {
69
- const u = uBuffer[i];
70
- const v = vBuffer[i];
71
- const h = heightBuffer[i];
72
- const lon = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
73
- const lat = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
74
- const alt = Math_default.lerp(minimumHeight, maximumHeight, h / maxShort);
75
- const cartographic = Cartographic_default.fromRadians(
76
- lon,
77
- lat,
78
- alt,
79
- scratchBVCartographic
80
- );
81
- const decodedPosition = ellipsoid.cartographicToCartesian(
82
- cartographic,
83
- scratchEncodedPosition
84
- );
85
- Cartesian3_default.pack(decodedPosition, decoded, i * 3);
86
- }
87
- return decoded;
88
- }
89
- var decodeVectorPolylinePositions_default = decodeVectorPolylinePositions;
90
-
91
- // packages/engine/Source/Workers/createVectorTilePolylines.js
92
- var scratchRectangle = new Rectangle_default();
93
- var scratchEllipsoid = new Ellipsoid_default();
94
- var scratchCenter = new Cartesian3_default();
95
- var scratchMinMaxHeights = {
96
- min: void 0,
97
- max: void 0
98
- };
99
- function unpackBuffer(packedBuffer) {
100
- packedBuffer = new Float64Array(packedBuffer);
101
- let offset = 0;
102
- scratchMinMaxHeights.min = packedBuffer[offset++];
103
- scratchMinMaxHeights.max = packedBuffer[offset++];
104
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
105
- offset += Rectangle_default.packedLength;
106
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
107
- offset += Ellipsoid_default.packedLength;
108
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
109
- }
110
- function getPositionOffsets(counts) {
111
- const countsLength = counts.length;
112
- const positionOffsets = new Uint32Array(countsLength + 1);
113
- let offset = 0;
114
- for (let i = 0; i < countsLength; ++i) {
115
- positionOffsets[i] = offset;
116
- offset += counts[i];
117
- }
118
- positionOffsets[countsLength] = offset;
119
- return positionOffsets;
120
- }
121
- var scratchP0 = new Cartesian3_default();
122
- var scratchP1 = new Cartesian3_default();
123
- var scratchPrev = new Cartesian3_default();
124
- var scratchCur = new Cartesian3_default();
125
- var scratchNext = new Cartesian3_default();
126
- function createVectorTilePolylines(parameters, transferableObjects) {
127
- const encodedPositions = new Uint16Array(parameters.positions);
128
- const widths = new Uint16Array(parameters.widths);
129
- const counts = new Uint32Array(parameters.counts);
130
- const batchIds = new Uint16Array(parameters.batchIds);
131
- unpackBuffer(parameters.packedBuffer);
132
- const rectangle = scratchRectangle;
133
- const ellipsoid = scratchEllipsoid;
134
- const center = scratchCenter;
135
- const minimumHeight = scratchMinMaxHeights.min;
136
- const maximumHeight = scratchMinMaxHeights.max;
137
- const positions = decodeVectorPolylinePositions_default(
138
- encodedPositions,
139
- rectangle,
140
- minimumHeight,
141
- maximumHeight,
142
- ellipsoid
143
- );
144
- const positionsLength = positions.length / 3;
145
- const size = positionsLength * 4 - 4;
146
- const curPositions = new Float32Array(size * 3);
147
- const prevPositions = new Float32Array(size * 3);
148
- const nextPositions = new Float32Array(size * 3);
149
- const expandAndWidth = new Float32Array(size * 2);
150
- const vertexBatchIds = new Uint16Array(size);
151
- let positionIndex = 0;
152
- let expandAndWidthIndex = 0;
153
- let batchIdIndex = 0;
154
- let i;
155
- let offset = 0;
156
- let length = counts.length;
157
- for (i = 0; i < length; ++i) {
158
- const count = counts[i];
159
- const width = widths[i];
160
- const batchId = batchIds[i];
161
- for (let j = 0; j < count; ++j) {
162
- let previous;
163
- if (j === 0) {
164
- const p0 = Cartesian3_default.unpack(positions, offset * 3, scratchP0);
165
- const p1 = Cartesian3_default.unpack(positions, (offset + 1) * 3, scratchP1);
166
- previous = Cartesian3_default.subtract(p0, p1, scratchPrev);
167
- Cartesian3_default.add(p0, previous, previous);
168
- } else {
169
- previous = Cartesian3_default.unpack(
170
- positions,
171
- (offset + j - 1) * 3,
172
- scratchPrev
173
- );
174
- }
175
- const current = Cartesian3_default.unpack(
176
- positions,
177
- (offset + j) * 3,
178
- scratchCur
179
- );
180
- let next;
181
- if (j === count - 1) {
182
- const p2 = Cartesian3_default.unpack(
183
- positions,
184
- (offset + count - 1) * 3,
185
- scratchP0
186
- );
187
- const p3 = Cartesian3_default.unpack(
188
- positions,
189
- (offset + count - 2) * 3,
190
- scratchP1
191
- );
192
- next = Cartesian3_default.subtract(p2, p3, scratchNext);
193
- Cartesian3_default.add(p2, next, next);
194
- } else {
195
- next = Cartesian3_default.unpack(positions, (offset + j + 1) * 3, scratchNext);
196
- }
197
- Cartesian3_default.subtract(previous, center, previous);
198
- Cartesian3_default.subtract(current, center, current);
199
- Cartesian3_default.subtract(next, center, next);
200
- const startK = j === 0 ? 2 : 0;
201
- const endK = j === count - 1 ? 2 : 4;
202
- for (let k = startK; k < endK; ++k) {
203
- Cartesian3_default.pack(current, curPositions, positionIndex);
204
- Cartesian3_default.pack(previous, prevPositions, positionIndex);
205
- Cartesian3_default.pack(next, nextPositions, positionIndex);
206
- positionIndex += 3;
207
- const direction = k - 2 < 0 ? -1 : 1;
208
- expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
209
- expandAndWidth[expandAndWidthIndex++] = direction * width;
210
- vertexBatchIds[batchIdIndex++] = batchId;
211
- }
212
- }
213
- offset += count;
214
- }
215
- const indices = IndexDatatype_default.createTypedArray(size, positionsLength * 6 - 6);
216
- let index = 0;
217
- let indicesIndex = 0;
218
- length = positionsLength - 1;
219
- for (i = 0; i < length; ++i) {
220
- indices[indicesIndex++] = index;
221
- indices[indicesIndex++] = index + 2;
222
- indices[indicesIndex++] = index + 1;
223
- indices[indicesIndex++] = index + 1;
224
- indices[indicesIndex++] = index + 2;
225
- indices[indicesIndex++] = index + 3;
226
- index += 4;
227
- }
228
- transferableObjects.push(
229
- curPositions.buffer,
230
- prevPositions.buffer,
231
- nextPositions.buffer
232
- );
233
- transferableObjects.push(
234
- expandAndWidth.buffer,
235
- vertexBatchIds.buffer,
236
- indices.buffer
237
- );
238
- let results = {
239
- indexDatatype: indices.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT,
240
- currentPositions: curPositions.buffer,
241
- previousPositions: prevPositions.buffer,
242
- nextPositions: nextPositions.buffer,
243
- expandAndWidth: expandAndWidth.buffer,
244
- batchIds: vertexBatchIds.buffer,
245
- indices: indices.buffer
246
- };
247
- if (parameters.keepDecodedPositions) {
248
- const positionOffsets = getPositionOffsets(counts);
249
- transferableObjects.push(positions.buffer, positionOffsets.buffer);
250
- results = combine_default(results, {
251
- decodedPositions: positions.buffer,
252
- decodedPositionOffsets: positionOffsets.buffer
253
- });
254
- }
255
- return results;
256
- }
257
- var createVectorTilePolylines_default = createTaskProcessorWorker_default(createVectorTilePolylines);
258
- export {
259
- createVectorTilePolylines_default as default
260
- };
26
+ import{a as K}from"./chunk-WZDE3RYP.js";import{a as G}from"./chunk-DEPHB2WM.js";import{a as S}from"./chunk-OFUUQVMR.js";import{c as B,h as R}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as t,b as _,d as L}from"./chunk-64RSHJUE.js";import{a as F}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import"./chunk-VTAIKJXX.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default};