@loaders.gl/tiles 3.3.0-alpha.1 → 3.3.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +1027 -1431
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/constants.js +2 -1
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/index.js +26 -36
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/tileset/helpers/3d-tiles-options.js +0 -1
- package/dist/es5/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/es5/tileset/helpers/bounding-volume.js +7 -26
- package/dist/es5/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/es5/tileset/helpers/frame-state.js +45 -50
- package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
- package/dist/es5/tileset/helpers/i3s-lod.js +0 -13
- package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/tiles-3d-lod.js +7 -16
- package/dist/es5/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/transform-utils.js +2 -11
- package/dist/es5/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/es5/tileset/helpers/zoom.js +6 -16
- package/dist/es5/tileset/helpers/zoom.js.map +1 -1
- package/dist/es5/tileset/tile-3d.js +111 -98
- package/dist/es5/tileset/tile-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-3d.js +130 -196
- package/dist/es5/tileset/tileset-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-cache.js +1 -14
- package/dist/es5/tileset/tileset-cache.js.map +1 -1
- package/dist/es5/tileset/traversers/{i3s-frame-counter.js → i3s-pending-tiles-register.js} +21 -16
- package/dist/es5/tileset/traversers/i3s-pending-tiles-register.js.map +1 -0
- package/dist/es5/tileset/traversers/i3s-tile-manager.js +33 -27
- package/dist/es5/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/es5/tileset/traversers/i3s-tileset-traverser.js +10 -52
- package/dist/es5/tileset/traversers/i3s-tileset-traverser.js.map +1 -1
- package/dist/es5/tileset/traversers/tileset-3d-traverser.js +0 -22
- package/dist/es5/tileset/traversers/tileset-3d-traverser.js.map +1 -1
- package/dist/es5/tileset/traversers/tileset-traverser.js +55 -78
- package/dist/es5/tileset/traversers/tileset-traverser.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list-node.js +3 -7
- package/dist/es5/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list.js +9 -17
- package/dist/es5/utils/doubly-linked-list.js.map +1 -1
- package/dist/es5/utils/managed-array.js +29 -30
- package/dist/es5/utils/managed-array.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/constants.js +3 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/esm/tileset/helpers/bounding-volume.js +4 -10
- package/dist/esm/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/esm/tileset/helpers/frame-state.js +36 -20
- package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
- package/dist/esm/tileset/helpers/i3s-lod.js +4 -4
- package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/tiles-3d-lod.js +11 -8
- package/dist/esm/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/transform-utils.js +1 -3
- package/dist/esm/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/esm/tileset/helpers/zoom.js +3 -2
- package/dist/esm/tileset/helpers/zoom.js.map +1 -1
- package/dist/esm/tileset/tile-3d.js +47 -108
- package/dist/esm/tileset/tile-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-3d.js +70 -163
- package/dist/esm/tileset/tileset-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-cache.js +2 -18
- package/dist/esm/tileset/tileset-cache.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-pending-tiles-register.js +28 -0
- package/dist/esm/tileset/traversers/i3s-pending-tiles-register.js.map +1 -0
- package/dist/esm/tileset/traversers/i3s-tile-manager.js +34 -15
- package/dist/esm/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-tileset-traverser.js +8 -22
- package/dist/esm/tileset/traversers/i3s-tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/traversers/tileset-3d-traverser.js +2 -9
- package/dist/esm/tileset/traversers/tileset-3d-traverser.js.map +1 -1
- package/dist/esm/tileset/traversers/tileset-traverser.js +20 -59
- package/dist/esm/tileset/traversers/tileset-traverser.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list-node.js +1 -4
- package/dist/esm/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list.js +2 -11
- package/dist/esm/utils/doubly-linked-list.js.map +1 -1
- package/dist/esm/utils/managed-array.js +4 -22
- package/dist/esm/utils/managed-array.js.map +1 -1
- package/dist/tileset/helpers/frame-state.d.ts +5 -8
- package/dist/tileset/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset/helpers/frame-state.js +27 -12
- package/dist/tileset/helpers/i3s-lod.d.ts.map +1 -1
- package/dist/tileset/tile-3d.d.ts +15 -4
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +15 -2
- package/dist/tileset/tileset-3d.d.ts +17 -4
- package/dist/tileset/tileset-3d.d.ts.map +1 -1
- package/dist/tileset/tileset-3d.js +47 -10
- package/dist/tileset/traversers/{i3s-frame-counter.d.ts → i3s-pending-tiles-register.d.ts} +7 -4
- package/dist/tileset/traversers/i3s-pending-tiles-register.d.ts.map +1 -0
- package/dist/tileset/traversers/{i3s-frame-counter.js → i3s-pending-tiles-register.js} +17 -8
- package/dist/tileset/traversers/i3s-tile-manager.d.ts +19 -1
- package/dist/tileset/traversers/i3s-tile-manager.d.ts.map +1 -1
- package/dist/tileset/traversers/i3s-tile-manager.js +32 -12
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts +1 -1
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/i3s-tileset-traverser.js +9 -9
- package/dist/tileset/traversers/tileset-traverser.d.ts +3 -3
- package/dist/tileset/traversers/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/tileset-traverser.js +4 -4
- package/dist/types.d.ts +30 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/tileset/helpers/frame-state.ts +47 -19
- package/src/tileset/helpers/i3s-lod.ts +3 -1
- package/src/tileset/tile-3d.ts +16 -2
- package/src/tileset/tileset-3d.ts +55 -16
- package/src/tileset/traversers/i3s-pending-tiles-register.ts +44 -0
- package/src/tileset/traversers/i3s-tile-manager.ts +47 -11
- package/src/tileset/traversers/i3s-tileset-traverser.ts +5 -5
- package/src/tileset/traversers/tileset-traverser.ts +2 -2
- package/src/types.ts +32 -0
- package/dist/es5/tileset/traversers/i3s-frame-counter.js.map +0 -1
- package/dist/esm/tileset/traversers/i3s-frame-counter.js +0 -23
- package/dist/esm/tileset/traversers/i3s-frame-counter.js.map +0 -1
- package/dist/tileset/traversers/i3s-frame-counter.d.ts.map +0 -1
- package/src/tileset/traversers/i3s-frame-counter.ts +0 -35
package/dist/dist.min.js
CHANGED
|
@@ -25,11 +25,8 @@
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
// ../../node_modules/@math.gl/core/dist/esm/lib/common.js
|
|
28
|
-
function round(value) {
|
|
29
|
-
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
30
|
-
}
|
|
31
28
|
function formatValue(value, {
|
|
32
|
-
precision = config.precision
|
|
29
|
+
precision = config.precision
|
|
33
30
|
} = {}) {
|
|
34
31
|
value = round(value);
|
|
35
32
|
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
@@ -37,19 +34,6 @@
|
|
|
37
34
|
function isArray(value) {
|
|
38
35
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
39
36
|
}
|
|
40
|
-
function duplicateArray(array) {
|
|
41
|
-
return array.clone ? array.clone() : new Array(array.length);
|
|
42
|
-
}
|
|
43
|
-
function map(value, func, result) {
|
|
44
|
-
if (isArray(value)) {
|
|
45
|
-
result = result || duplicateArray(value);
|
|
46
|
-
for (let i = 0; i < result.length && i < value.length; ++i) {
|
|
47
|
-
result[i] = func(value[i], i, result);
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
return func(value);
|
|
52
|
-
}
|
|
53
37
|
function toRadians(degrees2) {
|
|
54
38
|
return radians(degrees2);
|
|
55
39
|
}
|
|
@@ -88,7 +72,7 @@
|
|
|
88
72
|
if (b && b.equals) {
|
|
89
73
|
return b.equals(a);
|
|
90
74
|
}
|
|
91
|
-
if (
|
|
75
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
92
76
|
return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));
|
|
93
77
|
}
|
|
94
78
|
return false;
|
|
@@ -96,18 +80,36 @@
|
|
|
96
80
|
config.EPSILON = oldEpsilon;
|
|
97
81
|
}
|
|
98
82
|
}
|
|
83
|
+
function round(value) {
|
|
84
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
85
|
+
}
|
|
86
|
+
function duplicateArray(array) {
|
|
87
|
+
return array.clone ? array.clone() : new Array(array.length);
|
|
88
|
+
}
|
|
89
|
+
function map(value, func, result) {
|
|
90
|
+
if (isArray(value)) {
|
|
91
|
+
const array = value;
|
|
92
|
+
result = result || duplicateArray(array);
|
|
93
|
+
for (let i = 0; i < result.length && i < array.length; ++i) {
|
|
94
|
+
result[i] = func(value[i], i, result);
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
return func(value);
|
|
99
|
+
}
|
|
99
100
|
var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
|
|
100
101
|
var init_common = __esm({
|
|
101
102
|
"../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
|
|
102
103
|
RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
103
104
|
DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
104
|
-
config = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
config = {
|
|
106
|
+
EPSILON: 1e-12,
|
|
107
|
+
debug: false,
|
|
108
|
+
precision: 4,
|
|
109
|
+
printTypes: false,
|
|
110
|
+
printDegrees: false,
|
|
111
|
+
printRowMajor: true
|
|
112
|
+
};
|
|
111
113
|
}
|
|
112
114
|
});
|
|
113
115
|
|
|
@@ -137,24 +139,25 @@
|
|
|
137
139
|
var init_math_array = __esm({
|
|
138
140
|
"../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
|
|
139
141
|
init_common();
|
|
140
|
-
init_assert();
|
|
141
142
|
MathArray = class extends _extendableBuiltin(Array) {
|
|
142
|
-
get ELEMENTS() {
|
|
143
|
-
assert(false);
|
|
144
|
-
return 0;
|
|
145
|
-
}
|
|
146
143
|
clone() {
|
|
147
144
|
return new this.constructor().copy(this);
|
|
148
145
|
}
|
|
149
|
-
from(arrayOrObject) {
|
|
150
|
-
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
151
|
-
}
|
|
152
146
|
fromArray(array, offset = 0) {
|
|
153
147
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
154
148
|
this[i] = array[i + offset];
|
|
155
149
|
}
|
|
156
150
|
return this.check();
|
|
157
151
|
}
|
|
152
|
+
toArray(targetArray = [], offset = 0) {
|
|
153
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
154
|
+
targetArray[offset + i] = this[i];
|
|
155
|
+
}
|
|
156
|
+
return targetArray;
|
|
157
|
+
}
|
|
158
|
+
from(arrayOrObject) {
|
|
159
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
160
|
+
}
|
|
158
161
|
to(arrayOrObject) {
|
|
159
162
|
if (arrayOrObject === this) {
|
|
160
163
|
return this;
|
|
@@ -164,12 +167,6 @@
|
|
|
164
167
|
toTarget(target) {
|
|
165
168
|
return target ? this.to(target) : this;
|
|
166
169
|
}
|
|
167
|
-
toArray(array = [], offset = 0) {
|
|
168
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
169
|
-
array[offset + i] = this[i];
|
|
170
|
-
}
|
|
171
|
-
return array;
|
|
172
|
-
}
|
|
173
170
|
toFloat32Array() {
|
|
174
171
|
return new Float32Array(this);
|
|
175
172
|
}
|
|
@@ -213,9 +210,7 @@
|
|
|
213
210
|
}
|
|
214
211
|
lerp(a, b, t) {
|
|
215
212
|
if (t === void 0) {
|
|
216
|
-
|
|
217
|
-
b = a;
|
|
218
|
-
a = this;
|
|
213
|
+
return this.lerp(this, a, b);
|
|
219
214
|
}
|
|
220
215
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
221
216
|
const ai = a[i];
|
|
@@ -258,14 +253,36 @@
|
|
|
258
253
|
return this.check();
|
|
259
254
|
}
|
|
260
255
|
scale(scale5) {
|
|
261
|
-
if (
|
|
262
|
-
|
|
256
|
+
if (typeof scale5 === "number") {
|
|
257
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
258
|
+
this[i] *= scale5;
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
for (let i = 0; i < this.ELEMENTS && i < scale5.length; ++i) {
|
|
262
|
+
this[i] *= scale5[i];
|
|
263
|
+
}
|
|
263
264
|
}
|
|
265
|
+
return this.check();
|
|
266
|
+
}
|
|
267
|
+
multiplyByScalar(scalar) {
|
|
264
268
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
265
|
-
this[i] *=
|
|
269
|
+
this[i] *= scalar;
|
|
266
270
|
}
|
|
267
271
|
return this.check();
|
|
268
272
|
}
|
|
273
|
+
check() {
|
|
274
|
+
if (config.debug && !this.validate()) {
|
|
275
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
276
|
+
}
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
279
|
+
validate() {
|
|
280
|
+
let valid = this.length === this.ELEMENTS;
|
|
281
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
282
|
+
valid = valid && Number.isFinite(this[i]);
|
|
283
|
+
}
|
|
284
|
+
return valid;
|
|
285
|
+
}
|
|
269
286
|
sub(a) {
|
|
270
287
|
return this.subtract(a);
|
|
271
288
|
}
|
|
@@ -291,7 +308,7 @@
|
|
|
291
308
|
return this.check();
|
|
292
309
|
}
|
|
293
310
|
divideScalar(a) {
|
|
294
|
-
return this.
|
|
311
|
+
return this.multiplyByScalar(1 / a);
|
|
295
312
|
}
|
|
296
313
|
clampScalar(min, max) {
|
|
297
314
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
@@ -299,25 +316,9 @@
|
|
|
299
316
|
}
|
|
300
317
|
return this.check();
|
|
301
318
|
}
|
|
302
|
-
multiplyByScalar(scalar) {
|
|
303
|
-
return this.scale(scalar);
|
|
304
|
-
}
|
|
305
319
|
get elements() {
|
|
306
320
|
return this;
|
|
307
321
|
}
|
|
308
|
-
check() {
|
|
309
|
-
if (config.debug && !this.validate()) {
|
|
310
|
-
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
311
|
-
}
|
|
312
|
-
return this;
|
|
313
|
-
}
|
|
314
|
-
validate() {
|
|
315
|
-
let valid = this.length === this.ELEMENTS;
|
|
316
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
317
|
-
valid = valid && Number.isFinite(this[i]);
|
|
318
|
-
}
|
|
319
|
-
return valid;
|
|
320
|
-
}
|
|
321
322
|
};
|
|
322
323
|
}
|
|
323
324
|
});
|
|
@@ -346,17 +347,9 @@
|
|
|
346
347
|
}
|
|
347
348
|
return v;
|
|
348
349
|
}
|
|
349
|
-
function deprecated(method, version) {
|
|
350
|
-
if (!map2[method]) {
|
|
351
|
-
map2[method] = true;
|
|
352
|
-
console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
var map2;
|
|
356
350
|
var init_validators = __esm({
|
|
357
351
|
"../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
|
|
358
352
|
init_common();
|
|
359
|
-
map2 = {};
|
|
360
353
|
}
|
|
361
354
|
});
|
|
362
355
|
|
|
@@ -368,14 +361,6 @@
|
|
|
368
361
|
init_validators();
|
|
369
362
|
init_assert();
|
|
370
363
|
Vector = class extends MathArray {
|
|
371
|
-
get ELEMENTS() {
|
|
372
|
-
assert(false);
|
|
373
|
-
return 0;
|
|
374
|
-
}
|
|
375
|
-
copy(vector) {
|
|
376
|
-
assert(false);
|
|
377
|
-
return this;
|
|
378
|
-
}
|
|
379
364
|
get x() {
|
|
380
365
|
return this[0];
|
|
381
366
|
}
|
|
@@ -580,6 +565,15 @@
|
|
|
580
565
|
out[2] = a[2];
|
|
581
566
|
return out;
|
|
582
567
|
}
|
|
568
|
+
function vec4_transformMat2(out, a, m) {
|
|
569
|
+
const x = a[0];
|
|
570
|
+
const y = a[1];
|
|
571
|
+
out[0] = m[0] * x + m[2] * y;
|
|
572
|
+
out[1] = m[1] * x + m[3] * y;
|
|
573
|
+
out[2] = a[2];
|
|
574
|
+
out[3] = a[3];
|
|
575
|
+
return out;
|
|
576
|
+
}
|
|
583
577
|
function vec4_transformMat3(out, a, m) {
|
|
584
578
|
const x = a[0];
|
|
585
579
|
const y = a[1];
|
|
@@ -754,7 +748,7 @@
|
|
|
754
748
|
});
|
|
755
749
|
|
|
756
750
|
// ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
|
|
757
|
-
var ORIGIN,
|
|
751
|
+
var ORIGIN, ZERO, Vector3;
|
|
758
752
|
var init_vector3 = __esm({
|
|
759
753
|
"../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
|
|
760
754
|
init_vector();
|
|
@@ -763,10 +757,13 @@
|
|
|
763
757
|
init_vec3();
|
|
764
758
|
init_gl_matrix_extras();
|
|
765
759
|
ORIGIN = [0, 0, 0];
|
|
766
|
-
constants = {};
|
|
767
760
|
Vector3 = class extends Vector {
|
|
768
761
|
static get ZERO() {
|
|
769
|
-
|
|
762
|
+
if (!ZERO) {
|
|
763
|
+
ZERO = new Vector3(0, 0, 0);
|
|
764
|
+
Object.freeze(ZERO);
|
|
765
|
+
}
|
|
766
|
+
return ZERO;
|
|
770
767
|
}
|
|
771
768
|
constructor(x = 0, y = 0, z = 0) {
|
|
772
769
|
super(-0, -0, -0);
|
|
@@ -876,6 +873,113 @@
|
|
|
876
873
|
}
|
|
877
874
|
});
|
|
878
875
|
|
|
876
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/vector4.js
|
|
877
|
+
var ZERO2, Vector4;
|
|
878
|
+
var init_vector4 = __esm({
|
|
879
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/vector4.js"() {
|
|
880
|
+
init_vector();
|
|
881
|
+
init_common();
|
|
882
|
+
init_validators();
|
|
883
|
+
init_vec3();
|
|
884
|
+
init_gl_matrix_extras();
|
|
885
|
+
Vector4 = class extends Vector {
|
|
886
|
+
static get ZERO() {
|
|
887
|
+
if (!ZERO2) {
|
|
888
|
+
ZERO2 = new Vector4(0, 0, 0, 0);
|
|
889
|
+
Object.freeze(ZERO2);
|
|
890
|
+
}
|
|
891
|
+
return ZERO2;
|
|
892
|
+
}
|
|
893
|
+
constructor(x = 0, y = 0, z = 0, w = 0) {
|
|
894
|
+
super(-0, -0, -0, -0);
|
|
895
|
+
if (isArray(x) && arguments.length === 1) {
|
|
896
|
+
this.copy(x);
|
|
897
|
+
} else {
|
|
898
|
+
if (config.debug) {
|
|
899
|
+
checkNumber(x);
|
|
900
|
+
checkNumber(y);
|
|
901
|
+
checkNumber(z);
|
|
902
|
+
checkNumber(w);
|
|
903
|
+
}
|
|
904
|
+
this[0] = x;
|
|
905
|
+
this[1] = y;
|
|
906
|
+
this[2] = z;
|
|
907
|
+
this[3] = w;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
set(x, y, z, w) {
|
|
911
|
+
this[0] = x;
|
|
912
|
+
this[1] = y;
|
|
913
|
+
this[2] = z;
|
|
914
|
+
this[3] = w;
|
|
915
|
+
return this.check();
|
|
916
|
+
}
|
|
917
|
+
copy(array) {
|
|
918
|
+
this[0] = array[0];
|
|
919
|
+
this[1] = array[1];
|
|
920
|
+
this[2] = array[2];
|
|
921
|
+
this[3] = array[3];
|
|
922
|
+
return this.check();
|
|
923
|
+
}
|
|
924
|
+
fromObject(object) {
|
|
925
|
+
if (config.debug) {
|
|
926
|
+
checkNumber(object.x);
|
|
927
|
+
checkNumber(object.y);
|
|
928
|
+
checkNumber(object.z);
|
|
929
|
+
checkNumber(object.w);
|
|
930
|
+
}
|
|
931
|
+
this[0] = object.x;
|
|
932
|
+
this[1] = object.y;
|
|
933
|
+
this[2] = object.z;
|
|
934
|
+
this[3] = object.w;
|
|
935
|
+
return this;
|
|
936
|
+
}
|
|
937
|
+
toObject(object) {
|
|
938
|
+
object.x = this[0];
|
|
939
|
+
object.y = this[1];
|
|
940
|
+
object.z = this[2];
|
|
941
|
+
object.w = this[3];
|
|
942
|
+
return object;
|
|
943
|
+
}
|
|
944
|
+
get ELEMENTS() {
|
|
945
|
+
return 4;
|
|
946
|
+
}
|
|
947
|
+
get z() {
|
|
948
|
+
return this[2];
|
|
949
|
+
}
|
|
950
|
+
set z(value) {
|
|
951
|
+
this[2] = checkNumber(value);
|
|
952
|
+
}
|
|
953
|
+
get w() {
|
|
954
|
+
return this[3];
|
|
955
|
+
}
|
|
956
|
+
set w(value) {
|
|
957
|
+
this[3] = checkNumber(value);
|
|
958
|
+
}
|
|
959
|
+
transform(matrix4) {
|
|
960
|
+
transformMat42(this, this, matrix4);
|
|
961
|
+
return this.check();
|
|
962
|
+
}
|
|
963
|
+
transformByMatrix3(matrix3) {
|
|
964
|
+
vec4_transformMat3(this, this, matrix3);
|
|
965
|
+
return this.check();
|
|
966
|
+
}
|
|
967
|
+
transformByMatrix2(matrix2) {
|
|
968
|
+
vec4_transformMat2(this, this, matrix2);
|
|
969
|
+
return this.check();
|
|
970
|
+
}
|
|
971
|
+
transformByQuaternion(quaternion) {
|
|
972
|
+
transformQuat(this, this, quaternion);
|
|
973
|
+
return this.check();
|
|
974
|
+
}
|
|
975
|
+
applyMatrix4(m) {
|
|
976
|
+
m.transform(this, this);
|
|
977
|
+
return this;
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
|
|
879
983
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
|
|
880
984
|
var Matrix;
|
|
881
985
|
var init_matrix = __esm({
|
|
@@ -883,16 +987,7 @@
|
|
|
883
987
|
init_math_array();
|
|
884
988
|
init_validators();
|
|
885
989
|
init_common();
|
|
886
|
-
init_assert();
|
|
887
990
|
Matrix = class extends MathArray {
|
|
888
|
-
get ELEMENTS() {
|
|
889
|
-
assert(false);
|
|
890
|
-
return 0;
|
|
891
|
-
}
|
|
892
|
-
get RANK() {
|
|
893
|
-
assert(false);
|
|
894
|
-
return 0;
|
|
895
|
-
}
|
|
896
991
|
toString() {
|
|
897
992
|
let string = "[";
|
|
898
993
|
if (config.printRowMajor) {
|
|
@@ -1095,7 +1190,21 @@
|
|
|
1095
1190
|
});
|
|
1096
1191
|
|
|
1097
1192
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
|
|
1098
|
-
|
|
1193
|
+
function getZeroMatrix() {
|
|
1194
|
+
if (!ZERO_MATRIX3) {
|
|
1195
|
+
ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
1196
|
+
Object.freeze(ZERO_MATRIX3);
|
|
1197
|
+
}
|
|
1198
|
+
return ZERO_MATRIX3;
|
|
1199
|
+
}
|
|
1200
|
+
function getIdentityMatrix() {
|
|
1201
|
+
if (!IDENTITY_MATRIX3) {
|
|
1202
|
+
IDENTITY_MATRIX3 = new Matrix3();
|
|
1203
|
+
Object.freeze(IDENTITY_MATRIX3);
|
|
1204
|
+
}
|
|
1205
|
+
return IDENTITY_MATRIX3;
|
|
1206
|
+
}
|
|
1207
|
+
var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
|
|
1099
1208
|
var init_matrix3 = __esm({
|
|
1100
1209
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
|
|
1101
1210
|
init_matrix();
|
|
@@ -1104,28 +1213,24 @@
|
|
|
1104
1213
|
init_mat3();
|
|
1105
1214
|
init_vec2();
|
|
1106
1215
|
init_vec3();
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
});
|
|
1120
|
-
constants2 = {};
|
|
1216
|
+
(function(INDICES3) {
|
|
1217
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
1218
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
1219
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
1220
|
+
INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
|
|
1221
|
+
INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
|
|
1222
|
+
INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
|
|
1223
|
+
INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
|
|
1224
|
+
INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
|
|
1225
|
+
INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
|
|
1226
|
+
})(INDICES || (INDICES = {}));
|
|
1227
|
+
IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
1121
1228
|
Matrix3 = class extends Matrix {
|
|
1122
1229
|
static get IDENTITY() {
|
|
1123
|
-
|
|
1124
|
-
return constants2.IDENTITY;
|
|
1230
|
+
return getIdentityMatrix();
|
|
1125
1231
|
}
|
|
1126
1232
|
static get ZERO() {
|
|
1127
|
-
|
|
1128
|
-
return constants2.ZERO;
|
|
1233
|
+
return getZeroMatrix();
|
|
1129
1234
|
}
|
|
1130
1235
|
get ELEMENTS() {
|
|
1131
1236
|
return 9;
|
|
@@ -1136,10 +1241,12 @@
|
|
|
1136
1241
|
get INDICES() {
|
|
1137
1242
|
return INDICES;
|
|
1138
1243
|
}
|
|
1139
|
-
constructor(array) {
|
|
1244
|
+
constructor(array, ...args) {
|
|
1140
1245
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
1141
1246
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
1142
1247
|
this.copy(array);
|
|
1248
|
+
} else if (args.length > 0) {
|
|
1249
|
+
this.copy([array, ...args]);
|
|
1143
1250
|
} else {
|
|
1144
1251
|
this.identity();
|
|
1145
1252
|
}
|
|
@@ -1156,6 +1263,16 @@
|
|
|
1156
1263
|
this[8] = array[8];
|
|
1157
1264
|
return this.check();
|
|
1158
1265
|
}
|
|
1266
|
+
identity() {
|
|
1267
|
+
return this.copy(IDENTITY_MATRIX);
|
|
1268
|
+
}
|
|
1269
|
+
fromObject(object) {
|
|
1270
|
+
return this.check();
|
|
1271
|
+
}
|
|
1272
|
+
fromQuaternion(q) {
|
|
1273
|
+
fromQuat(this, q);
|
|
1274
|
+
return this.check();
|
|
1275
|
+
}
|
|
1159
1276
|
set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
|
|
1160
1277
|
this[0] = m00;
|
|
1161
1278
|
this[1] = m10;
|
|
@@ -1183,13 +1300,6 @@
|
|
|
1183
1300
|
determinant() {
|
|
1184
1301
|
return determinant(this);
|
|
1185
1302
|
}
|
|
1186
|
-
identity() {
|
|
1187
|
-
return this.copy(IDENTITY);
|
|
1188
|
-
}
|
|
1189
|
-
fromQuaternion(q) {
|
|
1190
|
-
fromQuat(this, q);
|
|
1191
|
-
return this.check();
|
|
1192
|
-
}
|
|
1193
1303
|
transpose() {
|
|
1194
1304
|
transpose(this, this);
|
|
1195
1305
|
return this.check();
|
|
@@ -1214,7 +1324,7 @@
|
|
|
1214
1324
|
if (Array.isArray(factor)) {
|
|
1215
1325
|
scale(this, this, factor);
|
|
1216
1326
|
} else {
|
|
1217
|
-
scale(this, this, [factor, factor
|
|
1327
|
+
scale(this, this, [factor, factor]);
|
|
1218
1328
|
}
|
|
1219
1329
|
return this.check();
|
|
1220
1330
|
}
|
|
@@ -1223,32 +1333,30 @@
|
|
|
1223
1333
|
return this.check();
|
|
1224
1334
|
}
|
|
1225
1335
|
transform(vector, result) {
|
|
1336
|
+
let out;
|
|
1226
1337
|
switch (vector.length) {
|
|
1227
1338
|
case 2:
|
|
1228
|
-
|
|
1339
|
+
out = transformMat3(result || [-0, -0], vector, this);
|
|
1229
1340
|
break;
|
|
1230
1341
|
case 3:
|
|
1231
|
-
|
|
1342
|
+
out = transformMat32(result || [-0, -0, -0], vector, this);
|
|
1232
1343
|
break;
|
|
1233
1344
|
case 4:
|
|
1234
|
-
|
|
1345
|
+
out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
|
|
1235
1346
|
break;
|
|
1236
1347
|
default:
|
|
1237
1348
|
throw new Error("Illegal vector");
|
|
1238
1349
|
}
|
|
1239
|
-
checkVector(
|
|
1240
|
-
return
|
|
1350
|
+
checkVector(out, vector.length);
|
|
1351
|
+
return out;
|
|
1241
1352
|
}
|
|
1242
1353
|
transformVector(vector, result) {
|
|
1243
|
-
deprecated("Matrix3.transformVector");
|
|
1244
1354
|
return this.transform(vector, result);
|
|
1245
1355
|
}
|
|
1246
1356
|
transformVector2(vector, result) {
|
|
1247
|
-
deprecated("Matrix3.transformVector");
|
|
1248
1357
|
return this.transform(vector, result);
|
|
1249
1358
|
}
|
|
1250
1359
|
transformVector3(vector, result) {
|
|
1251
|
-
deprecated("Matrix3.transformVector");
|
|
1252
1360
|
return this.transform(vector, result);
|
|
1253
1361
|
}
|
|
1254
1362
|
};
|
|
@@ -1692,7 +1800,7 @@
|
|
|
1692
1800
|
out[15] = 0;
|
|
1693
1801
|
return out;
|
|
1694
1802
|
}
|
|
1695
|
-
function
|
|
1803
|
+
function perspectiveNO(out, fovy, aspect, near, far) {
|
|
1696
1804
|
var f = 1 / Math.tan(fovy / 2), nf;
|
|
1697
1805
|
out[0] = f / aspect;
|
|
1698
1806
|
out[1] = 0;
|
|
@@ -1718,7 +1826,7 @@
|
|
|
1718
1826
|
}
|
|
1719
1827
|
return out;
|
|
1720
1828
|
}
|
|
1721
|
-
function
|
|
1829
|
+
function orthoNO(out, left, right, bottom, top, near, far) {
|
|
1722
1830
|
var lr = 1 / (left - right);
|
|
1723
1831
|
var bt = 1 / (bottom - top);
|
|
1724
1832
|
var nf = 1 / (near - far);
|
|
@@ -1807,9 +1915,12 @@
|
|
|
1807
1915
|
out[15] = 1;
|
|
1808
1916
|
return out;
|
|
1809
1917
|
}
|
|
1918
|
+
var perspective, ortho;
|
|
1810
1919
|
var init_mat4 = __esm({
|
|
1811
1920
|
"../../node_modules/gl-matrix/esm/mat4.js"() {
|
|
1812
1921
|
init_common2();
|
|
1922
|
+
perspective = perspectiveNO;
|
|
1923
|
+
ortho = orthoNO;
|
|
1813
1924
|
}
|
|
1814
1925
|
});
|
|
1815
1926
|
|
|
@@ -1939,48 +2050,90 @@
|
|
|
1939
2050
|
});
|
|
1940
2051
|
|
|
1941
2052
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
|
|
1942
|
-
|
|
2053
|
+
function getZeroMatrix2() {
|
|
2054
|
+
if (!ZERO3) {
|
|
2055
|
+
ZERO3 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
2056
|
+
Object.freeze(ZERO3);
|
|
2057
|
+
}
|
|
2058
|
+
return ZERO3;
|
|
2059
|
+
}
|
|
2060
|
+
function getIdentityMatrix2() {
|
|
2061
|
+
if (!IDENTITY) {
|
|
2062
|
+
IDENTITY = new Matrix4();
|
|
2063
|
+
Object.freeze(IDENTITY);
|
|
2064
|
+
}
|
|
2065
|
+
return IDENTITY;
|
|
2066
|
+
}
|
|
2067
|
+
function checkRadians(possiblyDegrees) {
|
|
2068
|
+
if (possiblyDegrees > Math.PI * 2) {
|
|
2069
|
+
throw Error("expected radians");
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
|
|
2073
|
+
const column0Row0 = 2 * near / (right - left);
|
|
2074
|
+
const column1Row1 = 2 * near / (top - bottom);
|
|
2075
|
+
const column2Row0 = (right + left) / (right - left);
|
|
2076
|
+
const column2Row1 = (top + bottom) / (top - bottom);
|
|
2077
|
+
const column2Row2 = -1;
|
|
2078
|
+
const column2Row3 = -1;
|
|
2079
|
+
const column3Row2 = -2 * near;
|
|
2080
|
+
result[0] = column0Row0;
|
|
2081
|
+
result[1] = 0;
|
|
2082
|
+
result[2] = 0;
|
|
2083
|
+
result[3] = 0;
|
|
2084
|
+
result[4] = 0;
|
|
2085
|
+
result[5] = column1Row1;
|
|
2086
|
+
result[6] = 0;
|
|
2087
|
+
result[7] = 0;
|
|
2088
|
+
result[8] = column2Row0;
|
|
2089
|
+
result[9] = column2Row1;
|
|
2090
|
+
result[10] = column2Row2;
|
|
2091
|
+
result[11] = column2Row3;
|
|
2092
|
+
result[12] = 0;
|
|
2093
|
+
result[13] = 0;
|
|
2094
|
+
result[14] = column3Row2;
|
|
2095
|
+
result[15] = 0;
|
|
2096
|
+
return result;
|
|
2097
|
+
}
|
|
2098
|
+
var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO3, IDENTITY;
|
|
1943
2099
|
var init_matrix4 = __esm({
|
|
1944
2100
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js"() {
|
|
1945
|
-
init_validators();
|
|
1946
2101
|
init_matrix();
|
|
2102
|
+
init_validators();
|
|
1947
2103
|
init_gl_matrix_extras();
|
|
1948
2104
|
init_mat4();
|
|
1949
2105
|
init_vec2();
|
|
1950
2106
|
init_vec3();
|
|
1951
2107
|
init_vec4();
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
2108
|
+
(function(INDICES3) {
|
|
2109
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
2110
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
2111
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
2112
|
+
INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
|
|
2113
|
+
INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
|
|
2114
|
+
INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
|
|
2115
|
+
INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
|
|
2116
|
+
INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
|
|
2117
|
+
INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
|
|
2118
|
+
INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
|
|
2119
|
+
INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
|
|
2120
|
+
INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
|
|
2121
|
+
INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
|
|
2122
|
+
INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
|
|
2123
|
+
INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
|
|
2124
|
+
INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
|
|
2125
|
+
})(INDICES2 || (INDICES2 = {}));
|
|
2126
|
+
DEFAULT_FOVY = 45 * Math.PI / 180;
|
|
2127
|
+
DEFAULT_ASPECT = 1;
|
|
2128
|
+
DEFAULT_NEAR = 0.1;
|
|
2129
|
+
DEFAULT_FAR = 500;
|
|
2130
|
+
IDENTITY_MATRIX2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
1973
2131
|
Matrix4 = class extends Matrix {
|
|
1974
2132
|
static get IDENTITY() {
|
|
1975
|
-
|
|
1976
|
-
return constants3.IDENTITY;
|
|
2133
|
+
return getIdentityMatrix2();
|
|
1977
2134
|
}
|
|
1978
2135
|
static get ZERO() {
|
|
1979
|
-
|
|
1980
|
-
return constants3.ZERO;
|
|
1981
|
-
}
|
|
1982
|
-
get INDICES() {
|
|
1983
|
-
return INDICES2;
|
|
2136
|
+
return getZeroMatrix2();
|
|
1984
2137
|
}
|
|
1985
2138
|
get ELEMENTS() {
|
|
1986
2139
|
return 16;
|
|
@@ -1988,6 +2141,9 @@
|
|
|
1988
2141
|
get RANK() {
|
|
1989
2142
|
return 4;
|
|
1990
2143
|
}
|
|
2144
|
+
get INDICES() {
|
|
2145
|
+
return INDICES2;
|
|
2146
|
+
}
|
|
1991
2147
|
constructor(array) {
|
|
1992
2148
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
1993
2149
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
@@ -2073,91 +2229,65 @@
|
|
|
2073
2229
|
return result;
|
|
2074
2230
|
}
|
|
2075
2231
|
identity() {
|
|
2076
|
-
return this.copy(
|
|
2232
|
+
return this.copy(IDENTITY_MATRIX2);
|
|
2077
2233
|
}
|
|
2078
|
-
|
|
2079
|
-
fromQuat2(this, q);
|
|
2234
|
+
fromObject(object) {
|
|
2080
2235
|
return this.check();
|
|
2081
2236
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2237
|
+
fromQuaternion(quaternion) {
|
|
2238
|
+
fromQuat2(this, quaternion);
|
|
2239
|
+
return this.check();
|
|
2240
|
+
}
|
|
2241
|
+
frustum(view) {
|
|
2242
|
+
const {
|
|
2243
|
+
left,
|
|
2244
|
+
right,
|
|
2245
|
+
bottom,
|
|
2246
|
+
top,
|
|
2247
|
+
near = DEFAULT_NEAR,
|
|
2248
|
+
far = DEFAULT_FAR
|
|
2249
|
+
} = view;
|
|
2090
2250
|
if (far === Infinity) {
|
|
2091
|
-
|
|
2251
|
+
computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
|
|
2092
2252
|
} else {
|
|
2093
2253
|
frustum(this, left, right, bottom, top, near, far);
|
|
2094
2254
|
}
|
|
2095
2255
|
return this.check();
|
|
2096
2256
|
}
|
|
2097
|
-
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
const column2Row3 = -1;
|
|
2104
|
-
const column3Row2 = -2 * near;
|
|
2105
|
-
result[0] = column0Row0;
|
|
2106
|
-
result[1] = 0;
|
|
2107
|
-
result[2] = 0;
|
|
2108
|
-
result[3] = 0;
|
|
2109
|
-
result[4] = 0;
|
|
2110
|
-
result[5] = column1Row1;
|
|
2111
|
-
result[6] = 0;
|
|
2112
|
-
result[7] = 0;
|
|
2113
|
-
result[8] = column2Row0;
|
|
2114
|
-
result[9] = column2Row1;
|
|
2115
|
-
result[10] = column2Row2;
|
|
2116
|
-
result[11] = column2Row3;
|
|
2117
|
-
result[12] = 0;
|
|
2118
|
-
result[13] = 0;
|
|
2119
|
-
result[14] = column3Row2;
|
|
2120
|
-
result[15] = 0;
|
|
2121
|
-
return result;
|
|
2122
|
-
}
|
|
2123
|
-
lookAt(eye, center, up) {
|
|
2124
|
-
if (arguments.length === 1) {
|
|
2125
|
-
({
|
|
2126
|
-
eye,
|
|
2127
|
-
center,
|
|
2128
|
-
up
|
|
2129
|
-
} = eye);
|
|
2130
|
-
}
|
|
2131
|
-
center = center || [0, 0, 0];
|
|
2132
|
-
up = up || [0, 1, 0];
|
|
2257
|
+
lookAt(view) {
|
|
2258
|
+
const {
|
|
2259
|
+
eye,
|
|
2260
|
+
center = [0, 0, 0],
|
|
2261
|
+
up = [0, 1, 0]
|
|
2262
|
+
} = view;
|
|
2133
2263
|
lookAt(this, eye, center, up);
|
|
2134
2264
|
return this.check();
|
|
2135
2265
|
}
|
|
2136
|
-
ortho({
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2266
|
+
ortho(view) {
|
|
2267
|
+
const {
|
|
2268
|
+
left,
|
|
2269
|
+
right,
|
|
2270
|
+
bottom,
|
|
2271
|
+
top,
|
|
2272
|
+
near = DEFAULT_NEAR,
|
|
2273
|
+
far = DEFAULT_FAR
|
|
2274
|
+
} = view;
|
|
2144
2275
|
ortho(this, left, right, bottom, top, near, far);
|
|
2145
2276
|
return this.check();
|
|
2146
2277
|
}
|
|
2147
|
-
orthographic({
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
}
|
|
2278
|
+
orthographic(view) {
|
|
2279
|
+
const {
|
|
2280
|
+
fovy = DEFAULT_FOVY,
|
|
2281
|
+
aspect = DEFAULT_ASPECT,
|
|
2282
|
+
focalDistance = 1,
|
|
2283
|
+
near = DEFAULT_NEAR,
|
|
2284
|
+
far = DEFAULT_FAR
|
|
2285
|
+
} = view;
|
|
2286
|
+
checkRadians(fovy);
|
|
2157
2287
|
const halfY = fovy / 2;
|
|
2158
2288
|
const top = focalDistance * Math.tan(halfY);
|
|
2159
2289
|
const right = top * aspect;
|
|
2160
|
-
return
|
|
2290
|
+
return this.ortho({
|
|
2161
2291
|
left: -right,
|
|
2162
2292
|
right,
|
|
2163
2293
|
bottom: -top,
|
|
@@ -2166,17 +2296,14 @@
|
|
|
2166
2296
|
far
|
|
2167
2297
|
});
|
|
2168
2298
|
}
|
|
2169
|
-
perspective({
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
fovy
|
|
2177
|
-
if (fovy > Math.PI * 2) {
|
|
2178
|
-
throw Error("radians");
|
|
2179
|
-
}
|
|
2299
|
+
perspective(view) {
|
|
2300
|
+
const {
|
|
2301
|
+
fovy = 45 * Math.PI / 180,
|
|
2302
|
+
aspect = 1,
|
|
2303
|
+
near = 0.1,
|
|
2304
|
+
far = 500
|
|
2305
|
+
} = view;
|
|
2306
|
+
checkRadians(fovy);
|
|
2180
2307
|
perspective(this, fovy, aspect, near, far);
|
|
2181
2308
|
return this.check();
|
|
2182
2309
|
}
|
|
@@ -2195,8 +2322,10 @@
|
|
|
2195
2322
|
result[2] = this[14];
|
|
2196
2323
|
return result;
|
|
2197
2324
|
}
|
|
2198
|
-
getRotation(result
|
|
2199
|
-
|
|
2325
|
+
getRotation(result, scaleResult) {
|
|
2326
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
2327
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
2328
|
+
const scale5 = this.getScale(scaleResult);
|
|
2200
2329
|
const inverseScale0 = 1 / scale5[0];
|
|
2201
2330
|
const inverseScale1 = 1 / scale5[1];
|
|
2202
2331
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -2218,8 +2347,10 @@
|
|
|
2218
2347
|
result[15] = 1;
|
|
2219
2348
|
return result;
|
|
2220
2349
|
}
|
|
2221
|
-
getRotationMatrix3(result
|
|
2222
|
-
|
|
2350
|
+
getRotationMatrix3(result, scaleResult) {
|
|
2351
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
2352
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
2353
|
+
const scale5 = this.getScale(scaleResult);
|
|
2223
2354
|
const inverseScale0 = 1 / scale5[0];
|
|
2224
2355
|
const inverseScale1 = 1 / scale5[1];
|
|
2225
2356
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -2262,23 +2393,19 @@
|
|
|
2262
2393
|
rotateZ2(this, this, radians2);
|
|
2263
2394
|
return this.check();
|
|
2264
2395
|
}
|
|
2265
|
-
rotateXYZ(
|
|
2266
|
-
return this.rotateX(
|
|
2396
|
+
rotateXYZ(angleXYZ) {
|
|
2397
|
+
return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
|
|
2267
2398
|
}
|
|
2268
2399
|
rotateAxis(radians2, axis) {
|
|
2269
2400
|
rotate2(this, this, radians2, axis);
|
|
2270
2401
|
return this.check();
|
|
2271
2402
|
}
|
|
2272
2403
|
scale(factor) {
|
|
2273
|
-
|
|
2274
|
-
scale2(this, this, factor);
|
|
2275
|
-
} else {
|
|
2276
|
-
scale2(this, this, [factor, factor, factor]);
|
|
2277
|
-
}
|
|
2404
|
+
scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
2278
2405
|
return this.check();
|
|
2279
2406
|
}
|
|
2280
|
-
translate(
|
|
2281
|
-
translate2(this, this,
|
|
2407
|
+
translate(vector) {
|
|
2408
|
+
translate2(this, this, vector);
|
|
2282
2409
|
return this.check();
|
|
2283
2410
|
}
|
|
2284
2411
|
transform(vector, result) {
|
|
@@ -2293,51 +2420,50 @@
|
|
|
2293
2420
|
const {
|
|
2294
2421
|
length: length4
|
|
2295
2422
|
} = vector;
|
|
2423
|
+
let out;
|
|
2296
2424
|
switch (length4) {
|
|
2297
2425
|
case 2:
|
|
2298
|
-
|
|
2426
|
+
out = transformMat4(result || [-0, -0], vector, this);
|
|
2299
2427
|
break;
|
|
2300
2428
|
case 3:
|
|
2301
|
-
|
|
2429
|
+
out = transformMat42(result || [-0, -0, -0], vector, this);
|
|
2302
2430
|
break;
|
|
2303
2431
|
default:
|
|
2304
2432
|
throw new Error("Illegal vector");
|
|
2305
2433
|
}
|
|
2306
|
-
checkVector(
|
|
2307
|
-
return
|
|
2434
|
+
checkVector(out, vector.length);
|
|
2435
|
+
return out;
|
|
2308
2436
|
}
|
|
2309
2437
|
transformAsVector(vector, result) {
|
|
2438
|
+
let out;
|
|
2310
2439
|
switch (vector.length) {
|
|
2311
2440
|
case 2:
|
|
2312
|
-
|
|
2441
|
+
out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
|
|
2313
2442
|
break;
|
|
2314
2443
|
case 3:
|
|
2315
|
-
|
|
2444
|
+
out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
|
|
2316
2445
|
break;
|
|
2317
2446
|
default:
|
|
2318
2447
|
throw new Error("Illegal vector");
|
|
2319
2448
|
}
|
|
2320
|
-
checkVector(
|
|
2321
|
-
return
|
|
2322
|
-
}
|
|
2323
|
-
makeRotationX(radians2) {
|
|
2324
|
-
return this.identity().rotateX(radians2);
|
|
2325
|
-
}
|
|
2326
|
-
makeTranslation(x, y, z) {
|
|
2327
|
-
return this.identity().translate([x, y, z]);
|
|
2449
|
+
checkVector(out, vector.length);
|
|
2450
|
+
return out;
|
|
2328
2451
|
}
|
|
2329
2452
|
transformPoint(vector, result) {
|
|
2330
|
-
deprecated("Matrix4.transformPoint", "3.0");
|
|
2331
2453
|
return this.transformAsPoint(vector, result);
|
|
2332
2454
|
}
|
|
2333
2455
|
transformVector(vector, result) {
|
|
2334
|
-
deprecated("Matrix4.transformVector", "3.0");
|
|
2335
2456
|
return this.transformAsPoint(vector, result);
|
|
2336
2457
|
}
|
|
2337
2458
|
transformDirection(vector, result) {
|
|
2338
|
-
deprecated("Matrix4.transformDirection", "3.0");
|
|
2339
2459
|
return this.transformAsVector(vector, result);
|
|
2340
2460
|
}
|
|
2461
|
+
makeRotationX(radians2) {
|
|
2462
|
+
return this.identity().rotateX(radians2);
|
|
2463
|
+
}
|
|
2464
|
+
makeTranslation(x, y, z) {
|
|
2465
|
+
return this.identity().translate([x, y, z]);
|
|
2466
|
+
}
|
|
2341
2467
|
};
|
|
2342
2468
|
}
|
|
2343
2469
|
});
|
|
@@ -2564,7 +2690,7 @@
|
|
|
2564
2690
|
"../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js"() {
|
|
2565
2691
|
init_math_array();
|
|
2566
2692
|
init_validators();
|
|
2567
|
-
|
|
2693
|
+
init_vector4();
|
|
2568
2694
|
init_quat();
|
|
2569
2695
|
init_vec4();
|
|
2570
2696
|
IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
@@ -2591,18 +2717,25 @@
|
|
|
2591
2717
|
this[3] = w;
|
|
2592
2718
|
return this.check();
|
|
2593
2719
|
}
|
|
2594
|
-
|
|
2595
|
-
|
|
2720
|
+
fromObject(object) {
|
|
2721
|
+
this[0] = object.x;
|
|
2722
|
+
this[1] = object.y;
|
|
2723
|
+
this[2] = object.z;
|
|
2724
|
+
this[3] = object.w;
|
|
2596
2725
|
return this.check();
|
|
2597
2726
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2727
|
+
fromMatrix3(m) {
|
|
2728
|
+
fromMat3(this, m);
|
|
2600
2729
|
return this.check();
|
|
2601
2730
|
}
|
|
2602
2731
|
fromAxisRotation(axis, rad) {
|
|
2603
2732
|
setAxisAngle(this, axis, rad);
|
|
2604
2733
|
return this.check();
|
|
2605
2734
|
}
|
|
2735
|
+
identity() {
|
|
2736
|
+
identity2(this);
|
|
2737
|
+
return this.check();
|
|
2738
|
+
}
|
|
2606
2739
|
setAxisAngle(axis, rad) {
|
|
2607
2740
|
return this.fromAxisRotation(axis, rad);
|
|
2608
2741
|
}
|
|
@@ -2639,20 +2772,14 @@
|
|
|
2639
2772
|
lengthSquared() {
|
|
2640
2773
|
return squaredLength2(this);
|
|
2641
2774
|
}
|
|
2642
|
-
dot(a
|
|
2643
|
-
if (b !== void 0) {
|
|
2644
|
-
throw new Error("Quaternion.dot only takes one argument");
|
|
2645
|
-
}
|
|
2775
|
+
dot(a) {
|
|
2646
2776
|
return dot3(this, a);
|
|
2647
2777
|
}
|
|
2648
2778
|
rotationTo(vectorA, vectorB) {
|
|
2649
2779
|
rotationTo(this, vectorA, vectorB);
|
|
2650
2780
|
return this.check();
|
|
2651
2781
|
}
|
|
2652
|
-
add(a
|
|
2653
|
-
if (b !== void 0) {
|
|
2654
|
-
throw new Error("Quaternion.add only takes one argument");
|
|
2655
|
-
}
|
|
2782
|
+
add(a) {
|
|
2656
2783
|
add2(this, this, a);
|
|
2657
2784
|
return this.check();
|
|
2658
2785
|
}
|
|
@@ -2669,16 +2796,17 @@
|
|
|
2669
2796
|
return this.check();
|
|
2670
2797
|
}
|
|
2671
2798
|
lerp(a, b, t) {
|
|
2799
|
+
if (t === void 0) {
|
|
2800
|
+
return this.lerp(this, a, b);
|
|
2801
|
+
}
|
|
2672
2802
|
lerp2(this, a, b, t);
|
|
2673
2803
|
return this.check();
|
|
2674
2804
|
}
|
|
2675
|
-
multiplyRight(a
|
|
2676
|
-
assert(!b);
|
|
2805
|
+
multiplyRight(a) {
|
|
2677
2806
|
multiply3(this, this, a);
|
|
2678
2807
|
return this.check();
|
|
2679
2808
|
}
|
|
2680
|
-
multiplyLeft(a
|
|
2681
|
-
assert(!b);
|
|
2809
|
+
multiplyLeft(a) {
|
|
2682
2810
|
multiply3(this, a, this);
|
|
2683
2811
|
return this.check();
|
|
2684
2812
|
}
|
|
@@ -2710,25 +2838,32 @@
|
|
|
2710
2838
|
scale4(this, this, b);
|
|
2711
2839
|
return this.check();
|
|
2712
2840
|
}
|
|
2713
|
-
slerp(
|
|
2841
|
+
slerp(arg0, arg1, arg2) {
|
|
2842
|
+
let start;
|
|
2843
|
+
let target;
|
|
2844
|
+
let ratio;
|
|
2714
2845
|
switch (arguments.length) {
|
|
2715
2846
|
case 1:
|
|
2716
2847
|
({
|
|
2717
2848
|
start = IDENTITY_QUATERNION,
|
|
2718
2849
|
target,
|
|
2719
2850
|
ratio
|
|
2720
|
-
} =
|
|
2851
|
+
} = arg0);
|
|
2721
2852
|
break;
|
|
2722
2853
|
case 2:
|
|
2723
|
-
[target, ratio] = arguments;
|
|
2724
2854
|
start = this;
|
|
2855
|
+
target = arg0;
|
|
2856
|
+
ratio = arg1;
|
|
2725
2857
|
break;
|
|
2726
2858
|
default:
|
|
2859
|
+
start = arg0;
|
|
2860
|
+
target = arg1;
|
|
2861
|
+
ratio = arg2;
|
|
2727
2862
|
}
|
|
2728
2863
|
slerp(this, start, target, ratio);
|
|
2729
2864
|
return this.check();
|
|
2730
2865
|
}
|
|
2731
|
-
transformVector4(vector, result =
|
|
2866
|
+
transformVector4(vector, result = new Vector4()) {
|
|
2732
2867
|
transformQuat2(result, vector, this);
|
|
2733
2868
|
return checkVector(result, 4);
|
|
2734
2869
|
}
|
|
@@ -2738,16 +2873,35 @@
|
|
|
2738
2873
|
setFromAxisAngle(axis, rad) {
|
|
2739
2874
|
return this.setAxisAngle(axis, rad);
|
|
2740
2875
|
}
|
|
2741
|
-
premultiply(a
|
|
2742
|
-
return this.multiplyLeft(a
|
|
2876
|
+
premultiply(a) {
|
|
2877
|
+
return this.multiplyLeft(a);
|
|
2743
2878
|
}
|
|
2744
|
-
multiply(a
|
|
2745
|
-
return this.multiplyRight(a
|
|
2879
|
+
multiply(a) {
|
|
2880
|
+
return this.multiplyRight(a);
|
|
2746
2881
|
}
|
|
2747
2882
|
};
|
|
2748
2883
|
}
|
|
2749
2884
|
});
|
|
2750
2885
|
|
|
2886
|
+
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
2887
|
+
function _defineProperty(obj, key, value) {
|
|
2888
|
+
if (key in obj) {
|
|
2889
|
+
Object.defineProperty(obj, key, {
|
|
2890
|
+
value,
|
|
2891
|
+
enumerable: true,
|
|
2892
|
+
configurable: true,
|
|
2893
|
+
writable: true
|
|
2894
|
+
});
|
|
2895
|
+
} else {
|
|
2896
|
+
obj[key] = value;
|
|
2897
|
+
}
|
|
2898
|
+
return obj;
|
|
2899
|
+
}
|
|
2900
|
+
var init_defineProperty = __esm({
|
|
2901
|
+
"../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
|
|
2902
|
+
}
|
|
2903
|
+
});
|
|
2904
|
+
|
|
2751
2905
|
// ../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js
|
|
2752
2906
|
var math_utils_default;
|
|
2753
2907
|
var init_math_utils = __esm({
|
|
@@ -2782,26 +2936,15 @@
|
|
|
2782
2936
|
});
|
|
2783
2937
|
|
|
2784
2938
|
// ../../node_modules/@math.gl/core/dist/esm/index.js
|
|
2785
|
-
var globals, global_;
|
|
2786
2939
|
var init_esm = __esm({
|
|
2787
2940
|
"../../node_modules/@math.gl/core/dist/esm/index.js"() {
|
|
2788
|
-
init_common();
|
|
2789
2941
|
init_vector3();
|
|
2790
2942
|
init_matrix3();
|
|
2791
2943
|
init_matrix4();
|
|
2792
2944
|
init_quaternion();
|
|
2793
|
-
init_common();
|
|
2794
2945
|
init_math_utils();
|
|
2795
2946
|
init_assert();
|
|
2796
|
-
|
|
2797
|
-
self: typeof self !== "undefined" && self,
|
|
2798
|
-
window: typeof window !== "undefined" && window,
|
|
2799
|
-
global: typeof global !== "undefined" && global
|
|
2800
|
-
};
|
|
2801
|
-
global_ = globals.global || globals.self || globals.window;
|
|
2802
|
-
global_.mathgl = {
|
|
2803
|
-
config
|
|
2804
|
-
};
|
|
2947
|
+
init_common();
|
|
2805
2948
|
}
|
|
2806
2949
|
});
|
|
2807
2950
|
|
|
@@ -2824,65 +2967,67 @@
|
|
|
2824
2967
|
});
|
|
2825
2968
|
|
|
2826
2969
|
// ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
|
|
2827
|
-
function
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
result[
|
|
2834
|
-
result[1] = map3(cartographic.latitude);
|
|
2970
|
+
function identity3(x) {
|
|
2971
|
+
return x;
|
|
2972
|
+
}
|
|
2973
|
+
function fromCartographic(cartographic, result = [], map2 = identity3) {
|
|
2974
|
+
if ("longitude" in cartographic) {
|
|
2975
|
+
result[0] = map2(cartographic.longitude);
|
|
2976
|
+
result[1] = map2(cartographic.latitude);
|
|
2835
2977
|
result[2] = cartographic.height;
|
|
2836
|
-
} else {
|
|
2837
|
-
result[0] =
|
|
2838
|
-
result[1] =
|
|
2978
|
+
} else if ("x" in cartographic) {
|
|
2979
|
+
result[0] = map2(cartographic.x);
|
|
2980
|
+
result[1] = map2(cartographic.y);
|
|
2839
2981
|
result[2] = cartographic.z;
|
|
2982
|
+
} else {
|
|
2983
|
+
result[0] = map2(cartographic[0]);
|
|
2984
|
+
result[1] = map2(cartographic[1]);
|
|
2985
|
+
result[2] = cartographic[2];
|
|
2840
2986
|
}
|
|
2841
2987
|
return result;
|
|
2842
2988
|
}
|
|
2843
|
-
function fromCartographicToRadians(cartographic, vector =
|
|
2844
|
-
return fromCartographic(cartographic, vector, config._cartographicRadians ?
|
|
2989
|
+
function fromCartographicToRadians(cartographic, vector = []) {
|
|
2990
|
+
return fromCartographic(cartographic, vector, config._cartographicRadians ? identity3 : toRadians);
|
|
2845
2991
|
}
|
|
2846
|
-
function toCartographic(vector, cartographic,
|
|
2847
|
-
if (
|
|
2848
|
-
cartographic
|
|
2849
|
-
cartographic
|
|
2850
|
-
cartographic[2] = vector[2];
|
|
2851
|
-
} else if ("longitude" in cartographic) {
|
|
2852
|
-
cartographic.longitude = map3(vector[0]);
|
|
2853
|
-
cartographic.latitude = map3(vector[1]);
|
|
2992
|
+
function toCartographic(vector, cartographic, map2 = identity3) {
|
|
2993
|
+
if ("longitude" in cartographic) {
|
|
2994
|
+
cartographic.longitude = map2(vector[0]);
|
|
2995
|
+
cartographic.latitude = map2(vector[1]);
|
|
2854
2996
|
cartographic.height = vector[2];
|
|
2855
|
-
} else {
|
|
2856
|
-
cartographic.x =
|
|
2857
|
-
cartographic.y =
|
|
2997
|
+
} else if ("x" in cartographic) {
|
|
2998
|
+
cartographic.x = map2(vector[0]);
|
|
2999
|
+
cartographic.y = map2(vector[1]);
|
|
2858
3000
|
cartographic.z = vector[2];
|
|
3001
|
+
} else {
|
|
3002
|
+
cartographic[0] = map2(vector[0]);
|
|
3003
|
+
cartographic[1] = map2(vector[1]);
|
|
3004
|
+
cartographic[2] = vector[2];
|
|
2859
3005
|
}
|
|
2860
3006
|
return cartographic;
|
|
2861
3007
|
}
|
|
2862
3008
|
function toCartographicFromRadians(vector, cartographic) {
|
|
2863
|
-
return toCartographic(vector, cartographic, config._cartographicRadians ?
|
|
3009
|
+
return toCartographic(vector, cartographic, config._cartographicRadians ? identity3 : toDegrees);
|
|
2864
3010
|
}
|
|
2865
|
-
var
|
|
3011
|
+
var scratchVector;
|
|
2866
3012
|
var init_type_utils = __esm({
|
|
2867
3013
|
"../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js"() {
|
|
2868
3014
|
init_esm();
|
|
2869
3015
|
init_constants();
|
|
2870
|
-
noop = (x) => x;
|
|
2871
3016
|
scratchVector = new Vector3();
|
|
2872
3017
|
}
|
|
2873
3018
|
});
|
|
2874
3019
|
|
|
2875
3020
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
|
|
2876
|
-
function scaleToGeodeticSurface(cartesian, ellipsoid, result =
|
|
3021
|
+
function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
|
|
2877
3022
|
const {
|
|
2878
3023
|
oneOverRadii,
|
|
2879
3024
|
oneOverRadiiSquared,
|
|
2880
3025
|
centerToleranceSquared
|
|
2881
3026
|
} = ellipsoid;
|
|
2882
3027
|
scratchVector2.from(cartesian);
|
|
2883
|
-
const positionX =
|
|
2884
|
-
const positionY =
|
|
2885
|
-
const positionZ =
|
|
3028
|
+
const positionX = scratchVector2.x;
|
|
3029
|
+
const positionY = scratchVector2.y;
|
|
3030
|
+
const positionZ = scratchVector2.z;
|
|
2886
3031
|
const oneOverRadiiX = oneOverRadii.x;
|
|
2887
3032
|
const oneOverRadiiY = oneOverRadii.y;
|
|
2888
3033
|
const oneOverRadiiZ = oneOverRadii.z;
|
|
@@ -2904,7 +3049,7 @@
|
|
|
2904
3049
|
const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
|
|
2905
3050
|
const gradient = scaleToGeodeticSurfaceGradient;
|
|
2906
3051
|
gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
|
|
2907
|
-
let lambda = (1 - ratio) *
|
|
3052
|
+
let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
|
|
2908
3053
|
let correction = 0;
|
|
2909
3054
|
let xMultiplier;
|
|
2910
3055
|
let yMultiplier;
|
|
@@ -3067,9 +3212,10 @@
|
|
|
3067
3212
|
});
|
|
3068
3213
|
|
|
3069
3214
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js
|
|
3070
|
-
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian,
|
|
3215
|
+
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, Ellipsoid;
|
|
3071
3216
|
var init_ellipsoid = __esm({
|
|
3072
3217
|
"../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js"() {
|
|
3218
|
+
init_defineProperty();
|
|
3073
3219
|
init_esm();
|
|
3074
3220
|
init_vec3();
|
|
3075
3221
|
init_constants();
|
|
@@ -3083,11 +3229,16 @@
|
|
|
3083
3229
|
scratchHeight = new Vector3();
|
|
3084
3230
|
scratchCartesian = new Vector3();
|
|
3085
3231
|
Ellipsoid = class {
|
|
3086
|
-
static get WGS84() {
|
|
3087
|
-
wgs84 = wgs84 || new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
|
|
3088
|
-
return wgs84;
|
|
3089
|
-
}
|
|
3090
3232
|
constructor(x = 0, y = 0, z = 0) {
|
|
3233
|
+
_defineProperty(this, "radii", void 0);
|
|
3234
|
+
_defineProperty(this, "radiiSquared", void 0);
|
|
3235
|
+
_defineProperty(this, "radiiToTheFourth", void 0);
|
|
3236
|
+
_defineProperty(this, "oneOverRadii", void 0);
|
|
3237
|
+
_defineProperty(this, "oneOverRadiiSquared", void 0);
|
|
3238
|
+
_defineProperty(this, "minimumRadius", void 0);
|
|
3239
|
+
_defineProperty(this, "maximumRadius", void 0);
|
|
3240
|
+
_defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
|
|
3241
|
+
_defineProperty(this, "squaredXOverSquaredZ", void 0);
|
|
3091
3242
|
assert(x >= 0);
|
|
3092
3243
|
assert(y >= 0);
|
|
3093
3244
|
assert(z >= 0);
|
|
@@ -3098,7 +3249,6 @@
|
|
|
3098
3249
|
this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
|
|
3099
3250
|
this.minimumRadius = Math.min(x, y, z);
|
|
3100
3251
|
this.maximumRadius = Math.max(x, y, z);
|
|
3101
|
-
this.centerToleranceSquared = math_utils_default.EPSILON1;
|
|
3102
3252
|
if (this.radiiSquared.z !== 0) {
|
|
3103
3253
|
this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
|
|
3104
3254
|
}
|
|
@@ -3185,6 +3335,7 @@
|
|
|
3185
3335
|
return scratchPosition.set(0, 0, z).to(result);
|
|
3186
3336
|
}
|
|
3187
3337
|
};
|
|
3338
|
+
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
3188
3339
|
}
|
|
3189
3340
|
});
|
|
3190
3341
|
|
|
@@ -3196,25 +3347,6 @@
|
|
|
3196
3347
|
}
|
|
3197
3348
|
});
|
|
3198
3349
|
|
|
3199
|
-
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
3200
|
-
function _defineProperty(obj, key, value) {
|
|
3201
|
-
if (key in obj) {
|
|
3202
|
-
Object.defineProperty(obj, key, {
|
|
3203
|
-
value,
|
|
3204
|
-
enumerable: true,
|
|
3205
|
-
configurable: true,
|
|
3206
|
-
writable: true
|
|
3207
|
-
});
|
|
3208
|
-
} else {
|
|
3209
|
-
obj[key] = value;
|
|
3210
|
-
}
|
|
3211
|
-
return obj;
|
|
3212
|
-
}
|
|
3213
|
-
var init_defineProperty = __esm({
|
|
3214
|
-
"../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() {
|
|
3215
|
-
}
|
|
3216
|
-
});
|
|
3217
|
-
|
|
3218
3350
|
// ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
3219
3351
|
function getHiResTimestamp() {
|
|
3220
3352
|
let timestamp;
|
|
@@ -3446,19 +3578,19 @@
|
|
|
3446
3578
|
});
|
|
3447
3579
|
|
|
3448
3580
|
// ../loader-utils/src/lib/env-utils/globals.ts
|
|
3449
|
-
var
|
|
3581
|
+
var globals, self_, window_, global_, document_, isBrowser, matches, nodeVersion;
|
|
3450
3582
|
var init_globals = __esm({
|
|
3451
3583
|
"../loader-utils/src/lib/env-utils/globals.ts"() {
|
|
3452
|
-
|
|
3584
|
+
globals = {
|
|
3453
3585
|
self: typeof self !== "undefined" && self,
|
|
3454
3586
|
window: typeof window !== "undefined" && window,
|
|
3455
3587
|
global: typeof global !== "undefined" && global,
|
|
3456
3588
|
document: typeof document !== "undefined" && document
|
|
3457
3589
|
};
|
|
3458
|
-
self_ =
|
|
3459
|
-
window_ =
|
|
3460
|
-
|
|
3461
|
-
document_ =
|
|
3590
|
+
self_ = globals.self || globals.window || globals.global || {};
|
|
3591
|
+
window_ = globals.window || globals.self || globals.global || {};
|
|
3592
|
+
global_ = globals.global || globals.self || globals.window || {};
|
|
3593
|
+
document_ = globals.document || {};
|
|
3462
3594
|
isBrowser = Boolean(typeof process !== "object" || String(process) !== "[object process]" || process.browser);
|
|
3463
3595
|
matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
3464
3596
|
nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
@@ -3489,19 +3621,19 @@
|
|
|
3489
3621
|
});
|
|
3490
3622
|
|
|
3491
3623
|
// ../worker-utils/src/lib/env-utils/globals.ts
|
|
3492
|
-
var
|
|
3624
|
+
var globals2, self_2, window_2, global_2, document_2, isBrowser2, isMobile, matches2, nodeVersion2;
|
|
3493
3625
|
var init_globals2 = __esm({
|
|
3494
3626
|
"../worker-utils/src/lib/env-utils/globals.ts"() {
|
|
3495
|
-
|
|
3627
|
+
globals2 = {
|
|
3496
3628
|
self: typeof self !== "undefined" && self,
|
|
3497
3629
|
window: typeof window !== "undefined" && window,
|
|
3498
3630
|
global: typeof global !== "undefined" && global,
|
|
3499
3631
|
document: typeof document !== "undefined" && document
|
|
3500
3632
|
};
|
|
3501
|
-
self_2 =
|
|
3502
|
-
window_2 =
|
|
3503
|
-
|
|
3504
|
-
document_2 =
|
|
3633
|
+
self_2 = globals2.self || globals2.window || globals2.global || {};
|
|
3634
|
+
window_2 = globals2.window || globals2.self || globals2.global || {};
|
|
3635
|
+
global_2 = globals2.global || globals2.self || globals2.window || {};
|
|
3636
|
+
document_2 = globals2.document || {};
|
|
3505
3637
|
isBrowser2 = typeof process !== "object" || String(process) !== "[object process]" || process.browser;
|
|
3506
3638
|
isMobile = typeof window !== "undefined" && typeof window.orientation !== "undefined";
|
|
3507
3639
|
matches2 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
@@ -3666,7 +3798,7 @@
|
|
|
3666
3798
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
3667
3799
|
}
|
|
3668
3800
|
static isSupported() {
|
|
3669
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
3801
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
3670
3802
|
}
|
|
3671
3803
|
destroy() {
|
|
3672
3804
|
this.onMessage = NOOP;
|
|
@@ -4483,11 +4615,11 @@
|
|
|
4483
4615
|
var INTERSECTION;
|
|
4484
4616
|
var init_constants2 = __esm({
|
|
4485
4617
|
"../../node_modules/@math.gl/culling/dist/esm/constants.js"() {
|
|
4486
|
-
INTERSECTION =
|
|
4618
|
+
INTERSECTION = {
|
|
4487
4619
|
OUTSIDE: -1,
|
|
4488
4620
|
INTERSECTING: 0,
|
|
4489
4621
|
INSIDE: 1
|
|
4490
|
-
}
|
|
4622
|
+
};
|
|
4491
4623
|
}
|
|
4492
4624
|
});
|
|
4493
4625
|
|
|
@@ -4495,6 +4627,7 @@
|
|
|
4495
4627
|
var scratchVector5, scratchNormal2;
|
|
4496
4628
|
var init_axis_aligned_bounding_box = __esm({
|
|
4497
4629
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.js"() {
|
|
4630
|
+
init_defineProperty();
|
|
4498
4631
|
init_esm();
|
|
4499
4632
|
init_constants2();
|
|
4500
4633
|
scratchVector5 = new Vector3();
|
|
@@ -4506,6 +4639,7 @@
|
|
|
4506
4639
|
var scratchVector6, scratchVector23, BoundingSphere;
|
|
4507
4640
|
var init_bounding_sphere = __esm({
|
|
4508
4641
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/bounding-sphere.js"() {
|
|
4642
|
+
init_defineProperty();
|
|
4509
4643
|
init_esm();
|
|
4510
4644
|
init_mat4();
|
|
4511
4645
|
init_constants2();
|
|
@@ -4513,6 +4647,8 @@
|
|
|
4513
4647
|
scratchVector23 = new Vector3();
|
|
4514
4648
|
BoundingSphere = class {
|
|
4515
4649
|
constructor(center = [0, 0, 0], radius = 0) {
|
|
4650
|
+
_defineProperty(this, "center", void 0);
|
|
4651
|
+
_defineProperty(this, "radius", void 0);
|
|
4516
4652
|
this.radius = -0;
|
|
4517
4653
|
this.center = new Vector3();
|
|
4518
4654
|
this.fromCenterRadius(center, radius);
|
|
@@ -4554,8 +4690,8 @@
|
|
|
4554
4690
|
return this;
|
|
4555
4691
|
}
|
|
4556
4692
|
expand(point) {
|
|
4557
|
-
|
|
4558
|
-
const radius =
|
|
4693
|
+
const scratchPoint = scratchVector6.from(point);
|
|
4694
|
+
const radius = scratchPoint.subtract(this.center).magnitude();
|
|
4559
4695
|
if (radius > this.radius) {
|
|
4560
4696
|
this.radius = radius;
|
|
4561
4697
|
}
|
|
@@ -4568,12 +4704,13 @@
|
|
|
4568
4704
|
return this;
|
|
4569
4705
|
}
|
|
4570
4706
|
distanceSquaredTo(point) {
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
return delta.lengthSquared() - this.radius * this.radius;
|
|
4707
|
+
const d = this.distanceTo(point);
|
|
4708
|
+
return d * d;
|
|
4574
4709
|
}
|
|
4575
4710
|
distanceTo(point) {
|
|
4576
|
-
|
|
4711
|
+
const scratchPoint = scratchVector6.from(point);
|
|
4712
|
+
const delta = scratchPoint.subtract(this.center);
|
|
4713
|
+
return Math.max(0, delta.len() - this.radius);
|
|
4577
4714
|
}
|
|
4578
4715
|
intersectPlane(plane) {
|
|
4579
4716
|
const center = this.center;
|
|
@@ -4596,6 +4733,7 @@
|
|
|
4596
4733
|
var scratchVector32, scratchOffset, scratchVectorU, scratchVectorV, scratchVectorW, scratchCorner, scratchToCenter, MATRIX3, OrientedBoundingBox;
|
|
4597
4734
|
var init_oriented_bounding_box = __esm({
|
|
4598
4735
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/oriented-bounding-box.js"() {
|
|
4736
|
+
init_defineProperty();
|
|
4599
4737
|
init_esm();
|
|
4600
4738
|
init_bounding_sphere();
|
|
4601
4739
|
init_constants2();
|
|
@@ -4619,6 +4757,8 @@
|
|
|
4619
4757
|
};
|
|
4620
4758
|
OrientedBoundingBox = class {
|
|
4621
4759
|
constructor(center = [0, 0, 0], halfAxes = [0, 0, 0, 0, 0, 0, 0, 0, 0]) {
|
|
4760
|
+
_defineProperty(this, "center", void 0);
|
|
4761
|
+
_defineProperty(this, "halfAxes", void 0);
|
|
4622
4762
|
this.center = new Vector3().from(center);
|
|
4623
4763
|
this.halfAxes = new Matrix3(halfAxes);
|
|
4624
4764
|
}
|
|
@@ -4790,11 +4930,14 @@
|
|
|
4790
4930
|
var scratchPosition2, scratchNormal3, Plane;
|
|
4791
4931
|
var init_plane = __esm({
|
|
4792
4932
|
"../../node_modules/@math.gl/culling/dist/esm/lib/plane.js"() {
|
|
4933
|
+
init_defineProperty();
|
|
4793
4934
|
init_esm();
|
|
4794
4935
|
scratchPosition2 = new Vector3();
|
|
4795
4936
|
scratchNormal3 = new Vector3();
|
|
4796
4937
|
Plane = class {
|
|
4797
4938
|
constructor(normal = [0, 0, 1], distance = 0) {
|
|
4939
|
+
_defineProperty(this, "normal", void 0);
|
|
4940
|
+
_defineProperty(this, "distance", void 0);
|
|
4798
4941
|
this.normal = new Vector3();
|
|
4799
4942
|
this.distance = -0;
|
|
4800
4943
|
this.fromNormalDistance(normal, distance);
|
|
@@ -4818,7 +4961,7 @@
|
|
|
4818
4961
|
this.distance = d;
|
|
4819
4962
|
return this;
|
|
4820
4963
|
}
|
|
4821
|
-
clone(
|
|
4964
|
+
clone() {
|
|
4822
4965
|
return new Plane(this.normal, this.distance);
|
|
4823
4966
|
}
|
|
4824
4967
|
equals(right) {
|
|
@@ -4846,6 +4989,7 @@
|
|
|
4846
4989
|
var faces, scratchPlaneCenter, scratchPlaneNormal, scratchPlane, CullingVolume;
|
|
4847
4990
|
var init_culling_volume = __esm({
|
|
4848
4991
|
"../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js"() {
|
|
4992
|
+
init_defineProperty();
|
|
4849
4993
|
init_esm();
|
|
4850
4994
|
init_constants2();
|
|
4851
4995
|
init_plane();
|
|
@@ -4854,18 +4998,9 @@
|
|
|
4854
4998
|
scratchPlaneNormal = new Vector3();
|
|
4855
4999
|
scratchPlane = new Plane(new Vector3(1, 0, 0), 0);
|
|
4856
5000
|
CullingVolume = class {
|
|
4857
|
-
static get MASK_OUTSIDE() {
|
|
4858
|
-
return 4294967295;
|
|
4859
|
-
}
|
|
4860
|
-
static get MASK_INSIDE() {
|
|
4861
|
-
return 0;
|
|
4862
|
-
}
|
|
4863
|
-
static get MASK_INDETERMINATE() {
|
|
4864
|
-
return 2147483647;
|
|
4865
|
-
}
|
|
4866
5001
|
constructor(planes = []) {
|
|
5002
|
+
_defineProperty(this, "planes", void 0);
|
|
4867
5003
|
this.planes = planes;
|
|
4868
|
-
assert(this.planes.every((plane) => plane instanceof Plane));
|
|
4869
5004
|
}
|
|
4870
5005
|
fromBoundingSphere(boundingSphere) {
|
|
4871
5006
|
this.planes.length = 2 * faces.length;
|
|
@@ -4893,7 +5028,6 @@
|
|
|
4893
5028
|
return this;
|
|
4894
5029
|
}
|
|
4895
5030
|
computeVisibility(boundingVolume) {
|
|
4896
|
-
assert(boundingVolume);
|
|
4897
5031
|
let intersect = INTERSECTION.INSIDE;
|
|
4898
5032
|
for (const plane of this.planes) {
|
|
4899
5033
|
const result = boundingVolume.intersectPlane(plane);
|
|
@@ -4909,7 +5043,6 @@
|
|
|
4909
5043
|
return intersect;
|
|
4910
5044
|
}
|
|
4911
5045
|
computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
|
|
4912
|
-
assert(boundingVolume, "boundingVolume is required.");
|
|
4913
5046
|
assert(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
|
|
4914
5047
|
if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
|
|
4915
5048
|
return parentPlaneMask;
|
|
@@ -4932,6 +5065,9 @@
|
|
|
4932
5065
|
return mask;
|
|
4933
5066
|
}
|
|
4934
5067
|
};
|
|
5068
|
+
_defineProperty(CullingVolume, "MASK_OUTSIDE", 4294967295);
|
|
5069
|
+
_defineProperty(CullingVolume, "MASK_INSIDE", 0);
|
|
5070
|
+
_defineProperty(CullingVolume, "MASK_INDETERMINATE", 2147483647);
|
|
4935
5071
|
}
|
|
4936
5072
|
});
|
|
4937
5073
|
|
|
@@ -4939,6 +5075,7 @@
|
|
|
4939
5075
|
var scratchPlaneUpVector, scratchPlaneRightVector, scratchPlaneNearCenter, scratchPlaneFarCenter, scratchPlaneNormal2;
|
|
4940
5076
|
var init_perspective_off_center_frustum = __esm({
|
|
4941
5077
|
"../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js"() {
|
|
5078
|
+
init_defineProperty();
|
|
4942
5079
|
init_esm();
|
|
4943
5080
|
init_culling_volume();
|
|
4944
5081
|
init_plane();
|
|
@@ -4953,6 +5090,7 @@
|
|
|
4953
5090
|
// ../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js
|
|
4954
5091
|
var init_perspective_frustum = __esm({
|
|
4955
5092
|
"../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js"() {
|
|
5093
|
+
init_defineProperty();
|
|
4956
5094
|
init_perspective_off_center_frustum();
|
|
4957
5095
|
}
|
|
4958
5096
|
});
|
|
@@ -5027,8 +5165,6 @@
|
|
|
5027
5165
|
init_bounding_sphere_from_points();
|
|
5028
5166
|
init_bounding_box_from_points();
|
|
5029
5167
|
init_compute_eigen_decomposition();
|
|
5030
|
-
init_constants2();
|
|
5031
|
-
init_constants2();
|
|
5032
5168
|
}
|
|
5033
5169
|
});
|
|
5034
5170
|
|
|
@@ -5036,14 +5172,13 @@
|
|
|
5036
5172
|
function getFrameState(viewport, frameNumber) {
|
|
5037
5173
|
const { cameraDirection, cameraUp, height } = viewport;
|
|
5038
5174
|
const { metersPerUnit } = viewport.distanceScales;
|
|
5039
|
-
const
|
|
5040
|
-
const viewportCenterCartesian = Ellipsoid.WGS84.cartographicToCartesian(viewportCenterCartographic, new Vector3());
|
|
5175
|
+
const viewportCenterCartesian = worldToCartesian(viewport, viewport.center);
|
|
5041
5176
|
const enuToFixedTransform = Ellipsoid.WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);
|
|
5042
5177
|
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
5043
5178
|
const cameraPositionCartesian2 = Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, new Vector3());
|
|
5044
5179
|
const cameraDirectionCartesian = new Vector3(enuToFixedTransform.transformAsVector(new Vector3(cameraDirection).scale(metersPerUnit))).normalize();
|
|
5045
5180
|
const cameraUpCartesian = new Vector3(enuToFixedTransform.transformAsVector(new Vector3(cameraUp).scale(metersPerUnit))).normalize();
|
|
5046
|
-
commonSpacePlanesToWGS84(viewport
|
|
5181
|
+
commonSpacePlanesToWGS84(viewport);
|
|
5047
5182
|
const ViewportClass = viewport.constructor;
|
|
5048
5183
|
const { longitude, latitude, width, bearing, zoom } = viewport;
|
|
5049
5184
|
const topDownViewport = new ViewportClass({
|
|
@@ -5093,18 +5228,32 @@
|
|
|
5093
5228
|
}
|
|
5094
5229
|
return [selectedTiles, unselectedTiles];
|
|
5095
5230
|
}
|
|
5096
|
-
function commonSpacePlanesToWGS84(viewport
|
|
5231
|
+
function commonSpacePlanesToWGS84(viewport) {
|
|
5097
5232
|
const frustumPlanes = viewport.getFrustumPlanes();
|
|
5233
|
+
const nearCenterCommon = closestPointOnPlane(frustumPlanes.near, viewport.cameraPosition);
|
|
5234
|
+
const nearCenterCartesian = worldToCartesian(viewport, nearCenterCommon);
|
|
5235
|
+
const cameraCartesian = worldToCartesian(viewport, viewport.cameraPosition, scratchPosition3);
|
|
5098
5236
|
let i = 0;
|
|
5237
|
+
cullingVolume.planes[i++].fromPointNormal(nearCenterCartesian, scratchVector7.copy(nearCenterCartesian).subtract(cameraCartesian));
|
|
5099
5238
|
for (const dir in frustumPlanes) {
|
|
5239
|
+
if (dir === "near") {
|
|
5240
|
+
continue;
|
|
5241
|
+
}
|
|
5100
5242
|
const plane = frustumPlanes[dir];
|
|
5101
|
-
const
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
const cartesianPos = Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, new Vector3());
|
|
5105
|
-
cullingVolume.planes[i++].fromPointNormal(cartesianPos, scratchVector7.copy(viewportCenterCartesian).subtract(cartesianPos));
|
|
5243
|
+
const posCommon = closestPointOnPlane(plane, nearCenterCommon, scratchPosition3);
|
|
5244
|
+
const cartesianPos = worldToCartesian(viewport, posCommon, scratchPosition3);
|
|
5245
|
+
cullingVolume.planes[i++].fromPointNormal(cartesianPos, scratchVector7.copy(nearCenterCartesian).subtract(cartesianPos));
|
|
5106
5246
|
}
|
|
5107
5247
|
}
|
|
5248
|
+
function closestPointOnPlane(plane, refPoint, out = new Vector3()) {
|
|
5249
|
+
const distanceToRef = plane.normal.dot(refPoint);
|
|
5250
|
+
out.copy(plane.normal).scale(plane.distance - distanceToRef).add(refPoint);
|
|
5251
|
+
return out;
|
|
5252
|
+
}
|
|
5253
|
+
function worldToCartesian(viewport, point, out = new Vector3()) {
|
|
5254
|
+
const cartographicPos = viewport.unprojectPosition(point);
|
|
5255
|
+
return Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, out);
|
|
5256
|
+
}
|
|
5108
5257
|
var scratchVector7, scratchPosition3, cullingVolume;
|
|
5109
5258
|
var init_frame_state = __esm({
|
|
5110
5259
|
"src/tileset/helpers/frame-state.ts"() {
|
|
@@ -5369,7 +5518,7 @@
|
|
|
5369
5518
|
}
|
|
5370
5519
|
});
|
|
5371
5520
|
|
|
5372
|
-
// ../../node_modules
|
|
5521
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
5373
5522
|
function isElectron(mockUserAgent) {
|
|
5374
5523
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
5375
5524
|
return true;
|
|
@@ -5385,52 +5534,59 @@
|
|
|
5385
5534
|
return false;
|
|
5386
5535
|
}
|
|
5387
5536
|
var init_is_electron = __esm({
|
|
5388
|
-
"../../node_modules
|
|
5537
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
5389
5538
|
}
|
|
5390
5539
|
});
|
|
5391
5540
|
|
|
5392
|
-
// ../../node_modules
|
|
5541
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
5393
5542
|
function isBrowser3() {
|
|
5394
5543
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
5395
5544
|
return !isNode || isElectron();
|
|
5396
5545
|
}
|
|
5397
5546
|
var init_is_browser = __esm({
|
|
5398
|
-
"../../node_modules
|
|
5547
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
5399
5548
|
init_is_electron();
|
|
5400
5549
|
}
|
|
5401
5550
|
});
|
|
5402
5551
|
|
|
5403
|
-
// ../../node_modules
|
|
5404
|
-
var
|
|
5552
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
5553
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
5405
5554
|
var init_globals3 = __esm({
|
|
5406
|
-
"../../node_modules
|
|
5407
|
-
|
|
5555
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
5556
|
+
globals3 = {
|
|
5408
5557
|
self: typeof self !== "undefined" && self,
|
|
5409
5558
|
window: typeof window !== "undefined" && window,
|
|
5410
5559
|
global: typeof global !== "undefined" && global,
|
|
5411
5560
|
document: typeof document !== "undefined" && document,
|
|
5412
5561
|
process: typeof process === "object" && process
|
|
5413
5562
|
};
|
|
5414
|
-
self_3 =
|
|
5415
|
-
window_3 =
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
process_ = globals4.process || {};
|
|
5563
|
+
self_3 = globals3.self || globals3.window || globals3.global;
|
|
5564
|
+
window_3 = globals3.window || globals3.self || globals3.global;
|
|
5565
|
+
document_3 = globals3.document || {};
|
|
5566
|
+
process_ = globals3.process || {};
|
|
5419
5567
|
}
|
|
5420
5568
|
});
|
|
5421
5569
|
|
|
5422
|
-
// ../../node_modules
|
|
5570
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
5423
5571
|
var VERSION2, isBrowser4;
|
|
5424
5572
|
var init_globals4 = __esm({
|
|
5425
|
-
"../../node_modules
|
|
5573
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
5426
5574
|
init_is_browser();
|
|
5427
|
-
init_globals3();
|
|
5428
5575
|
VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
5429
5576
|
isBrowser4 = isBrowser3();
|
|
5430
5577
|
}
|
|
5431
5578
|
});
|
|
5432
5579
|
|
|
5433
|
-
// ../../node_modules
|
|
5580
|
+
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
5581
|
+
var init_esm5 = __esm({
|
|
5582
|
+
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
5583
|
+
init_globals4();
|
|
5584
|
+
init_globals3();
|
|
5585
|
+
init_is_browser();
|
|
5586
|
+
}
|
|
5587
|
+
});
|
|
5588
|
+
|
|
5589
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
5434
5590
|
function getStorage(type) {
|
|
5435
5591
|
try {
|
|
5436
5592
|
const storage = window[type];
|
|
@@ -5444,9 +5600,15 @@
|
|
|
5444
5600
|
}
|
|
5445
5601
|
var LocalStorage;
|
|
5446
5602
|
var init_local_storage = __esm({
|
|
5447
|
-
"../../node_modules
|
|
5603
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
5604
|
+
init_defineProperty();
|
|
5448
5605
|
LocalStorage = class {
|
|
5449
|
-
constructor(id
|
|
5606
|
+
constructor(id) {
|
|
5607
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
5608
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
5609
|
+
_defineProperty(this, "storage", void 0);
|
|
5610
|
+
_defineProperty(this, "id", void 0);
|
|
5611
|
+
_defineProperty(this, "config", {});
|
|
5450
5612
|
this.storage = getStorage(type);
|
|
5451
5613
|
this.id = id;
|
|
5452
5614
|
this.config = {};
|
|
@@ -5481,7 +5643,7 @@
|
|
|
5481
5643
|
}
|
|
5482
5644
|
});
|
|
5483
5645
|
|
|
5484
|
-
// ../../node_modules
|
|
5646
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
5485
5647
|
function formatTime(ms) {
|
|
5486
5648
|
let formatted;
|
|
5487
5649
|
if (ms < 10) {
|
|
@@ -5495,11 +5657,13 @@
|
|
|
5495
5657
|
}
|
|
5496
5658
|
return formatted;
|
|
5497
5659
|
}
|
|
5498
|
-
function leftPad(string
|
|
5660
|
+
function leftPad(string) {
|
|
5661
|
+
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
5499
5662
|
const padLength = Math.max(length4 - string.length, 0);
|
|
5500
5663
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
5501
5664
|
}
|
|
5502
|
-
function formatImage(image, message, scale5
|
|
5665
|
+
function formatImage(image, message, scale5) {
|
|
5666
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
5503
5667
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
5504
5668
|
if (image.width > maxWidth) {
|
|
5505
5669
|
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
@@ -5510,16 +5674,16 @@
|
|
|
5510
5674
|
return ["".concat(message, " %c+"), style];
|
|
5511
5675
|
}
|
|
5512
5676
|
var init_formatters = __esm({
|
|
5513
|
-
"../../node_modules
|
|
5677
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
5514
5678
|
}
|
|
5515
5679
|
});
|
|
5516
5680
|
|
|
5517
|
-
// ../../node_modules
|
|
5681
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
5518
5682
|
function getColor(color) {
|
|
5519
5683
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
5520
5684
|
}
|
|
5521
5685
|
function addColor(string, color, background) {
|
|
5522
|
-
if (!
|
|
5686
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
5523
5687
|
if (color) {
|
|
5524
5688
|
color = getColor(color);
|
|
5525
5689
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -5533,31 +5697,32 @@
|
|
|
5533
5697
|
}
|
|
5534
5698
|
var COLOR;
|
|
5535
5699
|
var init_color = __esm({
|
|
5536
|
-
"../../node_modules
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
BLACK
|
|
5540
|
-
RED
|
|
5541
|
-
GREEN
|
|
5542
|
-
YELLOW
|
|
5543
|
-
BLUE
|
|
5544
|
-
MAGENTA
|
|
5545
|
-
CYAN
|
|
5546
|
-
WHITE
|
|
5547
|
-
BRIGHT_BLACK
|
|
5548
|
-
BRIGHT_RED
|
|
5549
|
-
BRIGHT_GREEN
|
|
5550
|
-
BRIGHT_YELLOW
|
|
5551
|
-
BRIGHT_BLUE
|
|
5552
|
-
BRIGHT_MAGENTA
|
|
5553
|
-
BRIGHT_CYAN
|
|
5554
|
-
BRIGHT_WHITE
|
|
5555
|
-
};
|
|
5700
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
5701
|
+
init_esm5();
|
|
5702
|
+
(function(COLOR2) {
|
|
5703
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
5704
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
5705
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
5706
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
5707
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
5708
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
5709
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
5710
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
5711
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
5712
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
5713
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
5714
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
5715
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
5716
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
5717
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
5718
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
5719
|
+
})(COLOR || (COLOR = {}));
|
|
5556
5720
|
}
|
|
5557
5721
|
});
|
|
5558
5722
|
|
|
5559
|
-
// ../../node_modules
|
|
5560
|
-
function autobind(obj
|
|
5723
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
5724
|
+
function autobind(obj) {
|
|
5725
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
5561
5726
|
const proto = Object.getPrototypeOf(obj);
|
|
5562
5727
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
5563
5728
|
for (const key of propNames) {
|
|
@@ -5569,28 +5734,30 @@
|
|
|
5569
5734
|
}
|
|
5570
5735
|
}
|
|
5571
5736
|
var init_autobind = __esm({
|
|
5572
|
-
"../../node_modules
|
|
5737
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
5573
5738
|
}
|
|
5574
5739
|
});
|
|
5575
5740
|
|
|
5576
|
-
// ../../node_modules
|
|
5741
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
5577
5742
|
function assert4(condition, message) {
|
|
5578
5743
|
if (!condition) {
|
|
5579
5744
|
throw new Error(message || "Assertion failed");
|
|
5580
5745
|
}
|
|
5581
5746
|
}
|
|
5582
5747
|
var init_assert4 = __esm({
|
|
5583
|
-
"../../node_modules
|
|
5748
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
5584
5749
|
}
|
|
5585
5750
|
});
|
|
5586
5751
|
|
|
5587
|
-
// ../../node_modules
|
|
5752
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
5588
5753
|
function getHiResTimestamp2() {
|
|
5589
5754
|
let timestamp;
|
|
5590
|
-
if (
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5755
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
5756
|
+
var _window$performance, _window$performance$n;
|
|
5757
|
+
timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
5758
|
+
} else if ("hrtime" in process_) {
|
|
5759
|
+
var _process$hrtime;
|
|
5760
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
5594
5761
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
5595
5762
|
} else {
|
|
5596
5763
|
timestamp = Date.now();
|
|
@@ -5598,21 +5765,19 @@
|
|
|
5598
5765
|
return timestamp;
|
|
5599
5766
|
}
|
|
5600
5767
|
var init_hi_res_timestamp2 = __esm({
|
|
5601
|
-
"../../node_modules
|
|
5602
|
-
|
|
5768
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5769
|
+
init_esm5();
|
|
5603
5770
|
}
|
|
5604
5771
|
});
|
|
5605
5772
|
|
|
5606
|
-
//
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
function getTableHeader(table) {
|
|
5610
|
-
for (const key in table) {
|
|
5611
|
-
for (const title in table[key]) {
|
|
5612
|
-
return title || "untitled";
|
|
5613
|
-
}
|
|
5773
|
+
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
5774
|
+
var init_node_asciify_image = __esm({
|
|
5775
|
+
"(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
|
|
5614
5776
|
}
|
|
5615
|
-
|
|
5777
|
+
});
|
|
5778
|
+
|
|
5779
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
5780
|
+
function noop() {
|
|
5616
5781
|
}
|
|
5617
5782
|
function normalizeLogLevel(logLevel) {
|
|
5618
5783
|
if (!logLevel) {
|
|
@@ -5641,7 +5806,6 @@
|
|
|
5641
5806
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
5642
5807
|
while (args.length && args.shift() !== message) {
|
|
5643
5808
|
}
|
|
5644
|
-
opts.args = args;
|
|
5645
5809
|
switch (typeof logLevel) {
|
|
5646
5810
|
case "string":
|
|
5647
5811
|
case "function":
|
|
@@ -5660,7 +5824,9 @@
|
|
|
5660
5824
|
}
|
|
5661
5825
|
const messageType = typeof opts.message;
|
|
5662
5826
|
assert4(messageType === "string" || messageType === "object");
|
|
5663
|
-
return Object.assign(opts,
|
|
5827
|
+
return Object.assign(opts, {
|
|
5828
|
+
args
|
|
5829
|
+
}, opts.opts);
|
|
5664
5830
|
}
|
|
5665
5831
|
function decorateMessage(id, message, opts) {
|
|
5666
5832
|
if (typeof message === "string") {
|
|
@@ -5670,29 +5836,25 @@
|
|
|
5670
5836
|
}
|
|
5671
5837
|
return message;
|
|
5672
5838
|
}
|
|
5673
|
-
function logImageInNode({
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
fit: "box",
|
|
5686
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
5687
|
-
}).then((data) => console.log(data));
|
|
5688
|
-
}
|
|
5689
|
-
return noop2;
|
|
5839
|
+
function logImageInNode(_ref2) {
|
|
5840
|
+
let {
|
|
5841
|
+
image,
|
|
5842
|
+
message = "",
|
|
5843
|
+
scale: scale5 = 1
|
|
5844
|
+
} = _ref2;
|
|
5845
|
+
asciify.nodeAsciifyImage({
|
|
5846
|
+
image,
|
|
5847
|
+
message,
|
|
5848
|
+
scale: scale5
|
|
5849
|
+
});
|
|
5850
|
+
return noop;
|
|
5690
5851
|
}
|
|
5691
|
-
function logImageInBrowser({
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5852
|
+
function logImageInBrowser(_ref3) {
|
|
5853
|
+
let {
|
|
5854
|
+
image,
|
|
5855
|
+
message = "",
|
|
5856
|
+
scale: scale5 = 1
|
|
5857
|
+
} = _ref3;
|
|
5696
5858
|
if (typeof image === "string") {
|
|
5697
5859
|
const img = new Image();
|
|
5698
5860
|
img.onload = () => {
|
|
@@ -5700,33 +5862,43 @@
|
|
|
5700
5862
|
console.log(...args);
|
|
5701
5863
|
};
|
|
5702
5864
|
img.src = image;
|
|
5703
|
-
return
|
|
5865
|
+
return noop;
|
|
5704
5866
|
}
|
|
5705
5867
|
const element = image.nodeName || "";
|
|
5706
5868
|
if (element.toLowerCase() === "img") {
|
|
5707
5869
|
console.log(...formatImage(image, message, scale5));
|
|
5708
|
-
return
|
|
5870
|
+
return noop;
|
|
5709
5871
|
}
|
|
5710
5872
|
if (element.toLowerCase() === "canvas") {
|
|
5711
5873
|
const img = new Image();
|
|
5712
5874
|
img.onload = () => console.log(...formatImage(img, message, scale5));
|
|
5713
5875
|
img.src = image.toDataURL();
|
|
5714
|
-
return
|
|
5876
|
+
return noop;
|
|
5877
|
+
}
|
|
5878
|
+
return noop;
|
|
5879
|
+
}
|
|
5880
|
+
function getTableHeader(table) {
|
|
5881
|
+
for (const key in table) {
|
|
5882
|
+
for (const title in table[key]) {
|
|
5883
|
+
return title || "untitled";
|
|
5884
|
+
}
|
|
5715
5885
|
}
|
|
5716
|
-
return
|
|
5886
|
+
return "empty";
|
|
5717
5887
|
}
|
|
5718
5888
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
5719
5889
|
var init_log = __esm({
|
|
5720
|
-
"../../node_modules
|
|
5721
|
-
|
|
5890
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
5891
|
+
init_defineProperty();
|
|
5892
|
+
init_esm5();
|
|
5722
5893
|
init_local_storage();
|
|
5723
5894
|
init_formatters();
|
|
5724
5895
|
init_color();
|
|
5725
5896
|
init_autobind();
|
|
5726
5897
|
init_assert4();
|
|
5727
5898
|
init_hi_res_timestamp2();
|
|
5899
|
+
init_node_asciify_image();
|
|
5728
5900
|
originalConsole = {
|
|
5729
|
-
debug:
|
|
5901
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
5730
5902
|
log: console.log,
|
|
5731
5903
|
info: console.info,
|
|
5732
5904
|
warn: console.warn,
|
|
@@ -5741,16 +5913,20 @@
|
|
|
5741
5913
|
once: true
|
|
5742
5914
|
};
|
|
5743
5915
|
Log = class {
|
|
5744
|
-
constructor({
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5916
|
+
constructor() {
|
|
5917
|
+
let {
|
|
5918
|
+
id
|
|
5919
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
5920
|
+
id: ""
|
|
5921
|
+
};
|
|
5922
|
+
_defineProperty(this, "id", void 0);
|
|
5923
|
+
_defineProperty(this, "VERSION", VERSION2);
|
|
5924
|
+
_defineProperty(this, "_startTs", getHiResTimestamp2());
|
|
5925
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp2());
|
|
5926
|
+
_defineProperty(this, "_storage", void 0);
|
|
5927
|
+
_defineProperty(this, "userData", {});
|
|
5928
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
5749
5929
|
this.id = id;
|
|
5750
|
-
this.VERSION = VERSION2;
|
|
5751
|
-
this._startTs = getHiResTimestamp2();
|
|
5752
|
-
this._deltaTs = getHiResTimestamp2();
|
|
5753
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
5754
5930
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
5755
5931
|
this.userData = {};
|
|
5756
5932
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -5784,7 +5960,8 @@
|
|
|
5784
5960
|
getPriority() {
|
|
5785
5961
|
return this.level;
|
|
5786
5962
|
}
|
|
5787
|
-
enable(
|
|
5963
|
+
enable() {
|
|
5964
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
5788
5965
|
this._storage.updateConfiguration({
|
|
5789
5966
|
enabled
|
|
5790
5967
|
});
|
|
@@ -5796,6 +5973,21 @@
|
|
|
5796
5973
|
});
|
|
5797
5974
|
return this;
|
|
5798
5975
|
}
|
|
5976
|
+
get(setting) {
|
|
5977
|
+
return this._storage.config[setting];
|
|
5978
|
+
}
|
|
5979
|
+
set(setting, value) {
|
|
5980
|
+
this._storage.updateConfiguration({
|
|
5981
|
+
[setting]: value
|
|
5982
|
+
});
|
|
5983
|
+
}
|
|
5984
|
+
settings() {
|
|
5985
|
+
if (console.table) {
|
|
5986
|
+
console.table(this._storage.config);
|
|
5987
|
+
} else {
|
|
5988
|
+
console.log(this._storage.config);
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5799
5991
|
assert(condition, message) {
|
|
5800
5992
|
assert4(condition, message);
|
|
5801
5993
|
}
|
|
@@ -5824,27 +6016,31 @@
|
|
|
5824
6016
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
5825
6017
|
}
|
|
5826
6018
|
once(logLevel, message) {
|
|
6019
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6020
|
+
args[_key - 2] = arguments[_key];
|
|
6021
|
+
}
|
|
5827
6022
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
5828
6023
|
}
|
|
5829
6024
|
table(logLevel, table, columns) {
|
|
5830
6025
|
if (table) {
|
|
5831
|
-
return this._getLogFunction(logLevel, table, console.table ||
|
|
6026
|
+
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
5832
6027
|
tag: getTableHeader(table)
|
|
5833
6028
|
});
|
|
5834
6029
|
}
|
|
5835
|
-
return
|
|
6030
|
+
return noop;
|
|
5836
6031
|
}
|
|
5837
|
-
image({
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
6032
|
+
image(_ref) {
|
|
6033
|
+
let {
|
|
6034
|
+
logLevel,
|
|
6035
|
+
priority,
|
|
6036
|
+
image,
|
|
6037
|
+
message = "",
|
|
6038
|
+
scale: scale5 = 1
|
|
6039
|
+
} = _ref;
|
|
5844
6040
|
if (!this._shouldLog(logLevel || priority)) {
|
|
5845
|
-
return
|
|
6041
|
+
return noop;
|
|
5846
6042
|
}
|
|
5847
|
-
return
|
|
6043
|
+
return isBrowser3 ? logImageInBrowser({
|
|
5848
6044
|
image,
|
|
5849
6045
|
message,
|
|
5850
6046
|
scale: scale5
|
|
@@ -5854,34 +6050,20 @@
|
|
|
5854
6050
|
scale: scale5
|
|
5855
6051
|
});
|
|
5856
6052
|
}
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
console.table(this._storage.config);
|
|
5860
|
-
} else {
|
|
5861
|
-
console.log(this._storage.config);
|
|
5862
|
-
}
|
|
5863
|
-
}
|
|
5864
|
-
get(setting) {
|
|
5865
|
-
return this._storage.config[setting];
|
|
5866
|
-
}
|
|
5867
|
-
set(setting, value) {
|
|
5868
|
-
this._storage.updateConfiguration({
|
|
5869
|
-
[setting]: value
|
|
5870
|
-
});
|
|
5871
|
-
}
|
|
5872
|
-
time(logLevel, message) {
|
|
5873
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
6053
|
+
time(logLevel, message) {
|
|
6054
|
+
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
5874
6055
|
}
|
|
5875
6056
|
timeEnd(logLevel, message) {
|
|
5876
6057
|
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
5877
6058
|
}
|
|
5878
6059
|
timeStamp(logLevel, message) {
|
|
5879
|
-
return this._getLogFunction(logLevel, message, console.timeStamp ||
|
|
6060
|
+
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
5880
6061
|
}
|
|
5881
|
-
group(logLevel, message
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
6062
|
+
group(logLevel, message) {
|
|
6063
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
6064
|
+
collapsed: false
|
|
6065
|
+
};
|
|
6066
|
+
const options = normalizeArguments({
|
|
5885
6067
|
logLevel,
|
|
5886
6068
|
message,
|
|
5887
6069
|
opts
|
|
@@ -5889,16 +6071,17 @@
|
|
|
5889
6071
|
const {
|
|
5890
6072
|
collapsed
|
|
5891
6073
|
} = opts;
|
|
5892
|
-
|
|
5893
|
-
return this._getLogFunction(
|
|
6074
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
6075
|
+
return this._getLogFunction(options);
|
|
5894
6076
|
}
|
|
5895
|
-
groupCollapsed(logLevel, message
|
|
6077
|
+
groupCollapsed(logLevel, message) {
|
|
6078
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
5896
6079
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
5897
6080
|
collapsed: true
|
|
5898
6081
|
}));
|
|
5899
6082
|
}
|
|
5900
6083
|
groupEnd(logLevel) {
|
|
5901
|
-
return this._getLogFunction(logLevel, "", console.groupEnd ||
|
|
6084
|
+
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
5902
6085
|
}
|
|
5903
6086
|
withGroup(logLevel, message, func) {
|
|
5904
6087
|
this.group(logLevel, message)();
|
|
@@ -5916,7 +6099,7 @@
|
|
|
5916
6099
|
_shouldLog(logLevel) {
|
|
5917
6100
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
5918
6101
|
}
|
|
5919
|
-
_getLogFunction(logLevel, message, method, args
|
|
6102
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
5920
6103
|
if (this._shouldLog(logLevel)) {
|
|
5921
6104
|
opts = normalizeArguments({
|
|
5922
6105
|
logLevel,
|
|
@@ -5934,57 +6117,27 @@
|
|
|
5934
6117
|
if (!cache[tag]) {
|
|
5935
6118
|
cache[tag] = getHiResTimestamp2();
|
|
5936
6119
|
} else {
|
|
5937
|
-
return
|
|
6120
|
+
return noop;
|
|
5938
6121
|
}
|
|
5939
6122
|
}
|
|
5940
6123
|
message = decorateMessage(this.id, opts.message, opts);
|
|
5941
6124
|
return method.bind(console, message, ...opts.args);
|
|
5942
6125
|
}
|
|
5943
|
-
return
|
|
6126
|
+
return noop;
|
|
5944
6127
|
}
|
|
5945
6128
|
};
|
|
5946
|
-
Log
|
|
5947
|
-
}
|
|
5948
|
-
});
|
|
5949
|
-
|
|
5950
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
5951
|
-
var init_hi_res_timestamp3 = __esm({
|
|
5952
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5953
|
-
}
|
|
5954
|
-
});
|
|
5955
|
-
|
|
5956
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
5957
|
-
var init_stat2 = __esm({
|
|
5958
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
5959
|
-
init_hi_res_timestamp3();
|
|
6129
|
+
_defineProperty(Log, "VERSION", VERSION2);
|
|
5960
6130
|
}
|
|
5961
6131
|
});
|
|
5962
6132
|
|
|
5963
|
-
// ../../node_modules
|
|
5964
|
-
var init_stats2 = __esm({
|
|
5965
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
5966
|
-
init_stat2();
|
|
5967
|
-
}
|
|
5968
|
-
});
|
|
5969
|
-
|
|
5970
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
5971
|
-
var init_esm5 = __esm({
|
|
5972
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
5973
|
-
init_stats2();
|
|
5974
|
-
init_stat2();
|
|
5975
|
-
init_hi_res_timestamp3();
|
|
5976
|
-
}
|
|
5977
|
-
});
|
|
5978
|
-
|
|
5979
|
-
// ../../node_modules/probe.gl/dist/esm/index.js
|
|
6133
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
5980
6134
|
var esm_default;
|
|
5981
6135
|
var init_esm6 = __esm({
|
|
5982
|
-
"../../node_modules
|
|
6136
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
5983
6137
|
init_log();
|
|
5984
6138
|
init_log();
|
|
5985
|
-
init_esm5();
|
|
5986
6139
|
esm_default = new Log({
|
|
5987
|
-
id: "probe.gl"
|
|
6140
|
+
id: "@probe.gl/log"
|
|
5988
6141
|
});
|
|
5989
6142
|
}
|
|
5990
6143
|
});
|
|
@@ -6060,822 +6213,199 @@
|
|
|
6060
6213
|
};
|
|
6061
6214
|
REMOVED_LOADER_OPTIONS = {
|
|
6062
6215
|
throws: "nothrow",
|
|
6063
|
-
dataType: "(no longer used)",
|
|
6064
|
-
uri: "baseUri",
|
|
6065
|
-
method: "fetch.method",
|
|
6066
|
-
headers: "fetch.headers",
|
|
6067
|
-
body: "fetch.body",
|
|
6068
|
-
mode: "fetch.mode",
|
|
6069
|
-
credentials: "fetch.credentials",
|
|
6070
|
-
cache: "fetch.cache",
|
|
6071
|
-
redirect: "fetch.redirect",
|
|
6072
|
-
referrer: "fetch.referrer",
|
|
6073
|
-
referrerPolicy: "fetch.referrerPolicy",
|
|
6074
|
-
integrity: "fetch.integrity",
|
|
6075
|
-
keepalive: "fetch.keepalive",
|
|
6076
|
-
signal: "fetch.signal"
|
|
6077
|
-
};
|
|
6078
|
-
}
|
|
6079
|
-
});
|
|
6080
|
-
|
|
6081
|
-
// ../core/src/lib/loader-utils/option-utils.ts
|
|
6082
|
-
function getGlobalLoaderState() {
|
|
6083
|
-
globalThis.loaders = globalThis.loaders || {};
|
|
6084
|
-
const { loaders } = globalThis;
|
|
6085
|
-
loaders._state = loaders._state || {};
|
|
6086
|
-
return loaders._state;
|
|
6087
|
-
}
|
|
6088
|
-
function normalizeOptions(options, loader, loaders, url) {
|
|
6089
|
-
loaders = loaders || [];
|
|
6090
|
-
loaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
6091
|
-
validateOptions(options, loaders);
|
|
6092
|
-
return normalizeOptionsInternal(loader, options, url);
|
|
6093
|
-
}
|
|
6094
|
-
function getFetchFunction(options, context) {
|
|
6095
|
-
const globalOptions = getGlobalLoaderOptions();
|
|
6096
|
-
const fetchOptions = options || globalOptions;
|
|
6097
|
-
if (typeof fetchOptions.fetch === "function") {
|
|
6098
|
-
return fetchOptions.fetch;
|
|
6099
|
-
}
|
|
6100
|
-
if (isObject(fetchOptions.fetch)) {
|
|
6101
|
-
return (url) => fetchFile(url, fetchOptions);
|
|
6102
|
-
}
|
|
6103
|
-
if (context?.fetch) {
|
|
6104
|
-
return context?.fetch;
|
|
6105
|
-
}
|
|
6106
|
-
return fetchFile;
|
|
6107
|
-
}
|
|
6108
|
-
function validateOptions(options, loaders) {
|
|
6109
|
-
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
6110
|
-
for (const loader of loaders) {
|
|
6111
|
-
const idOptions = options && options[loader.id] || {};
|
|
6112
|
-
const loaderOptions = loader.options && loader.options[loader.id] || {};
|
|
6113
|
-
const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};
|
|
6114
|
-
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
6115
|
-
}
|
|
6116
|
-
}
|
|
6117
|
-
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
6118
|
-
const loaderName = id || "Top level";
|
|
6119
|
-
const prefix = id ? `${id}.` : "";
|
|
6120
|
-
for (const key in options) {
|
|
6121
|
-
const isSubOptions = !id && isObject(options[key]);
|
|
6122
|
-
const isBaseUriOption = key === "baseUri" && !id;
|
|
6123
|
-
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
6124
|
-
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
6125
|
-
if (key in deprecatedOptions) {
|
|
6126
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
6127
|
-
} else if (!isSubOptions) {
|
|
6128
|
-
const suggestion = findSimilarOption(key, loaders);
|
|
6129
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
6130
|
-
}
|
|
6131
|
-
}
|
|
6132
|
-
}
|
|
6133
|
-
}
|
|
6134
|
-
function findSimilarOption(optionKey, loaders) {
|
|
6135
|
-
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
6136
|
-
let bestSuggestion = "";
|
|
6137
|
-
for (const loader of loaders) {
|
|
6138
|
-
for (const key in loader.options) {
|
|
6139
|
-
if (optionKey === key) {
|
|
6140
|
-
return `Did you mean '${loader.id}.${key}'?`;
|
|
6141
|
-
}
|
|
6142
|
-
const lowerCaseKey = key.toLowerCase();
|
|
6143
|
-
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
6144
|
-
if (isPartialMatch) {
|
|
6145
|
-
bestSuggestion = bestSuggestion || `Did you mean '${loader.id}.${key}'?`;
|
|
6146
|
-
}
|
|
6147
|
-
}
|
|
6148
|
-
}
|
|
6149
|
-
return bestSuggestion;
|
|
6150
|
-
}
|
|
6151
|
-
function normalizeOptionsInternal(loader, options, url) {
|
|
6152
|
-
const loaderDefaultOptions = loader.options || {};
|
|
6153
|
-
const mergedOptions = { ...loaderDefaultOptions };
|
|
6154
|
-
addUrlOptions(mergedOptions, url);
|
|
6155
|
-
if (mergedOptions.log === null) {
|
|
6156
|
-
mergedOptions.log = new NullLog();
|
|
6157
|
-
}
|
|
6158
|
-
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
6159
|
-
mergeNestedFields(mergedOptions, options);
|
|
6160
|
-
return mergedOptions;
|
|
6161
|
-
}
|
|
6162
|
-
function mergeNestedFields(mergedOptions, options) {
|
|
6163
|
-
for (const key in options) {
|
|
6164
|
-
if (key in options) {
|
|
6165
|
-
const value = options[key];
|
|
6166
|
-
if (isPureObject(value) && isPureObject(mergedOptions[key])) {
|
|
6167
|
-
mergedOptions[key] = {
|
|
6168
|
-
...mergedOptions[key],
|
|
6169
|
-
...options[key]
|
|
6170
|
-
};
|
|
6171
|
-
} else {
|
|
6172
|
-
mergedOptions[key] = options[key];
|
|
6173
|
-
}
|
|
6174
|
-
}
|
|
6175
|
-
}
|
|
6176
|
-
}
|
|
6177
|
-
function addUrlOptions(options, url) {
|
|
6178
|
-
if (url && !("baseUri" in options)) {
|
|
6179
|
-
options.baseUri = url;
|
|
6180
|
-
}
|
|
6181
|
-
}
|
|
6182
|
-
var getGlobalLoaderOptions;
|
|
6183
|
-
var init_option_utils = __esm({
|
|
6184
|
-
"../core/src/lib/loader-utils/option-utils.ts"() {
|
|
6185
|
-
init_is_type();
|
|
6186
|
-
init_fetch_file();
|
|
6187
|
-
init_loggers();
|
|
6188
|
-
init_option_defaults();
|
|
6189
|
-
getGlobalLoaderOptions = () => {
|
|
6190
|
-
const state = getGlobalLoaderState();
|
|
6191
|
-
state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
|
|
6192
|
-
return state.globalOptions;
|
|
6193
|
-
};
|
|
6194
|
-
}
|
|
6195
|
-
});
|
|
6196
|
-
|
|
6197
|
-
// ../core/src/lib/loader-utils/normalize-loader.ts
|
|
6198
|
-
function isLoaderObject(loader) {
|
|
6199
|
-
if (!loader) {
|
|
6200
|
-
return false;
|
|
6201
|
-
}
|
|
6202
|
-
if (Array.isArray(loader)) {
|
|
6203
|
-
loader = loader[0];
|
|
6204
|
-
}
|
|
6205
|
-
const hasExtensions = Array.isArray(loader?.extensions);
|
|
6206
|
-
return hasExtensions;
|
|
6207
|
-
}
|
|
6208
|
-
function normalizeLoader(loader) {
|
|
6209
|
-
assert2(loader, "null loader");
|
|
6210
|
-
assert2(isLoaderObject(loader), "invalid loader");
|
|
6211
|
-
let options;
|
|
6212
|
-
if (Array.isArray(loader)) {
|
|
6213
|
-
options = loader[1];
|
|
6214
|
-
loader = loader[0];
|
|
6215
|
-
loader = {
|
|
6216
|
-
...loader,
|
|
6217
|
-
options: { ...loader.options, ...options }
|
|
6218
|
-
};
|
|
6219
|
-
}
|
|
6220
|
-
if (loader?.parseTextSync || loader?.parseText) {
|
|
6221
|
-
loader.text = true;
|
|
6222
|
-
}
|
|
6223
|
-
if (!loader.text) {
|
|
6224
|
-
loader.binary = true;
|
|
6225
|
-
}
|
|
6226
|
-
return loader;
|
|
6227
|
-
}
|
|
6228
|
-
var init_normalize_loader = __esm({
|
|
6229
|
-
"../core/src/lib/loader-utils/normalize-loader.ts"() {
|
|
6230
|
-
init_src2();
|
|
6231
|
-
}
|
|
6232
|
-
});
|
|
6233
|
-
|
|
6234
|
-
// ../core/src/lib/api/register-loaders.ts
|
|
6235
|
-
function getRegisteredLoaders() {
|
|
6236
|
-
return getGlobalLoaderRegistry();
|
|
6237
|
-
}
|
|
6238
|
-
var getGlobalLoaderRegistry;
|
|
6239
|
-
var init_register_loaders = __esm({
|
|
6240
|
-
"../core/src/lib/api/register-loaders.ts"() {
|
|
6241
|
-
init_option_utils();
|
|
6242
|
-
getGlobalLoaderRegistry = () => {
|
|
6243
|
-
const state = getGlobalLoaderState();
|
|
6244
|
-
state.loaderRegistry = state.loaderRegistry || [];
|
|
6245
|
-
return state.loaderRegistry;
|
|
6246
|
-
};
|
|
6247
|
-
}
|
|
6248
|
-
});
|
|
6249
|
-
|
|
6250
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
6251
|
-
function isElectron2(mockUserAgent) {
|
|
6252
|
-
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
6253
|
-
return true;
|
|
6254
|
-
}
|
|
6255
|
-
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
|
|
6256
|
-
return true;
|
|
6257
|
-
}
|
|
6258
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
6259
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
6260
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
6261
|
-
return true;
|
|
6262
|
-
}
|
|
6263
|
-
return false;
|
|
6264
|
-
}
|
|
6265
|
-
var init_is_electron2 = __esm({
|
|
6266
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
6267
|
-
}
|
|
6268
|
-
});
|
|
6269
|
-
|
|
6270
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
6271
|
-
function isBrowser5() {
|
|
6272
|
-
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
6273
|
-
return !isNode || isElectron2();
|
|
6274
|
-
}
|
|
6275
|
-
var init_is_browser2 = __esm({
|
|
6276
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
6277
|
-
init_is_electron2();
|
|
6278
|
-
}
|
|
6279
|
-
});
|
|
6280
|
-
|
|
6281
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
6282
|
-
var globals5, self_4, window_4, document_4, process_2;
|
|
6283
|
-
var init_globals5 = __esm({
|
|
6284
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
6285
|
-
globals5 = {
|
|
6286
|
-
self: typeof self !== "undefined" && self,
|
|
6287
|
-
window: typeof window !== "undefined" && window,
|
|
6288
|
-
global: typeof global !== "undefined" && global,
|
|
6289
|
-
document: typeof document !== "undefined" && document,
|
|
6290
|
-
process: typeof process === "object" && process
|
|
6291
|
-
};
|
|
6292
|
-
self_4 = globals5.self || globals5.window || globals5.global;
|
|
6293
|
-
window_4 = globals5.window || globals5.self || globals5.global;
|
|
6294
|
-
document_4 = globals5.document || {};
|
|
6295
|
-
process_2 = globals5.process || {};
|
|
6296
|
-
}
|
|
6297
|
-
});
|
|
6298
|
-
|
|
6299
|
-
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
6300
|
-
var VERSION3, isBrowser6;
|
|
6301
|
-
var init_globals6 = __esm({
|
|
6302
|
-
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
6303
|
-
init_is_browser2();
|
|
6304
|
-
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
6305
|
-
isBrowser6 = isBrowser5();
|
|
6306
|
-
}
|
|
6307
|
-
});
|
|
6308
|
-
|
|
6309
|
-
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
6310
|
-
var init_esm7 = __esm({
|
|
6311
|
-
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
6312
|
-
init_globals6();
|
|
6313
|
-
init_globals5();
|
|
6314
|
-
init_is_browser2();
|
|
6315
|
-
}
|
|
6316
|
-
});
|
|
6317
|
-
|
|
6318
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
6319
|
-
function getStorage2(type) {
|
|
6320
|
-
try {
|
|
6321
|
-
const storage = window[type];
|
|
6322
|
-
const x = "__storage_test__";
|
|
6323
|
-
storage.setItem(x, x);
|
|
6324
|
-
storage.removeItem(x);
|
|
6325
|
-
return storage;
|
|
6326
|
-
} catch (e) {
|
|
6327
|
-
return null;
|
|
6328
|
-
}
|
|
6329
|
-
}
|
|
6330
|
-
var LocalStorage2;
|
|
6331
|
-
var init_local_storage2 = __esm({
|
|
6332
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
6333
|
-
init_defineProperty();
|
|
6334
|
-
LocalStorage2 = class {
|
|
6335
|
-
constructor(id) {
|
|
6336
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6337
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
6338
|
-
_defineProperty(this, "storage", void 0);
|
|
6339
|
-
_defineProperty(this, "id", void 0);
|
|
6340
|
-
_defineProperty(this, "config", {});
|
|
6341
|
-
this.storage = getStorage2(type);
|
|
6342
|
-
this.id = id;
|
|
6343
|
-
this.config = {};
|
|
6344
|
-
Object.assign(this.config, defaultSettings);
|
|
6345
|
-
this._loadConfiguration();
|
|
6346
|
-
}
|
|
6347
|
-
getConfiguration() {
|
|
6348
|
-
return this.config;
|
|
6349
|
-
}
|
|
6350
|
-
setConfiguration(configuration) {
|
|
6351
|
-
this.config = {};
|
|
6352
|
-
return this.updateConfiguration(configuration);
|
|
6353
|
-
}
|
|
6354
|
-
updateConfiguration(configuration) {
|
|
6355
|
-
Object.assign(this.config, configuration);
|
|
6356
|
-
if (this.storage) {
|
|
6357
|
-
const serialized = JSON.stringify(this.config);
|
|
6358
|
-
this.storage.setItem(this.id, serialized);
|
|
6359
|
-
}
|
|
6360
|
-
return this;
|
|
6361
|
-
}
|
|
6362
|
-
_loadConfiguration() {
|
|
6363
|
-
let configuration = {};
|
|
6364
|
-
if (this.storage) {
|
|
6365
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
6366
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
6367
|
-
}
|
|
6368
|
-
Object.assign(this.config, configuration);
|
|
6369
|
-
return this;
|
|
6370
|
-
}
|
|
6371
|
-
};
|
|
6372
|
-
}
|
|
6373
|
-
});
|
|
6374
|
-
|
|
6375
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
6376
|
-
function formatTime2(ms) {
|
|
6377
|
-
let formatted;
|
|
6378
|
-
if (ms < 10) {
|
|
6379
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
6380
|
-
} else if (ms < 100) {
|
|
6381
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
6382
|
-
} else if (ms < 1e3) {
|
|
6383
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
6384
|
-
} else {
|
|
6385
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
6386
|
-
}
|
|
6387
|
-
return formatted;
|
|
6388
|
-
}
|
|
6389
|
-
function leftPad2(string) {
|
|
6390
|
-
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
6391
|
-
const padLength = Math.max(length4 - string.length, 0);
|
|
6392
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
6393
|
-
}
|
|
6394
|
-
function formatImage2(image, message, scale5) {
|
|
6395
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
6396
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
6397
|
-
if (image.width > maxWidth) {
|
|
6398
|
-
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
6399
|
-
}
|
|
6400
|
-
const width = image.width * scale5;
|
|
6401
|
-
const height = image.height * scale5;
|
|
6402
|
-
const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
|
|
6403
|
-
return ["".concat(message, " %c+"), style];
|
|
6404
|
-
}
|
|
6405
|
-
var init_formatters2 = __esm({
|
|
6406
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
6407
|
-
}
|
|
6408
|
-
});
|
|
6409
|
-
|
|
6410
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
6411
|
-
function getColor2(color) {
|
|
6412
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
6413
|
-
}
|
|
6414
|
-
function addColor2(string, color, background) {
|
|
6415
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
6416
|
-
if (color) {
|
|
6417
|
-
color = getColor2(color);
|
|
6418
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
6419
|
-
}
|
|
6420
|
-
if (background) {
|
|
6421
|
-
color = getColor2(background);
|
|
6422
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
6423
|
-
}
|
|
6424
|
-
}
|
|
6425
|
-
return string;
|
|
6426
|
-
}
|
|
6427
|
-
var COLOR2;
|
|
6428
|
-
var init_color2 = __esm({
|
|
6429
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
6430
|
-
init_esm7();
|
|
6431
|
-
(function(COLOR3) {
|
|
6432
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
6433
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
6434
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
6435
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
6436
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
6437
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
6438
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
6439
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
6440
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
6441
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
6442
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
6443
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
6444
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
6445
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
6446
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
6447
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
6448
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
6449
|
-
}
|
|
6450
|
-
});
|
|
6451
|
-
|
|
6452
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
6453
|
-
function autobind2(obj) {
|
|
6454
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
6455
|
-
const proto = Object.getPrototypeOf(obj);
|
|
6456
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
6457
|
-
for (const key of propNames) {
|
|
6458
|
-
if (typeof obj[key] === "function") {
|
|
6459
|
-
if (!predefined.find((name) => key === name)) {
|
|
6460
|
-
obj[key] = obj[key].bind(obj);
|
|
6461
|
-
}
|
|
6462
|
-
}
|
|
6463
|
-
}
|
|
6464
|
-
}
|
|
6465
|
-
var init_autobind2 = __esm({
|
|
6466
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
6467
|
-
}
|
|
6468
|
-
});
|
|
6469
|
-
|
|
6470
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
6471
|
-
function assert5(condition, message) {
|
|
6472
|
-
if (!condition) {
|
|
6473
|
-
throw new Error(message || "Assertion failed");
|
|
6474
|
-
}
|
|
6475
|
-
}
|
|
6476
|
-
var init_assert5 = __esm({
|
|
6477
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
6478
|
-
}
|
|
6479
|
-
});
|
|
6480
|
-
|
|
6481
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
6482
|
-
function getHiResTimestamp4() {
|
|
6483
|
-
let timestamp;
|
|
6484
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
6485
|
-
var _window$performance, _window$performance$n;
|
|
6486
|
-
timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
6487
|
-
} else if ("hrtime" in process_2) {
|
|
6488
|
-
var _process$hrtime;
|
|
6489
|
-
const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
|
|
6490
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
6491
|
-
} else {
|
|
6492
|
-
timestamp = Date.now();
|
|
6493
|
-
}
|
|
6494
|
-
return timestamp;
|
|
6495
|
-
}
|
|
6496
|
-
var init_hi_res_timestamp4 = __esm({
|
|
6497
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
6498
|
-
init_esm7();
|
|
6499
|
-
}
|
|
6500
|
-
});
|
|
6501
|
-
|
|
6502
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
6503
|
-
function noop3() {
|
|
6504
|
-
}
|
|
6505
|
-
function normalizeLogLevel2(logLevel) {
|
|
6506
|
-
if (!logLevel) {
|
|
6507
|
-
return 0;
|
|
6508
|
-
}
|
|
6509
|
-
let resolvedLevel;
|
|
6510
|
-
switch (typeof logLevel) {
|
|
6511
|
-
case "number":
|
|
6512
|
-
resolvedLevel = logLevel;
|
|
6513
|
-
break;
|
|
6514
|
-
case "object":
|
|
6515
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
6516
|
-
break;
|
|
6517
|
-
default:
|
|
6518
|
-
return 0;
|
|
6519
|
-
}
|
|
6520
|
-
assert5(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
6521
|
-
return resolvedLevel;
|
|
6522
|
-
}
|
|
6523
|
-
function normalizeArguments2(opts) {
|
|
6524
|
-
const {
|
|
6525
|
-
logLevel,
|
|
6526
|
-
message
|
|
6527
|
-
} = opts;
|
|
6528
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
6529
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
6530
|
-
while (args.length && args.shift() !== message) {
|
|
6531
|
-
}
|
|
6532
|
-
switch (typeof logLevel) {
|
|
6533
|
-
case "string":
|
|
6534
|
-
case "function":
|
|
6535
|
-
if (message !== void 0) {
|
|
6536
|
-
args.unshift(message);
|
|
6537
|
-
}
|
|
6538
|
-
opts.message = logLevel;
|
|
6539
|
-
break;
|
|
6540
|
-
case "object":
|
|
6541
|
-
Object.assign(opts, logLevel);
|
|
6542
|
-
break;
|
|
6543
|
-
default:
|
|
6544
|
-
}
|
|
6545
|
-
if (typeof opts.message === "function") {
|
|
6546
|
-
opts.message = opts.message();
|
|
6547
|
-
}
|
|
6548
|
-
const messageType = typeof opts.message;
|
|
6549
|
-
assert5(messageType === "string" || messageType === "object");
|
|
6550
|
-
return Object.assign(opts, {
|
|
6551
|
-
args
|
|
6552
|
-
}, opts.opts);
|
|
6553
|
-
}
|
|
6554
|
-
function decorateMessage2(id, message, opts) {
|
|
6555
|
-
if (typeof message === "string") {
|
|
6556
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
6557
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
6558
|
-
message = addColor2(message, opts.color, opts.background);
|
|
6559
|
-
}
|
|
6560
|
-
return message;
|
|
6561
|
-
}
|
|
6562
|
-
function logImageInNode2(_ref2) {
|
|
6563
|
-
let {
|
|
6564
|
-
image,
|
|
6565
|
-
message = "",
|
|
6566
|
-
scale: scale5 = 1
|
|
6567
|
-
} = _ref2;
|
|
6568
|
-
let asciify = null;
|
|
6569
|
-
try {
|
|
6570
|
-
asciify = module.require("asciify-image");
|
|
6571
|
-
} catch (error) {
|
|
6572
|
-
}
|
|
6573
|
-
if (asciify) {
|
|
6574
|
-
return () => asciify(image, {
|
|
6575
|
-
fit: "box",
|
|
6576
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
6577
|
-
}).then((data) => console.log(data));
|
|
6578
|
-
}
|
|
6579
|
-
return noop3;
|
|
6580
|
-
}
|
|
6581
|
-
function logImageInBrowser2(_ref3) {
|
|
6582
|
-
let {
|
|
6583
|
-
image,
|
|
6584
|
-
message = "",
|
|
6585
|
-
scale: scale5 = 1
|
|
6586
|
-
} = _ref3;
|
|
6587
|
-
if (typeof image === "string") {
|
|
6588
|
-
const img = new Image();
|
|
6589
|
-
img.onload = () => {
|
|
6590
|
-
const args = formatImage2(img, message, scale5);
|
|
6591
|
-
console.log(...args);
|
|
6592
|
-
};
|
|
6593
|
-
img.src = image;
|
|
6594
|
-
return noop3;
|
|
6595
|
-
}
|
|
6596
|
-
const element = image.nodeName || "";
|
|
6597
|
-
if (element.toLowerCase() === "img") {
|
|
6598
|
-
console.log(...formatImage2(image, message, scale5));
|
|
6599
|
-
return noop3;
|
|
6600
|
-
}
|
|
6601
|
-
if (element.toLowerCase() === "canvas") {
|
|
6602
|
-
const img = new Image();
|
|
6603
|
-
img.onload = () => console.log(...formatImage2(img, message, scale5));
|
|
6604
|
-
img.src = image.toDataURL();
|
|
6605
|
-
return noop3;
|
|
6606
|
-
}
|
|
6607
|
-
return noop3;
|
|
6608
|
-
}
|
|
6609
|
-
function getTableHeader2(table) {
|
|
6610
|
-
for (const key in table) {
|
|
6611
|
-
for (const title in table[key]) {
|
|
6612
|
-
return title || "untitled";
|
|
6613
|
-
}
|
|
6614
|
-
}
|
|
6615
|
-
return "empty";
|
|
6616
|
-
}
|
|
6617
|
-
var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
|
|
6618
|
-
var init_log2 = __esm({
|
|
6619
|
-
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
6620
|
-
init_defineProperty();
|
|
6621
|
-
init_esm7();
|
|
6622
|
-
init_local_storage2();
|
|
6623
|
-
init_formatters2();
|
|
6624
|
-
init_color2();
|
|
6625
|
-
init_autobind2();
|
|
6626
|
-
init_assert5();
|
|
6627
|
-
init_hi_res_timestamp4();
|
|
6628
|
-
originalConsole2 = {
|
|
6629
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
6630
|
-
log: console.log,
|
|
6631
|
-
info: console.info,
|
|
6632
|
-
warn: console.warn,
|
|
6633
|
-
error: console.error
|
|
6634
|
-
};
|
|
6635
|
-
DEFAULT_SETTINGS2 = {
|
|
6636
|
-
enabled: true,
|
|
6637
|
-
level: 0
|
|
6638
|
-
};
|
|
6639
|
-
cache2 = {};
|
|
6640
|
-
ONCE2 = {
|
|
6641
|
-
once: true
|
|
6642
|
-
};
|
|
6643
|
-
Log2 = class {
|
|
6644
|
-
constructor() {
|
|
6645
|
-
let {
|
|
6646
|
-
id
|
|
6647
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
6648
|
-
id: ""
|
|
6649
|
-
};
|
|
6650
|
-
_defineProperty(this, "id", void 0);
|
|
6651
|
-
_defineProperty(this, "VERSION", VERSION3);
|
|
6652
|
-
_defineProperty(this, "_startTs", getHiResTimestamp4());
|
|
6653
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp4());
|
|
6654
|
-
_defineProperty(this, "_storage", void 0);
|
|
6655
|
-
_defineProperty(this, "userData", {});
|
|
6656
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
6657
|
-
this.id = id;
|
|
6658
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
6659
|
-
this.userData = {};
|
|
6660
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
6661
|
-
autobind2(this);
|
|
6662
|
-
Object.seal(this);
|
|
6663
|
-
}
|
|
6664
|
-
set level(newLevel) {
|
|
6665
|
-
this.setLevel(newLevel);
|
|
6666
|
-
}
|
|
6667
|
-
get level() {
|
|
6668
|
-
return this.getLevel();
|
|
6669
|
-
}
|
|
6670
|
-
isEnabled() {
|
|
6671
|
-
return this._storage.config.enabled;
|
|
6672
|
-
}
|
|
6673
|
-
getLevel() {
|
|
6674
|
-
return this._storage.config.level;
|
|
6675
|
-
}
|
|
6676
|
-
getTotal() {
|
|
6677
|
-
return Number((getHiResTimestamp4() - this._startTs).toPrecision(10));
|
|
6678
|
-
}
|
|
6679
|
-
getDelta() {
|
|
6680
|
-
return Number((getHiResTimestamp4() - this._deltaTs).toPrecision(10));
|
|
6681
|
-
}
|
|
6682
|
-
set priority(newPriority) {
|
|
6683
|
-
this.level = newPriority;
|
|
6684
|
-
}
|
|
6685
|
-
get priority() {
|
|
6686
|
-
return this.level;
|
|
6687
|
-
}
|
|
6688
|
-
getPriority() {
|
|
6689
|
-
return this.level;
|
|
6690
|
-
}
|
|
6691
|
-
enable() {
|
|
6692
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
6693
|
-
this._storage.updateConfiguration({
|
|
6694
|
-
enabled
|
|
6695
|
-
});
|
|
6696
|
-
return this;
|
|
6697
|
-
}
|
|
6698
|
-
setLevel(level) {
|
|
6699
|
-
this._storage.updateConfiguration({
|
|
6700
|
-
level
|
|
6701
|
-
});
|
|
6702
|
-
return this;
|
|
6703
|
-
}
|
|
6704
|
-
get(setting) {
|
|
6705
|
-
return this._storage.config[setting];
|
|
6706
|
-
}
|
|
6707
|
-
set(setting, value) {
|
|
6708
|
-
this._storage.updateConfiguration({
|
|
6709
|
-
[setting]: value
|
|
6710
|
-
});
|
|
6711
|
-
}
|
|
6712
|
-
settings() {
|
|
6713
|
-
if (console.table) {
|
|
6714
|
-
console.table(this._storage.config);
|
|
6715
|
-
} else {
|
|
6716
|
-
console.log(this._storage.config);
|
|
6717
|
-
}
|
|
6718
|
-
}
|
|
6719
|
-
assert(condition, message) {
|
|
6720
|
-
assert5(condition, message);
|
|
6721
|
-
}
|
|
6722
|
-
warn(message) {
|
|
6723
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
6724
|
-
}
|
|
6725
|
-
error(message) {
|
|
6726
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
6727
|
-
}
|
|
6728
|
-
deprecated(oldUsage, newUsage) {
|
|
6729
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
6730
|
-
}
|
|
6731
|
-
removed(oldUsage, newUsage) {
|
|
6732
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
6733
|
-
}
|
|
6734
|
-
probe(logLevel, message) {
|
|
6735
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
6736
|
-
time: true,
|
|
6737
|
-
once: true
|
|
6738
|
-
});
|
|
6739
|
-
}
|
|
6740
|
-
log(logLevel, message) {
|
|
6741
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
6742
|
-
}
|
|
6743
|
-
info(logLevel, message) {
|
|
6744
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
6745
|
-
}
|
|
6746
|
-
once(logLevel, message) {
|
|
6747
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6748
|
-
args[_key - 2] = arguments[_key];
|
|
6749
|
-
}
|
|
6750
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
6751
|
-
}
|
|
6752
|
-
table(logLevel, table, columns) {
|
|
6753
|
-
if (table) {
|
|
6754
|
-
return this._getLogFunction(logLevel, table, console.table || noop3, columns && [columns], {
|
|
6755
|
-
tag: getTableHeader2(table)
|
|
6756
|
-
});
|
|
6757
|
-
}
|
|
6758
|
-
return noop3;
|
|
6759
|
-
}
|
|
6760
|
-
image(_ref) {
|
|
6761
|
-
let {
|
|
6762
|
-
logLevel,
|
|
6763
|
-
priority,
|
|
6764
|
-
image,
|
|
6765
|
-
message = "",
|
|
6766
|
-
scale: scale5 = 1
|
|
6767
|
-
} = _ref;
|
|
6768
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
6769
|
-
return noop3;
|
|
6770
|
-
}
|
|
6771
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
6772
|
-
image,
|
|
6773
|
-
message,
|
|
6774
|
-
scale: scale5
|
|
6775
|
-
}) : logImageInNode2({
|
|
6776
|
-
image,
|
|
6777
|
-
message,
|
|
6778
|
-
scale: scale5
|
|
6779
|
-
});
|
|
6780
|
-
}
|
|
6781
|
-
time(logLevel, message) {
|
|
6782
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
6216
|
+
dataType: "(no longer used)",
|
|
6217
|
+
uri: "baseUri",
|
|
6218
|
+
method: "fetch.method",
|
|
6219
|
+
headers: "fetch.headers",
|
|
6220
|
+
body: "fetch.body",
|
|
6221
|
+
mode: "fetch.mode",
|
|
6222
|
+
credentials: "fetch.credentials",
|
|
6223
|
+
cache: "fetch.cache",
|
|
6224
|
+
redirect: "fetch.redirect",
|
|
6225
|
+
referrer: "fetch.referrer",
|
|
6226
|
+
referrerPolicy: "fetch.referrerPolicy",
|
|
6227
|
+
integrity: "fetch.integrity",
|
|
6228
|
+
keepalive: "fetch.keepalive",
|
|
6229
|
+
signal: "fetch.signal"
|
|
6230
|
+
};
|
|
6231
|
+
}
|
|
6232
|
+
});
|
|
6233
|
+
|
|
6234
|
+
// ../core/src/lib/loader-utils/option-utils.ts
|
|
6235
|
+
function getGlobalLoaderState() {
|
|
6236
|
+
globalThis.loaders = globalThis.loaders || {};
|
|
6237
|
+
const { loaders } = globalThis;
|
|
6238
|
+
loaders._state = loaders._state || {};
|
|
6239
|
+
return loaders._state;
|
|
6240
|
+
}
|
|
6241
|
+
function normalizeOptions(options, loader, loaders, url) {
|
|
6242
|
+
loaders = loaders || [];
|
|
6243
|
+
loaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
6244
|
+
validateOptions(options, loaders);
|
|
6245
|
+
return normalizeOptionsInternal(loader, options, url);
|
|
6246
|
+
}
|
|
6247
|
+
function getFetchFunction(options, context) {
|
|
6248
|
+
const globalOptions = getGlobalLoaderOptions();
|
|
6249
|
+
const fetchOptions = options || globalOptions;
|
|
6250
|
+
if (typeof fetchOptions.fetch === "function") {
|
|
6251
|
+
return fetchOptions.fetch;
|
|
6252
|
+
}
|
|
6253
|
+
if (isObject(fetchOptions.fetch)) {
|
|
6254
|
+
return (url) => fetchFile(url, fetchOptions);
|
|
6255
|
+
}
|
|
6256
|
+
if (context?.fetch) {
|
|
6257
|
+
return context?.fetch;
|
|
6258
|
+
}
|
|
6259
|
+
return fetchFile;
|
|
6260
|
+
}
|
|
6261
|
+
function validateOptions(options, loaders) {
|
|
6262
|
+
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
6263
|
+
for (const loader of loaders) {
|
|
6264
|
+
const idOptions = options && options[loader.id] || {};
|
|
6265
|
+
const loaderOptions = loader.options && loader.options[loader.id] || {};
|
|
6266
|
+
const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};
|
|
6267
|
+
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6270
|
+
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
6271
|
+
const loaderName = id || "Top level";
|
|
6272
|
+
const prefix = id ? `${id}.` : "";
|
|
6273
|
+
for (const key in options) {
|
|
6274
|
+
const isSubOptions = !id && isObject(options[key]);
|
|
6275
|
+
const isBaseUriOption = key === "baseUri" && !id;
|
|
6276
|
+
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
6277
|
+
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
6278
|
+
if (key in deprecatedOptions) {
|
|
6279
|
+
probeLog.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
6280
|
+
} else if (!isSubOptions) {
|
|
6281
|
+
const suggestion = findSimilarOption(key, loaders);
|
|
6282
|
+
probeLog.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
6783
6283
|
}
|
|
6784
|
-
|
|
6785
|
-
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
}
|
|
6287
|
+
function findSimilarOption(optionKey, loaders) {
|
|
6288
|
+
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
6289
|
+
let bestSuggestion = "";
|
|
6290
|
+
for (const loader of loaders) {
|
|
6291
|
+
for (const key in loader.options) {
|
|
6292
|
+
if (optionKey === key) {
|
|
6293
|
+
return `Did you mean '${loader.id}.${key}'?`;
|
|
6786
6294
|
}
|
|
6787
|
-
|
|
6788
|
-
|
|
6295
|
+
const lowerCaseKey = key.toLowerCase();
|
|
6296
|
+
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
6297
|
+
if (isPartialMatch) {
|
|
6298
|
+
bestSuggestion = bestSuggestion || `Did you mean '${loader.id}.${key}'?`;
|
|
6789
6299
|
}
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
return bestSuggestion;
|
|
6303
|
+
}
|
|
6304
|
+
function normalizeOptionsInternal(loader, options, url) {
|
|
6305
|
+
const loaderDefaultOptions = loader.options || {};
|
|
6306
|
+
const mergedOptions = { ...loaderDefaultOptions };
|
|
6307
|
+
addUrlOptions(mergedOptions, url);
|
|
6308
|
+
if (mergedOptions.log === null) {
|
|
6309
|
+
mergedOptions.log = new NullLog();
|
|
6310
|
+
}
|
|
6311
|
+
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
6312
|
+
mergeNestedFields(mergedOptions, options);
|
|
6313
|
+
return mergedOptions;
|
|
6314
|
+
}
|
|
6315
|
+
function mergeNestedFields(mergedOptions, options) {
|
|
6316
|
+
for (const key in options) {
|
|
6317
|
+
if (key in options) {
|
|
6318
|
+
const value = options[key];
|
|
6319
|
+
if (isPureObject(value) && isPureObject(mergedOptions[key])) {
|
|
6320
|
+
mergedOptions[key] = {
|
|
6321
|
+
...mergedOptions[key],
|
|
6322
|
+
...options[key]
|
|
6793
6323
|
};
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
message,
|
|
6797
|
-
opts
|
|
6798
|
-
});
|
|
6799
|
-
const {
|
|
6800
|
-
collapsed
|
|
6801
|
-
} = opts;
|
|
6802
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
6803
|
-
return this._getLogFunction(options);
|
|
6804
|
-
}
|
|
6805
|
-
groupCollapsed(logLevel, message) {
|
|
6806
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6807
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
6808
|
-
collapsed: true
|
|
6809
|
-
}));
|
|
6810
|
-
}
|
|
6811
|
-
groupEnd(logLevel) {
|
|
6812
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop3);
|
|
6813
|
-
}
|
|
6814
|
-
withGroup(logLevel, message, func) {
|
|
6815
|
-
this.group(logLevel, message)();
|
|
6816
|
-
try {
|
|
6817
|
-
func();
|
|
6818
|
-
} finally {
|
|
6819
|
-
this.groupEnd(logLevel)();
|
|
6820
|
-
}
|
|
6821
|
-
}
|
|
6822
|
-
trace() {
|
|
6823
|
-
if (console.trace) {
|
|
6824
|
-
console.trace();
|
|
6825
|
-
}
|
|
6826
|
-
}
|
|
6827
|
-
_shouldLog(logLevel) {
|
|
6828
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
6829
|
-
}
|
|
6830
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
6831
|
-
if (this._shouldLog(logLevel)) {
|
|
6832
|
-
opts = normalizeArguments2({
|
|
6833
|
-
logLevel,
|
|
6834
|
-
message,
|
|
6835
|
-
args,
|
|
6836
|
-
opts
|
|
6837
|
-
});
|
|
6838
|
-
method = method || opts.method;
|
|
6839
|
-
assert5(method);
|
|
6840
|
-
opts.total = this.getTotal();
|
|
6841
|
-
opts.delta = this.getDelta();
|
|
6842
|
-
this._deltaTs = getHiResTimestamp4();
|
|
6843
|
-
const tag = opts.tag || opts.message;
|
|
6844
|
-
if (opts.once) {
|
|
6845
|
-
if (!cache2[tag]) {
|
|
6846
|
-
cache2[tag] = getHiResTimestamp4();
|
|
6847
|
-
} else {
|
|
6848
|
-
return noop3;
|
|
6849
|
-
}
|
|
6850
|
-
}
|
|
6851
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
6852
|
-
return method.bind(console, message, ...opts.args);
|
|
6853
|
-
}
|
|
6854
|
-
return noop3;
|
|
6324
|
+
} else {
|
|
6325
|
+
mergedOptions[key] = options[key];
|
|
6855
6326
|
}
|
|
6327
|
+
}
|
|
6328
|
+
}
|
|
6329
|
+
}
|
|
6330
|
+
function addUrlOptions(options, url) {
|
|
6331
|
+
if (url && !("baseUri" in options)) {
|
|
6332
|
+
options.baseUri = url;
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
var getGlobalLoaderOptions;
|
|
6336
|
+
var init_option_utils = __esm({
|
|
6337
|
+
"../core/src/lib/loader-utils/option-utils.ts"() {
|
|
6338
|
+
init_is_type();
|
|
6339
|
+
init_fetch_file();
|
|
6340
|
+
init_loggers();
|
|
6341
|
+
init_option_defaults();
|
|
6342
|
+
getGlobalLoaderOptions = () => {
|
|
6343
|
+
const state = getGlobalLoaderState();
|
|
6344
|
+
state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
|
|
6345
|
+
return state.globalOptions;
|
|
6856
6346
|
};
|
|
6857
|
-
_defineProperty(Log2, "VERSION", VERSION3);
|
|
6858
6347
|
}
|
|
6859
6348
|
});
|
|
6860
6349
|
|
|
6861
|
-
//
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6350
|
+
// ../core/src/lib/loader-utils/normalize-loader.ts
|
|
6351
|
+
function isLoaderObject(loader) {
|
|
6352
|
+
if (!loader) {
|
|
6353
|
+
return false;
|
|
6354
|
+
}
|
|
6355
|
+
if (Array.isArray(loader)) {
|
|
6356
|
+
loader = loader[0];
|
|
6357
|
+
}
|
|
6358
|
+
const hasExtensions = Array.isArray(loader?.extensions);
|
|
6359
|
+
return hasExtensions;
|
|
6360
|
+
}
|
|
6361
|
+
function normalizeLoader(loader) {
|
|
6362
|
+
assert2(loader, "null loader");
|
|
6363
|
+
assert2(isLoaderObject(loader), "invalid loader");
|
|
6364
|
+
let options;
|
|
6365
|
+
if (Array.isArray(loader)) {
|
|
6366
|
+
options = loader[1];
|
|
6367
|
+
loader = loader[0];
|
|
6368
|
+
loader = {
|
|
6369
|
+
...loader,
|
|
6370
|
+
options: { ...loader.options, ...options }
|
|
6371
|
+
};
|
|
6372
|
+
}
|
|
6373
|
+
if (loader?.parseTextSync || loader?.parseText) {
|
|
6374
|
+
loader.text = true;
|
|
6375
|
+
}
|
|
6376
|
+
if (!loader.text) {
|
|
6377
|
+
loader.binary = true;
|
|
6378
|
+
}
|
|
6379
|
+
return loader;
|
|
6380
|
+
}
|
|
6381
|
+
var init_normalize_loader = __esm({
|
|
6382
|
+
"../core/src/lib/loader-utils/normalize-loader.ts"() {
|
|
6383
|
+
init_src2();
|
|
6384
|
+
}
|
|
6385
|
+
});
|
|
6386
|
+
|
|
6387
|
+
// ../core/src/lib/api/register-loaders.ts
|
|
6388
|
+
function getRegisteredLoaders() {
|
|
6389
|
+
return getGlobalLoaderRegistry();
|
|
6390
|
+
}
|
|
6391
|
+
var getGlobalLoaderRegistry;
|
|
6392
|
+
var init_register_loaders = __esm({
|
|
6393
|
+
"../core/src/lib/api/register-loaders.ts"() {
|
|
6394
|
+
init_option_utils();
|
|
6395
|
+
getGlobalLoaderRegistry = () => {
|
|
6396
|
+
const state = getGlobalLoaderState();
|
|
6397
|
+
state.loaderRegistry = state.loaderRegistry || [];
|
|
6398
|
+
return state.loaderRegistry;
|
|
6399
|
+
};
|
|
6870
6400
|
}
|
|
6871
6401
|
});
|
|
6872
6402
|
|
|
6873
6403
|
// ../core/src/lib/utils/log.ts
|
|
6874
6404
|
var log;
|
|
6875
|
-
var
|
|
6405
|
+
var init_log2 = __esm({
|
|
6876
6406
|
"../core/src/lib/utils/log.ts"() {
|
|
6877
|
-
|
|
6878
|
-
log = new
|
|
6407
|
+
init_esm6();
|
|
6408
|
+
log = new Log({ id: "loaders.gl" });
|
|
6879
6409
|
}
|
|
6880
6410
|
});
|
|
6881
6411
|
|
|
@@ -7064,7 +6594,7 @@
|
|
|
7064
6594
|
"../core/src/lib/api/select-loader.ts"() {
|
|
7065
6595
|
init_src2();
|
|
7066
6596
|
init_normalize_loader();
|
|
7067
|
-
|
|
6597
|
+
init_log2();
|
|
7068
6598
|
init_resource_utils();
|
|
7069
6599
|
init_register_loaders();
|
|
7070
6600
|
init_is_type();
|
|
@@ -7738,7 +7268,7 @@
|
|
|
7738
7268
|
this.requestedTiles = {};
|
|
7739
7269
|
this.emptyTiles = {};
|
|
7740
7270
|
}
|
|
7741
|
-
|
|
7271
|
+
traversalFinished(frameState) {
|
|
7742
7272
|
return true;
|
|
7743
7273
|
}
|
|
7744
7274
|
traverse(root, frameState, options) {
|
|
@@ -7789,7 +7319,7 @@
|
|
|
7789
7319
|
tile._shouldRefine = shouldRefine && parentRefines;
|
|
7790
7320
|
}
|
|
7791
7321
|
const newTime = new Date().getTime();
|
|
7792
|
-
if (this.traversalFinished || newTime - this.lastUpdate > this.updateDebounceTime) {
|
|
7322
|
+
if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {
|
|
7793
7323
|
this.lastUpdate = newTime;
|
|
7794
7324
|
this.options.onTraversalEnd(frameState);
|
|
7795
7325
|
}
|
|
@@ -8007,6 +7537,7 @@
|
|
|
8007
7537
|
this._lodJudge = null;
|
|
8008
7538
|
this._expireDate = null;
|
|
8009
7539
|
this._expiredContent = null;
|
|
7540
|
+
this.implicitTiling = null;
|
|
8010
7541
|
Object.seal(this);
|
|
8011
7542
|
}
|
|
8012
7543
|
destroy() {
|
|
@@ -8295,8 +7826,20 @@
|
|
|
8295
7826
|
case "i3s":
|
|
8296
7827
|
return {
|
|
8297
7828
|
...this.tileset.options.i3s,
|
|
8298
|
-
|
|
8299
|
-
|
|
7829
|
+
_tileOptions: {
|
|
7830
|
+
attributeUrls: this.header.attributeUrls,
|
|
7831
|
+
textureUrl: this.header.textureUrl,
|
|
7832
|
+
textureFormat: this.header.textureFormat,
|
|
7833
|
+
textureLoaderOptions: this.header.textureLoaderOptions,
|
|
7834
|
+
materialDefinition: this.header.materialDefinition,
|
|
7835
|
+
isDracoGeometry: this.header.isDracoGeometry,
|
|
7836
|
+
mbs: this.header.mbs
|
|
7837
|
+
},
|
|
7838
|
+
_tilesetOptions: {
|
|
7839
|
+
store: this.tileset.tileset.store,
|
|
7840
|
+
attributeStorageInfo: this.tileset.tileset.attributeStorageInfo,
|
|
7841
|
+
fields: this.tileset.tileset.fields
|
|
7842
|
+
},
|
|
8300
7843
|
isTileHeader: false
|
|
8301
7844
|
};
|
|
8302
7845
|
case "3d-tiles":
|
|
@@ -8355,24 +7898,30 @@
|
|
|
8355
7898
|
}
|
|
8356
7899
|
});
|
|
8357
7900
|
|
|
8358
|
-
// src/tileset/traversers/i3s-
|
|
7901
|
+
// src/tileset/traversers/i3s-pending-tiles-register.ts
|
|
8359
7902
|
var I3SPendingTilesRegister;
|
|
8360
|
-
var
|
|
8361
|
-
"src/tileset/traversers/i3s-
|
|
7903
|
+
var init_i3s_pending_tiles_register = __esm({
|
|
7904
|
+
"src/tileset/traversers/i3s-pending-tiles-register.ts"() {
|
|
8362
7905
|
I3SPendingTilesRegister = class {
|
|
8363
7906
|
constructor() {
|
|
8364
7907
|
this.frameNumberMap = new Map();
|
|
8365
7908
|
}
|
|
8366
|
-
register(frameNumber) {
|
|
8367
|
-
const
|
|
8368
|
-
|
|
7909
|
+
register(viewportId, frameNumber) {
|
|
7910
|
+
const viewportMap = this.frameNumberMap.get(viewportId) || new Map();
|
|
7911
|
+
const oldCount = viewportMap.get(frameNumber) || 0;
|
|
7912
|
+
viewportMap.set(frameNumber, oldCount + 1);
|
|
7913
|
+
this.frameNumberMap.set(viewportId, viewportMap);
|
|
8369
7914
|
}
|
|
8370
|
-
deregister(frameNumber) {
|
|
8371
|
-
const
|
|
8372
|
-
|
|
7915
|
+
deregister(viewportId, frameNumber) {
|
|
7916
|
+
const viewportMap = this.frameNumberMap.get(viewportId);
|
|
7917
|
+
if (!viewportMap) {
|
|
7918
|
+
return;
|
|
7919
|
+
}
|
|
7920
|
+
const oldCount = viewportMap.get(frameNumber) || 1;
|
|
7921
|
+
viewportMap.set(frameNumber, oldCount - 1);
|
|
8373
7922
|
}
|
|
8374
|
-
isZero(frameNumber) {
|
|
8375
|
-
const count = this.frameNumberMap.get(frameNumber) || 0;
|
|
7923
|
+
isZero(viewportId, frameNumber) {
|
|
7924
|
+
const count = this.frameNumberMap.get(viewportId)?.get(frameNumber) || 0;
|
|
8376
7925
|
return count === 0;
|
|
8377
7926
|
}
|
|
8378
7927
|
};
|
|
@@ -8383,7 +7932,7 @@
|
|
|
8383
7932
|
var STATUS, I3STileManager;
|
|
8384
7933
|
var init_i3s_tile_manager = __esm({
|
|
8385
7934
|
"src/tileset/traversers/i3s-tile-manager.ts"() {
|
|
8386
|
-
|
|
7935
|
+
init_i3s_pending_tiles_register();
|
|
8387
7936
|
STATUS = {
|
|
8388
7937
|
REQUESTED: "REQUESTED",
|
|
8389
7938
|
COMPLETED: "COMPLETED",
|
|
@@ -8396,34 +7945,51 @@
|
|
|
8396
7945
|
}
|
|
8397
7946
|
add(request, key, callback, frameState) {
|
|
8398
7947
|
if (!this._statusMap[key]) {
|
|
8399
|
-
const {
|
|
7948
|
+
const {
|
|
7949
|
+
frameNumber,
|
|
7950
|
+
viewport: { id }
|
|
7951
|
+
} = frameState;
|
|
8400
7952
|
this._statusMap[key] = { request, callback, key, frameState, status: STATUS.REQUESTED };
|
|
8401
|
-
this.pendingTilesRegister.register(frameNumber);
|
|
7953
|
+
this.pendingTilesRegister.register(id, frameNumber);
|
|
8402
7954
|
request().then((data) => {
|
|
8403
7955
|
this._statusMap[key].status = STATUS.COMPLETED;
|
|
8404
|
-
const {
|
|
8405
|
-
|
|
7956
|
+
const {
|
|
7957
|
+
frameNumber: actualFrameNumber,
|
|
7958
|
+
viewport: { id: id2 }
|
|
7959
|
+
} = this._statusMap[key].frameState;
|
|
7960
|
+
this.pendingTilesRegister.deregister(id2, actualFrameNumber);
|
|
8406
7961
|
this._statusMap[key].callback(data, frameState);
|
|
8407
7962
|
}).catch((error) => {
|
|
8408
7963
|
this._statusMap[key].status = STATUS.ERROR;
|
|
8409
|
-
const {
|
|
8410
|
-
|
|
7964
|
+
const {
|
|
7965
|
+
frameNumber: actualFrameNumber,
|
|
7966
|
+
viewport: { id: id2 }
|
|
7967
|
+
} = this._statusMap[key].frameState;
|
|
7968
|
+
this.pendingTilesRegister.deregister(id2, actualFrameNumber);
|
|
8411
7969
|
callback(error);
|
|
8412
7970
|
});
|
|
8413
7971
|
}
|
|
8414
7972
|
}
|
|
8415
7973
|
update(key, frameState) {
|
|
8416
7974
|
if (this._statusMap[key]) {
|
|
8417
|
-
|
|
8418
|
-
|
|
7975
|
+
const {
|
|
7976
|
+
frameNumber,
|
|
7977
|
+
viewport: { id }
|
|
7978
|
+
} = this._statusMap[key].frameState;
|
|
7979
|
+
this.pendingTilesRegister.deregister(id, frameNumber);
|
|
7980
|
+
const {
|
|
7981
|
+
frameNumber: newFrameNumber,
|
|
7982
|
+
viewport: { id: newViewportId }
|
|
7983
|
+
} = frameState;
|
|
7984
|
+
this.pendingTilesRegister.register(newViewportId, newFrameNumber);
|
|
8419
7985
|
this._statusMap[key].frameState = frameState;
|
|
8420
7986
|
}
|
|
8421
7987
|
}
|
|
8422
7988
|
find(key) {
|
|
8423
7989
|
return this._statusMap[key];
|
|
8424
7990
|
}
|
|
8425
|
-
hasPendingTiles(frameNumber) {
|
|
8426
|
-
return !this.pendingTilesRegister.isZero(frameNumber);
|
|
7991
|
+
hasPendingTiles(viewportId, frameNumber) {
|
|
7992
|
+
return !this.pendingTilesRegister.isZero(viewportId, frameNumber);
|
|
8427
7993
|
}
|
|
8428
7994
|
};
|
|
8429
7995
|
}
|
|
@@ -8439,8 +8005,8 @@
|
|
|
8439
8005
|
init_tile_3d();
|
|
8440
8006
|
init_i3s_tile_manager();
|
|
8441
8007
|
I3STilesetTraverser = class extends TilesetTraverser {
|
|
8442
|
-
|
|
8443
|
-
return !this._tileManager.hasPendingTiles(this._frameNumber || 0);
|
|
8008
|
+
traversalFinished(frameState) {
|
|
8009
|
+
return !this._tileManager.hasPendingTiles(frameState.viewport.id, this._frameNumber || 0);
|
|
8444
8010
|
}
|
|
8445
8011
|
constructor(options) {
|
|
8446
8012
|
super(options);
|
|
@@ -8481,8 +8047,7 @@
|
|
|
8481
8047
|
...tileset.loadOptions,
|
|
8482
8048
|
i3s: {
|
|
8483
8049
|
...tileset.loadOptions.i3s,
|
|
8484
|
-
isTileHeader: true
|
|
8485
|
-
loadContent: false
|
|
8050
|
+
isTileHeader: true
|
|
8486
8051
|
}
|
|
8487
8052
|
};
|
|
8488
8053
|
return await load(nodeUrl, loader, options);
|
|
@@ -8492,7 +8057,7 @@
|
|
|
8492
8057
|
tile.children.push(childTile);
|
|
8493
8058
|
const frameState = this._tileManager.find(childTile.id).frameState;
|
|
8494
8059
|
this.updateTile(childTile, frameState);
|
|
8495
|
-
if (this._frameNumber === frameState.frameNumber && (this.traversalFinished || new Date().getTime() - this.lastUpdate > this.updateDebounceTime)) {
|
|
8060
|
+
if (this._frameNumber === frameState.frameNumber && (this.traversalFinished(frameState) || new Date().getTime() - this.lastUpdate > this.updateDebounceTime)) {
|
|
8496
8061
|
this.executeTraversal(childTile, frameState);
|
|
8497
8062
|
}
|
|
8498
8063
|
}
|
|
@@ -8570,6 +8135,7 @@
|
|
|
8570
8135
|
TILES_GPU_MEMORY = "Tile Memory Use";
|
|
8571
8136
|
Tileset3D = class {
|
|
8572
8137
|
constructor(json, options) {
|
|
8138
|
+
this.contentFormats = { draco: false, meshopt: false, dds: false, ktx2: false };
|
|
8573
8139
|
this.updatePromise = null;
|
|
8574
8140
|
assert2(json);
|
|
8575
8141
|
this.options = { ...DEFAULT_PROPS4, ...options };
|
|
@@ -8661,7 +8227,9 @@
|
|
|
8661
8227
|
} else {
|
|
8662
8228
|
this.lastUpdatedVieports = viewports;
|
|
8663
8229
|
}
|
|
8664
|
-
|
|
8230
|
+
if (viewports) {
|
|
8231
|
+
this.doUpdate(viewports);
|
|
8232
|
+
}
|
|
8665
8233
|
});
|
|
8666
8234
|
}
|
|
8667
8235
|
async selectTiles(viewports = null) {
|
|
@@ -8672,7 +8240,9 @@
|
|
|
8672
8240
|
if (!this.updatePromise) {
|
|
8673
8241
|
this.updatePromise = new Promise((resolve) => {
|
|
8674
8242
|
setTimeout(() => {
|
|
8675
|
-
|
|
8243
|
+
if (this.lastUpdatedVieports) {
|
|
8244
|
+
this.doUpdate(this.lastUpdatedVieports);
|
|
8245
|
+
}
|
|
8676
8246
|
resolve(this._frameNumber);
|
|
8677
8247
|
this.updatePromise = null;
|
|
8678
8248
|
}, this.options.debounceTime);
|
|
@@ -8680,21 +8250,19 @@
|
|
|
8680
8250
|
}
|
|
8681
8251
|
return this.updatePromise;
|
|
8682
8252
|
}
|
|
8683
|
-
doUpdate(viewports
|
|
8253
|
+
doUpdate(viewports) {
|
|
8684
8254
|
if ("loadTiles" in this.options && !this.options.loadTiles) {
|
|
8685
8255
|
return;
|
|
8686
8256
|
}
|
|
8687
8257
|
if (this.traverseCounter > 0) {
|
|
8688
8258
|
return;
|
|
8689
8259
|
}
|
|
8690
|
-
|
|
8691
|
-
viewports = [viewports];
|
|
8692
|
-
}
|
|
8260
|
+
const preparedViewports = viewports instanceof Array ? viewports : [viewports];
|
|
8693
8261
|
this._cache.reset();
|
|
8694
8262
|
this._frameNumber++;
|
|
8695
|
-
this.traverseCounter =
|
|
8263
|
+
this.traverseCounter = preparedViewports.length;
|
|
8696
8264
|
const viewportsToTraverse = [];
|
|
8697
|
-
for (const viewport of
|
|
8265
|
+
for (const viewport of preparedViewports) {
|
|
8698
8266
|
const id = viewport.id;
|
|
8699
8267
|
if (this._needTraverse(id)) {
|
|
8700
8268
|
viewportsToTraverse.push(id);
|
|
@@ -8702,7 +8270,7 @@
|
|
|
8702
8270
|
this.traverseCounter--;
|
|
8703
8271
|
}
|
|
8704
8272
|
}
|
|
8705
|
-
for (const viewport of
|
|
8273
|
+
for (const viewport of preparedViewports) {
|
|
8706
8274
|
const id = viewport.id;
|
|
8707
8275
|
if (!this.roots[id]) {
|
|
8708
8276
|
this.roots[id] = this._initializeTileHeaders(this.tileset, null);
|
|
@@ -8862,7 +8430,7 @@
|
|
|
8862
8430
|
this.stats.get(TILES_LOADED);
|
|
8863
8431
|
this.stats.get(TILES_UNLOADED);
|
|
8864
8432
|
this.stats.get(TILES_LOAD_FAILED);
|
|
8865
|
-
this.stats.get(POINTS_COUNT
|
|
8433
|
+
this.stats.get(POINTS_COUNT);
|
|
8866
8434
|
this.stats.get(TILES_GPU_MEMORY, "memory");
|
|
8867
8435
|
}
|
|
8868
8436
|
_initializeTileHeaders(tilesetJson, parentTileHeader) {
|
|
@@ -8940,9 +8508,37 @@
|
|
|
8940
8508
|
if (tile && tile.content) {
|
|
8941
8509
|
calculateTransformProps(tile, tile.content);
|
|
8942
8510
|
}
|
|
8511
|
+
this.updateContentTypes(tile);
|
|
8943
8512
|
this._addTileToCache(tile);
|
|
8944
8513
|
this.options.onTileLoad(tile);
|
|
8945
8514
|
}
|
|
8515
|
+
updateContentTypes(tile) {
|
|
8516
|
+
if (this.type === TILESET_TYPE.I3S) {
|
|
8517
|
+
if (tile.header.isDracoGeometry) {
|
|
8518
|
+
this.contentFormats.draco = true;
|
|
8519
|
+
}
|
|
8520
|
+
switch (tile.header.textureFormat) {
|
|
8521
|
+
case "dds":
|
|
8522
|
+
this.contentFormats.dds = true;
|
|
8523
|
+
break;
|
|
8524
|
+
case "ktx2":
|
|
8525
|
+
this.contentFormats.ktx2 = true;
|
|
8526
|
+
break;
|
|
8527
|
+
default:
|
|
8528
|
+
}
|
|
8529
|
+
} else if (this.type === TILESET_TYPE.TILES3D) {
|
|
8530
|
+
const { extensionsRemoved = [] } = tile.content?.gltf || {};
|
|
8531
|
+
if (extensionsRemoved.includes("KHR_draco_mesh_compression")) {
|
|
8532
|
+
this.contentFormats.draco = true;
|
|
8533
|
+
}
|
|
8534
|
+
if (extensionsRemoved.includes("EXT_meshopt_compression")) {
|
|
8535
|
+
this.contentFormats.meshopt = true;
|
|
8536
|
+
}
|
|
8537
|
+
if (extensionsRemoved.includes("KHR_texture_basisu")) {
|
|
8538
|
+
this.contentFormats.ktx2 = true;
|
|
8539
|
+
}
|
|
8540
|
+
}
|
|
8541
|
+
}
|
|
8946
8542
|
_onStartTileLoading() {
|
|
8947
8543
|
this._pendingCount++;
|
|
8948
8544
|
this.stats.get(TILES_LOADING).incrementCount();
|
|
@@ -9064,10 +8660,10 @@
|
|
|
9064
8660
|
|
|
9065
8661
|
// src/bundle.ts
|
|
9066
8662
|
var require_bundle = __commonJS({
|
|
9067
|
-
"src/bundle.ts"(exports,
|
|
8663
|
+
"src/bundle.ts"(exports, module) {
|
|
9068
8664
|
var moduleExports = (init_src4(), src_exports);
|
|
9069
8665
|
globalThis.loaders = globalThis.loaders || {};
|
|
9070
|
-
|
|
8666
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
9071
8667
|
}
|
|
9072
8668
|
});
|
|
9073
8669
|
require_bundle();
|