@loaders.gl/tiles 3.2.12 → 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 +951 -1387
- 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 +22 -42
- 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 +119 -96
- package/dist/es5/tileset/tile-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-3d.js +119 -185
- 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-pending-tiles-register.js +8 -13
- package/dist/es5/tileset/traversers/i3s-pending-tiles-register.js.map +1 -1
- package/dist/es5/tileset/traversers/i3s-tile-manager.js +20 -24
- package/dist/es5/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/es5/tileset/traversers/i3s-tileset-traverser.js +8 -50
- 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 +53 -76
- 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 +16 -16
- 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 +55 -108
- package/dist/esm/tileset/tile-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-3d.js +58 -154
- 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 +0 -5
- package/dist/esm/tileset/traversers/i3s-pending-tiles-register.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-tile-manager.js +2 -4
- package/dist/esm/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-tileset-traverser.js +5 -19
- 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 +18 -57
- 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 +1 -1
- package/dist/tileset/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset/helpers/frame-state.js +1 -1
- package/dist/tileset/tile-3d.d.ts +24 -5
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +27 -2
- package/dist/tileset/tileset-3d.d.ts +14 -2
- package/dist/tileset/tileset-3d.d.ts.map +1 -1
- package/dist/tileset/tileset-3d.js +35 -0
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/i3s-tileset-traverser.js +5 -6
- package/dist/tileset/traversers/tileset-traverser.d.ts +2 -2
- package/dist/tileset/traversers/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/tileset-traverser.js +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/tileset/helpers/frame-state.ts +1 -1
- package/src/tileset/tile-3d.ts +31 -4
- package/src/tileset/tileset-3d.ts +36 -0
- package/src/tileset/traversers/i3s-tileset-traverser.ts +1 -2
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;
|
|
@@ -3469,7 +3601,7 @@
|
|
|
3469
3601
|
var DEFAULT_VERSION, VERSION;
|
|
3470
3602
|
var init_version = __esm({
|
|
3471
3603
|
"../worker-utils/src/lib/env-utils/version.ts"() {
|
|
3472
|
-
DEFAULT_VERSION = "
|
|
3604
|
+
DEFAULT_VERSION = "beta";
|
|
3473
3605
|
VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
3474
3606
|
if (typeof __VERSION__ === "undefined") {
|
|
3475
3607
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
@@ -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);
|
|
@@ -3940,7 +4072,7 @@
|
|
|
3940
4072
|
var init_get_worker_url = __esm({
|
|
3941
4073
|
"../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
|
|
3942
4074
|
init_assert3();
|
|
3943
|
-
NPM_TAG = "
|
|
4075
|
+
NPM_TAG = "beta";
|
|
3944
4076
|
}
|
|
3945
4077
|
});
|
|
3946
4078
|
|
|
@@ -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
|
|
|
@@ -5382,7 +5518,7 @@
|
|
|
5382
5518
|
}
|
|
5383
5519
|
});
|
|
5384
5520
|
|
|
5385
|
-
// ../../node_modules
|
|
5521
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
5386
5522
|
function isElectron(mockUserAgent) {
|
|
5387
5523
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
5388
5524
|
return true;
|
|
@@ -5398,52 +5534,59 @@
|
|
|
5398
5534
|
return false;
|
|
5399
5535
|
}
|
|
5400
5536
|
var init_is_electron = __esm({
|
|
5401
|
-
"../../node_modules
|
|
5537
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
5402
5538
|
}
|
|
5403
5539
|
});
|
|
5404
5540
|
|
|
5405
|
-
// ../../node_modules
|
|
5541
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
5406
5542
|
function isBrowser3() {
|
|
5407
5543
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
5408
5544
|
return !isNode || isElectron();
|
|
5409
5545
|
}
|
|
5410
5546
|
var init_is_browser = __esm({
|
|
5411
|
-
"../../node_modules
|
|
5547
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
5412
5548
|
init_is_electron();
|
|
5413
5549
|
}
|
|
5414
5550
|
});
|
|
5415
5551
|
|
|
5416
|
-
// ../../node_modules
|
|
5417
|
-
var
|
|
5552
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
5553
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
5418
5554
|
var init_globals3 = __esm({
|
|
5419
|
-
"../../node_modules
|
|
5420
|
-
|
|
5555
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
5556
|
+
globals3 = {
|
|
5421
5557
|
self: typeof self !== "undefined" && self,
|
|
5422
5558
|
window: typeof window !== "undefined" && window,
|
|
5423
5559
|
global: typeof global !== "undefined" && global,
|
|
5424
5560
|
document: typeof document !== "undefined" && document,
|
|
5425
5561
|
process: typeof process === "object" && process
|
|
5426
5562
|
};
|
|
5427
|
-
self_3 =
|
|
5428
|
-
window_3 =
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
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 || {};
|
|
5432
5567
|
}
|
|
5433
5568
|
});
|
|
5434
5569
|
|
|
5435
|
-
// ../../node_modules
|
|
5570
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
5436
5571
|
var VERSION2, isBrowser4;
|
|
5437
5572
|
var init_globals4 = __esm({
|
|
5438
|
-
"../../node_modules
|
|
5573
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
5439
5574
|
init_is_browser();
|
|
5440
|
-
init_globals3();
|
|
5441
5575
|
VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
5442
5576
|
isBrowser4 = isBrowser3();
|
|
5443
5577
|
}
|
|
5444
5578
|
});
|
|
5445
5579
|
|
|
5446
|
-
// ../../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
|
|
5447
5590
|
function getStorage(type) {
|
|
5448
5591
|
try {
|
|
5449
5592
|
const storage = window[type];
|
|
@@ -5457,9 +5600,15 @@
|
|
|
5457
5600
|
}
|
|
5458
5601
|
var LocalStorage;
|
|
5459
5602
|
var init_local_storage = __esm({
|
|
5460
|
-
"../../node_modules
|
|
5603
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
5604
|
+
init_defineProperty();
|
|
5461
5605
|
LocalStorage = class {
|
|
5462
|
-
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", {});
|
|
5463
5612
|
this.storage = getStorage(type);
|
|
5464
5613
|
this.id = id;
|
|
5465
5614
|
this.config = {};
|
|
@@ -5494,7 +5643,7 @@
|
|
|
5494
5643
|
}
|
|
5495
5644
|
});
|
|
5496
5645
|
|
|
5497
|
-
// ../../node_modules
|
|
5646
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
5498
5647
|
function formatTime(ms) {
|
|
5499
5648
|
let formatted;
|
|
5500
5649
|
if (ms < 10) {
|
|
@@ -5508,11 +5657,13 @@
|
|
|
5508
5657
|
}
|
|
5509
5658
|
return formatted;
|
|
5510
5659
|
}
|
|
5511
|
-
function leftPad(string
|
|
5660
|
+
function leftPad(string) {
|
|
5661
|
+
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
5512
5662
|
const padLength = Math.max(length4 - string.length, 0);
|
|
5513
5663
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
5514
5664
|
}
|
|
5515
|
-
function formatImage(image, message, scale5
|
|
5665
|
+
function formatImage(image, message, scale5) {
|
|
5666
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
5516
5667
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
5517
5668
|
if (image.width > maxWidth) {
|
|
5518
5669
|
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
@@ -5523,16 +5674,16 @@
|
|
|
5523
5674
|
return ["".concat(message, " %c+"), style];
|
|
5524
5675
|
}
|
|
5525
5676
|
var init_formatters = __esm({
|
|
5526
|
-
"../../node_modules
|
|
5677
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
5527
5678
|
}
|
|
5528
5679
|
});
|
|
5529
5680
|
|
|
5530
|
-
// ../../node_modules
|
|
5681
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
5531
5682
|
function getColor(color) {
|
|
5532
5683
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
5533
5684
|
}
|
|
5534
5685
|
function addColor(string, color, background) {
|
|
5535
|
-
if (!
|
|
5686
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
5536
5687
|
if (color) {
|
|
5537
5688
|
color = getColor(color);
|
|
5538
5689
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -5546,31 +5697,32 @@
|
|
|
5546
5697
|
}
|
|
5547
5698
|
var COLOR;
|
|
5548
5699
|
var init_color = __esm({
|
|
5549
|
-
"../../node_modules
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
BLACK
|
|
5553
|
-
RED
|
|
5554
|
-
GREEN
|
|
5555
|
-
YELLOW
|
|
5556
|
-
BLUE
|
|
5557
|
-
MAGENTA
|
|
5558
|
-
CYAN
|
|
5559
|
-
WHITE
|
|
5560
|
-
BRIGHT_BLACK
|
|
5561
|
-
BRIGHT_RED
|
|
5562
|
-
BRIGHT_GREEN
|
|
5563
|
-
BRIGHT_YELLOW
|
|
5564
|
-
BRIGHT_BLUE
|
|
5565
|
-
BRIGHT_MAGENTA
|
|
5566
|
-
BRIGHT_CYAN
|
|
5567
|
-
BRIGHT_WHITE
|
|
5568
|
-
};
|
|
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 = {}));
|
|
5569
5720
|
}
|
|
5570
5721
|
});
|
|
5571
5722
|
|
|
5572
|
-
// ../../node_modules
|
|
5573
|
-
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"];
|
|
5574
5726
|
const proto = Object.getPrototypeOf(obj);
|
|
5575
5727
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
5576
5728
|
for (const key of propNames) {
|
|
@@ -5582,28 +5734,30 @@
|
|
|
5582
5734
|
}
|
|
5583
5735
|
}
|
|
5584
5736
|
var init_autobind = __esm({
|
|
5585
|
-
"../../node_modules
|
|
5737
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
5586
5738
|
}
|
|
5587
5739
|
});
|
|
5588
5740
|
|
|
5589
|
-
// ../../node_modules
|
|
5741
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
5590
5742
|
function assert4(condition, message) {
|
|
5591
5743
|
if (!condition) {
|
|
5592
5744
|
throw new Error(message || "Assertion failed");
|
|
5593
5745
|
}
|
|
5594
5746
|
}
|
|
5595
5747
|
var init_assert4 = __esm({
|
|
5596
|
-
"../../node_modules
|
|
5748
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
5597
5749
|
}
|
|
5598
5750
|
});
|
|
5599
5751
|
|
|
5600
|
-
// ../../node_modules
|
|
5752
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
5601
5753
|
function getHiResTimestamp2() {
|
|
5602
5754
|
let timestamp;
|
|
5603
|
-
if (
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
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_);
|
|
5607
5761
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
5608
5762
|
} else {
|
|
5609
5763
|
timestamp = Date.now();
|
|
@@ -5611,21 +5765,19 @@
|
|
|
5611
5765
|
return timestamp;
|
|
5612
5766
|
}
|
|
5613
5767
|
var init_hi_res_timestamp2 = __esm({
|
|
5614
|
-
"../../node_modules
|
|
5615
|
-
|
|
5768
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5769
|
+
init_esm5();
|
|
5616
5770
|
}
|
|
5617
5771
|
});
|
|
5618
5772
|
|
|
5619
|
-
//
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
function getTableHeader(table) {
|
|
5623
|
-
for (const key in table) {
|
|
5624
|
-
for (const title in table[key]) {
|
|
5625
|
-
return title || "untitled";
|
|
5626
|
-
}
|
|
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"() {
|
|
5627
5776
|
}
|
|
5628
|
-
|
|
5777
|
+
});
|
|
5778
|
+
|
|
5779
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
5780
|
+
function noop() {
|
|
5629
5781
|
}
|
|
5630
5782
|
function normalizeLogLevel(logLevel) {
|
|
5631
5783
|
if (!logLevel) {
|
|
@@ -5654,7 +5806,6 @@
|
|
|
5654
5806
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
5655
5807
|
while (args.length && args.shift() !== message) {
|
|
5656
5808
|
}
|
|
5657
|
-
opts.args = args;
|
|
5658
5809
|
switch (typeof logLevel) {
|
|
5659
5810
|
case "string":
|
|
5660
5811
|
case "function":
|
|
@@ -5673,7 +5824,9 @@
|
|
|
5673
5824
|
}
|
|
5674
5825
|
const messageType = typeof opts.message;
|
|
5675
5826
|
assert4(messageType === "string" || messageType === "object");
|
|
5676
|
-
return Object.assign(opts,
|
|
5827
|
+
return Object.assign(opts, {
|
|
5828
|
+
args
|
|
5829
|
+
}, opts.opts);
|
|
5677
5830
|
}
|
|
5678
5831
|
function decorateMessage(id, message, opts) {
|
|
5679
5832
|
if (typeof message === "string") {
|
|
@@ -5683,29 +5836,25 @@
|
|
|
5683
5836
|
}
|
|
5684
5837
|
return message;
|
|
5685
5838
|
}
|
|
5686
|
-
function logImageInNode({
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
fit: "box",
|
|
5699
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
5700
|
-
}).then((data) => console.log(data));
|
|
5701
|
-
}
|
|
5702
|
-
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;
|
|
5703
5851
|
}
|
|
5704
|
-
function logImageInBrowser({
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5852
|
+
function logImageInBrowser(_ref3) {
|
|
5853
|
+
let {
|
|
5854
|
+
image,
|
|
5855
|
+
message = "",
|
|
5856
|
+
scale: scale5 = 1
|
|
5857
|
+
} = _ref3;
|
|
5709
5858
|
if (typeof image === "string") {
|
|
5710
5859
|
const img = new Image();
|
|
5711
5860
|
img.onload = () => {
|
|
@@ -5713,33 +5862,43 @@
|
|
|
5713
5862
|
console.log(...args);
|
|
5714
5863
|
};
|
|
5715
5864
|
img.src = image;
|
|
5716
|
-
return
|
|
5865
|
+
return noop;
|
|
5717
5866
|
}
|
|
5718
5867
|
const element = image.nodeName || "";
|
|
5719
5868
|
if (element.toLowerCase() === "img") {
|
|
5720
5869
|
console.log(...formatImage(image, message, scale5));
|
|
5721
|
-
return
|
|
5870
|
+
return noop;
|
|
5722
5871
|
}
|
|
5723
5872
|
if (element.toLowerCase() === "canvas") {
|
|
5724
5873
|
const img = new Image();
|
|
5725
5874
|
img.onload = () => console.log(...formatImage(img, message, scale5));
|
|
5726
5875
|
img.src = image.toDataURL();
|
|
5727
|
-
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
|
+
}
|
|
5728
5885
|
}
|
|
5729
|
-
return
|
|
5886
|
+
return "empty";
|
|
5730
5887
|
}
|
|
5731
5888
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
5732
5889
|
var init_log = __esm({
|
|
5733
|
-
"../../node_modules
|
|
5734
|
-
|
|
5890
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
5891
|
+
init_defineProperty();
|
|
5892
|
+
init_esm5();
|
|
5735
5893
|
init_local_storage();
|
|
5736
5894
|
init_formatters();
|
|
5737
5895
|
init_color();
|
|
5738
5896
|
init_autobind();
|
|
5739
5897
|
init_assert4();
|
|
5740
5898
|
init_hi_res_timestamp2();
|
|
5899
|
+
init_node_asciify_image();
|
|
5741
5900
|
originalConsole = {
|
|
5742
|
-
debug:
|
|
5901
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
5743
5902
|
log: console.log,
|
|
5744
5903
|
info: console.info,
|
|
5745
5904
|
warn: console.warn,
|
|
@@ -5754,16 +5913,20 @@
|
|
|
5754
5913
|
once: true
|
|
5755
5914
|
};
|
|
5756
5915
|
Log = class {
|
|
5757
|
-
constructor({
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
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);
|
|
5762
5929
|
this.id = id;
|
|
5763
|
-
this.VERSION = VERSION2;
|
|
5764
|
-
this._startTs = getHiResTimestamp2();
|
|
5765
|
-
this._deltaTs = getHiResTimestamp2();
|
|
5766
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
5767
5930
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
5768
5931
|
this.userData = {};
|
|
5769
5932
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -5797,7 +5960,8 @@
|
|
|
5797
5960
|
getPriority() {
|
|
5798
5961
|
return this.level;
|
|
5799
5962
|
}
|
|
5800
|
-
enable(
|
|
5963
|
+
enable() {
|
|
5964
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
5801
5965
|
this._storage.updateConfiguration({
|
|
5802
5966
|
enabled
|
|
5803
5967
|
});
|
|
@@ -5809,6 +5973,21 @@
|
|
|
5809
5973
|
});
|
|
5810
5974
|
return this;
|
|
5811
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
|
+
}
|
|
5812
5991
|
assert(condition, message) {
|
|
5813
5992
|
assert4(condition, message);
|
|
5814
5993
|
}
|
|
@@ -5837,27 +6016,31 @@
|
|
|
5837
6016
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
5838
6017
|
}
|
|
5839
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
|
+
}
|
|
5840
6022
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
5841
6023
|
}
|
|
5842
6024
|
table(logLevel, table, columns) {
|
|
5843
6025
|
if (table) {
|
|
5844
|
-
return this._getLogFunction(logLevel, table, console.table ||
|
|
6026
|
+
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
5845
6027
|
tag: getTableHeader(table)
|
|
5846
6028
|
});
|
|
5847
6029
|
}
|
|
5848
|
-
return
|
|
6030
|
+
return noop;
|
|
5849
6031
|
}
|
|
5850
|
-
image({
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
6032
|
+
image(_ref) {
|
|
6033
|
+
let {
|
|
6034
|
+
logLevel,
|
|
6035
|
+
priority,
|
|
6036
|
+
image,
|
|
6037
|
+
message = "",
|
|
6038
|
+
scale: scale5 = 1
|
|
6039
|
+
} = _ref;
|
|
5857
6040
|
if (!this._shouldLog(logLevel || priority)) {
|
|
5858
|
-
return
|
|
6041
|
+
return noop;
|
|
5859
6042
|
}
|
|
5860
|
-
return
|
|
6043
|
+
return isBrowser3 ? logImageInBrowser({
|
|
5861
6044
|
image,
|
|
5862
6045
|
message,
|
|
5863
6046
|
scale: scale5
|
|
@@ -5867,21 +6050,6 @@
|
|
|
5867
6050
|
scale: scale5
|
|
5868
6051
|
});
|
|
5869
6052
|
}
|
|
5870
|
-
settings() {
|
|
5871
|
-
if (console.table) {
|
|
5872
|
-
console.table(this._storage.config);
|
|
5873
|
-
} else {
|
|
5874
|
-
console.log(this._storage.config);
|
|
5875
|
-
}
|
|
5876
|
-
}
|
|
5877
|
-
get(setting) {
|
|
5878
|
-
return this._storage.config[setting];
|
|
5879
|
-
}
|
|
5880
|
-
set(setting, value) {
|
|
5881
|
-
this._storage.updateConfiguration({
|
|
5882
|
-
[setting]: value
|
|
5883
|
-
});
|
|
5884
|
-
}
|
|
5885
6053
|
time(logLevel, message) {
|
|
5886
6054
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
5887
6055
|
}
|
|
@@ -5889,12 +6057,13 @@
|
|
|
5889
6057
|
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
5890
6058
|
}
|
|
5891
6059
|
timeStamp(logLevel, message) {
|
|
5892
|
-
return this._getLogFunction(logLevel, message, console.timeStamp ||
|
|
6060
|
+
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
5893
6061
|
}
|
|
5894
|
-
group(logLevel, message
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
6062
|
+
group(logLevel, message) {
|
|
6063
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
6064
|
+
collapsed: false
|
|
6065
|
+
};
|
|
6066
|
+
const options = normalizeArguments({
|
|
5898
6067
|
logLevel,
|
|
5899
6068
|
message,
|
|
5900
6069
|
opts
|
|
@@ -5902,16 +6071,17 @@
|
|
|
5902
6071
|
const {
|
|
5903
6072
|
collapsed
|
|
5904
6073
|
} = opts;
|
|
5905
|
-
|
|
5906
|
-
return this._getLogFunction(
|
|
6074
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
6075
|
+
return this._getLogFunction(options);
|
|
5907
6076
|
}
|
|
5908
|
-
groupCollapsed(logLevel, message
|
|
6077
|
+
groupCollapsed(logLevel, message) {
|
|
6078
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
5909
6079
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
5910
6080
|
collapsed: true
|
|
5911
6081
|
}));
|
|
5912
6082
|
}
|
|
5913
6083
|
groupEnd(logLevel) {
|
|
5914
|
-
return this._getLogFunction(logLevel, "", console.groupEnd ||
|
|
6084
|
+
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
5915
6085
|
}
|
|
5916
6086
|
withGroup(logLevel, message, func) {
|
|
5917
6087
|
this.group(logLevel, message)();
|
|
@@ -5929,7 +6099,7 @@
|
|
|
5929
6099
|
_shouldLog(logLevel) {
|
|
5930
6100
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
5931
6101
|
}
|
|
5932
|
-
_getLogFunction(logLevel, message, method, args
|
|
6102
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
5933
6103
|
if (this._shouldLog(logLevel)) {
|
|
5934
6104
|
opts = normalizeArguments({
|
|
5935
6105
|
logLevel,
|
|
@@ -5947,57 +6117,27 @@
|
|
|
5947
6117
|
if (!cache[tag]) {
|
|
5948
6118
|
cache[tag] = getHiResTimestamp2();
|
|
5949
6119
|
} else {
|
|
5950
|
-
return
|
|
6120
|
+
return noop;
|
|
5951
6121
|
}
|
|
5952
6122
|
}
|
|
5953
6123
|
message = decorateMessage(this.id, opts.message, opts);
|
|
5954
6124
|
return method.bind(console, message, ...opts.args);
|
|
5955
6125
|
}
|
|
5956
|
-
return
|
|
6126
|
+
return noop;
|
|
5957
6127
|
}
|
|
5958
6128
|
};
|
|
5959
|
-
Log
|
|
5960
|
-
}
|
|
5961
|
-
});
|
|
5962
|
-
|
|
5963
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
5964
|
-
var init_hi_res_timestamp3 = __esm({
|
|
5965
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5966
|
-
}
|
|
5967
|
-
});
|
|
5968
|
-
|
|
5969
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
5970
|
-
var init_stat2 = __esm({
|
|
5971
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
5972
|
-
init_hi_res_timestamp3();
|
|
6129
|
+
_defineProperty(Log, "VERSION", VERSION2);
|
|
5973
6130
|
}
|
|
5974
6131
|
});
|
|
5975
6132
|
|
|
5976
|
-
// ../../node_modules
|
|
5977
|
-
var init_stats2 = __esm({
|
|
5978
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
5979
|
-
init_stat2();
|
|
5980
|
-
}
|
|
5981
|
-
});
|
|
5982
|
-
|
|
5983
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
5984
|
-
var init_esm5 = __esm({
|
|
5985
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
5986
|
-
init_stats2();
|
|
5987
|
-
init_stat2();
|
|
5988
|
-
init_hi_res_timestamp3();
|
|
5989
|
-
}
|
|
5990
|
-
});
|
|
5991
|
-
|
|
5992
|
-
// ../../node_modules/probe.gl/dist/esm/index.js
|
|
6133
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
5993
6134
|
var esm_default;
|
|
5994
6135
|
var init_esm6 = __esm({
|
|
5995
|
-
"../../node_modules
|
|
6136
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
5996
6137
|
init_log();
|
|
5997
6138
|
init_log();
|
|
5998
|
-
init_esm5();
|
|
5999
6139
|
esm_default = new Log({
|
|
6000
|
-
id: "probe.gl"
|
|
6140
|
+
id: "@probe.gl/log"
|
|
6001
6141
|
});
|
|
6002
6142
|
}
|
|
6003
6143
|
});
|
|
@@ -6070,825 +6210,202 @@
|
|
|
6070
6210
|
batchDebounceMs: 0,
|
|
6071
6211
|
metadata: false,
|
|
6072
6212
|
transforms: []
|
|
6073
|
-
};
|
|
6074
|
-
REMOVED_LOADER_OPTIONS = {
|
|
6075
|
-
throws: "nothrow",
|
|
6076
|
-
dataType: "(no longer used)",
|
|
6077
|
-
uri: "baseUri",
|
|
6078
|
-
method: "fetch.method",
|
|
6079
|
-
headers: "fetch.headers",
|
|
6080
|
-
body: "fetch.body",
|
|
6081
|
-
mode: "fetch.mode",
|
|
6082
|
-
credentials: "fetch.credentials",
|
|
6083
|
-
cache: "fetch.cache",
|
|
6084
|
-
redirect: "fetch.redirect",
|
|
6085
|
-
referrer: "fetch.referrer",
|
|
6086
|
-
referrerPolicy: "fetch.referrerPolicy",
|
|
6087
|
-
integrity: "fetch.integrity",
|
|
6088
|
-
keepalive: "fetch.keepalive",
|
|
6089
|
-
signal: "fetch.signal"
|
|
6090
|
-
};
|
|
6091
|
-
}
|
|
6092
|
-
});
|
|
6093
|
-
|
|
6094
|
-
// ../core/src/lib/loader-utils/option-utils.ts
|
|
6095
|
-
function getGlobalLoaderState() {
|
|
6096
|
-
globalThis.loaders = globalThis.loaders || {};
|
|
6097
|
-
const { loaders } = globalThis;
|
|
6098
|
-
loaders._state = loaders._state || {};
|
|
6099
|
-
return loaders._state;
|
|
6100
|
-
}
|
|
6101
|
-
function normalizeOptions(options, loader, loaders, url) {
|
|
6102
|
-
loaders = loaders || [];
|
|
6103
|
-
loaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
6104
|
-
validateOptions(options, loaders);
|
|
6105
|
-
return normalizeOptionsInternal(loader, options, url);
|
|
6106
|
-
}
|
|
6107
|
-
function getFetchFunction(options, context) {
|
|
6108
|
-
const globalOptions = getGlobalLoaderOptions();
|
|
6109
|
-
const fetchOptions = options || globalOptions;
|
|
6110
|
-
if (typeof fetchOptions.fetch === "function") {
|
|
6111
|
-
return fetchOptions.fetch;
|
|
6112
|
-
}
|
|
6113
|
-
if (isObject(fetchOptions.fetch)) {
|
|
6114
|
-
return (url) => fetchFile(url, fetchOptions);
|
|
6115
|
-
}
|
|
6116
|
-
if (context?.fetch) {
|
|
6117
|
-
return context?.fetch;
|
|
6118
|
-
}
|
|
6119
|
-
return fetchFile;
|
|
6120
|
-
}
|
|
6121
|
-
function validateOptions(options, loaders) {
|
|
6122
|
-
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
6123
|
-
for (const loader of loaders) {
|
|
6124
|
-
const idOptions = options && options[loader.id] || {};
|
|
6125
|
-
const loaderOptions = loader.options && loader.options[loader.id] || {};
|
|
6126
|
-
const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};
|
|
6127
|
-
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
6128
|
-
}
|
|
6129
|
-
}
|
|
6130
|
-
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
6131
|
-
const loaderName = id || "Top level";
|
|
6132
|
-
const prefix = id ? `${id}.` : "";
|
|
6133
|
-
for (const key in options) {
|
|
6134
|
-
const isSubOptions = !id && isObject(options[key]);
|
|
6135
|
-
const isBaseUriOption = key === "baseUri" && !id;
|
|
6136
|
-
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
6137
|
-
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
6138
|
-
if (key in deprecatedOptions) {
|
|
6139
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
6140
|
-
} else if (!isSubOptions) {
|
|
6141
|
-
const suggestion = findSimilarOption(key, loaders);
|
|
6142
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
6143
|
-
}
|
|
6144
|
-
}
|
|
6145
|
-
}
|
|
6146
|
-
}
|
|
6147
|
-
function findSimilarOption(optionKey, loaders) {
|
|
6148
|
-
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
6149
|
-
let bestSuggestion = "";
|
|
6150
|
-
for (const loader of loaders) {
|
|
6151
|
-
for (const key in loader.options) {
|
|
6152
|
-
if (optionKey === key) {
|
|
6153
|
-
return `Did you mean '${loader.id}.${key}'?`;
|
|
6154
|
-
}
|
|
6155
|
-
const lowerCaseKey = key.toLowerCase();
|
|
6156
|
-
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
6157
|
-
if (isPartialMatch) {
|
|
6158
|
-
bestSuggestion = bestSuggestion || `Did you mean '${loader.id}.${key}'?`;
|
|
6159
|
-
}
|
|
6160
|
-
}
|
|
6161
|
-
}
|
|
6162
|
-
return bestSuggestion;
|
|
6163
|
-
}
|
|
6164
|
-
function normalizeOptionsInternal(loader, options, url) {
|
|
6165
|
-
const loaderDefaultOptions = loader.options || {};
|
|
6166
|
-
const mergedOptions = { ...loaderDefaultOptions };
|
|
6167
|
-
addUrlOptions(mergedOptions, url);
|
|
6168
|
-
if (mergedOptions.log === null) {
|
|
6169
|
-
mergedOptions.log = new NullLog();
|
|
6170
|
-
}
|
|
6171
|
-
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
6172
|
-
mergeNestedFields(mergedOptions, options);
|
|
6173
|
-
return mergedOptions;
|
|
6174
|
-
}
|
|
6175
|
-
function mergeNestedFields(mergedOptions, options) {
|
|
6176
|
-
for (const key in options) {
|
|
6177
|
-
if (key in options) {
|
|
6178
|
-
const value = options[key];
|
|
6179
|
-
if (isPureObject(value) && isPureObject(mergedOptions[key])) {
|
|
6180
|
-
mergedOptions[key] = {
|
|
6181
|
-
...mergedOptions[key],
|
|
6182
|
-
...options[key]
|
|
6183
|
-
};
|
|
6184
|
-
} else {
|
|
6185
|
-
mergedOptions[key] = options[key];
|
|
6186
|
-
}
|
|
6187
|
-
}
|
|
6188
|
-
}
|
|
6189
|
-
}
|
|
6190
|
-
function addUrlOptions(options, url) {
|
|
6191
|
-
if (url && !("baseUri" in options)) {
|
|
6192
|
-
options.baseUri = url;
|
|
6193
|
-
}
|
|
6194
|
-
}
|
|
6195
|
-
var getGlobalLoaderOptions;
|
|
6196
|
-
var init_option_utils = __esm({
|
|
6197
|
-
"../core/src/lib/loader-utils/option-utils.ts"() {
|
|
6198
|
-
init_is_type();
|
|
6199
|
-
init_fetch_file();
|
|
6200
|
-
init_loggers();
|
|
6201
|
-
init_option_defaults();
|
|
6202
|
-
getGlobalLoaderOptions = () => {
|
|
6203
|
-
const state = getGlobalLoaderState();
|
|
6204
|
-
state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
|
|
6205
|
-
return state.globalOptions;
|
|
6206
|
-
};
|
|
6207
|
-
}
|
|
6208
|
-
});
|
|
6209
|
-
|
|
6210
|
-
// ../core/src/lib/loader-utils/normalize-loader.ts
|
|
6211
|
-
function isLoaderObject(loader) {
|
|
6212
|
-
if (!loader) {
|
|
6213
|
-
return false;
|
|
6214
|
-
}
|
|
6215
|
-
if (Array.isArray(loader)) {
|
|
6216
|
-
loader = loader[0];
|
|
6217
|
-
}
|
|
6218
|
-
const hasExtensions = Array.isArray(loader?.extensions);
|
|
6219
|
-
return hasExtensions;
|
|
6220
|
-
}
|
|
6221
|
-
function normalizeLoader(loader) {
|
|
6222
|
-
assert2(loader, "null loader");
|
|
6223
|
-
assert2(isLoaderObject(loader), "invalid loader");
|
|
6224
|
-
let options;
|
|
6225
|
-
if (Array.isArray(loader)) {
|
|
6226
|
-
options = loader[1];
|
|
6227
|
-
loader = loader[0];
|
|
6228
|
-
loader = {
|
|
6229
|
-
...loader,
|
|
6230
|
-
options: { ...loader.options, ...options }
|
|
6231
|
-
};
|
|
6232
|
-
}
|
|
6233
|
-
if (loader?.parseTextSync || loader?.parseText) {
|
|
6234
|
-
loader.text = true;
|
|
6235
|
-
}
|
|
6236
|
-
if (!loader.text) {
|
|
6237
|
-
loader.binary = true;
|
|
6238
|
-
}
|
|
6239
|
-
return loader;
|
|
6240
|
-
}
|
|
6241
|
-
var init_normalize_loader = __esm({
|
|
6242
|
-
"../core/src/lib/loader-utils/normalize-loader.ts"() {
|
|
6243
|
-
init_src2();
|
|
6244
|
-
}
|
|
6245
|
-
});
|
|
6246
|
-
|
|
6247
|
-
// ../core/src/lib/api/register-loaders.ts
|
|
6248
|
-
function getRegisteredLoaders() {
|
|
6249
|
-
return getGlobalLoaderRegistry();
|
|
6250
|
-
}
|
|
6251
|
-
var getGlobalLoaderRegistry;
|
|
6252
|
-
var init_register_loaders = __esm({
|
|
6253
|
-
"../core/src/lib/api/register-loaders.ts"() {
|
|
6254
|
-
init_option_utils();
|
|
6255
|
-
getGlobalLoaderRegistry = () => {
|
|
6256
|
-
const state = getGlobalLoaderState();
|
|
6257
|
-
state.loaderRegistry = state.loaderRegistry || [];
|
|
6258
|
-
return state.loaderRegistry;
|
|
6259
|
-
};
|
|
6260
|
-
}
|
|
6261
|
-
});
|
|
6262
|
-
|
|
6263
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
6264
|
-
function isElectron2(mockUserAgent) {
|
|
6265
|
-
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
6266
|
-
return true;
|
|
6267
|
-
}
|
|
6268
|
-
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
|
|
6269
|
-
return true;
|
|
6270
|
-
}
|
|
6271
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
6272
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
6273
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
6274
|
-
return true;
|
|
6275
|
-
}
|
|
6276
|
-
return false;
|
|
6277
|
-
}
|
|
6278
|
-
var init_is_electron2 = __esm({
|
|
6279
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
6280
|
-
}
|
|
6281
|
-
});
|
|
6282
|
-
|
|
6283
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
6284
|
-
function isBrowser5() {
|
|
6285
|
-
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
6286
|
-
return !isNode || isElectron2();
|
|
6287
|
-
}
|
|
6288
|
-
var init_is_browser2 = __esm({
|
|
6289
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
6290
|
-
init_is_electron2();
|
|
6291
|
-
}
|
|
6292
|
-
});
|
|
6293
|
-
|
|
6294
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
6295
|
-
var globals5, self_4, window_4, document_4, process_2;
|
|
6296
|
-
var init_globals5 = __esm({
|
|
6297
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
6298
|
-
globals5 = {
|
|
6299
|
-
self: typeof self !== "undefined" && self,
|
|
6300
|
-
window: typeof window !== "undefined" && window,
|
|
6301
|
-
global: typeof global !== "undefined" && global,
|
|
6302
|
-
document: typeof document !== "undefined" && document,
|
|
6303
|
-
process: typeof process === "object" && process
|
|
6304
|
-
};
|
|
6305
|
-
self_4 = globals5.self || globals5.window || globals5.global;
|
|
6306
|
-
window_4 = globals5.window || globals5.self || globals5.global;
|
|
6307
|
-
document_4 = globals5.document || {};
|
|
6308
|
-
process_2 = globals5.process || {};
|
|
6309
|
-
}
|
|
6310
|
-
});
|
|
6311
|
-
|
|
6312
|
-
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
6313
|
-
var VERSION3, isBrowser6;
|
|
6314
|
-
var init_globals6 = __esm({
|
|
6315
|
-
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
6316
|
-
init_is_browser2();
|
|
6317
|
-
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
6318
|
-
isBrowser6 = isBrowser5();
|
|
6319
|
-
}
|
|
6320
|
-
});
|
|
6321
|
-
|
|
6322
|
-
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
6323
|
-
var init_esm7 = __esm({
|
|
6324
|
-
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
6325
|
-
init_globals6();
|
|
6326
|
-
init_globals5();
|
|
6327
|
-
init_is_browser2();
|
|
6328
|
-
}
|
|
6329
|
-
});
|
|
6330
|
-
|
|
6331
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
6332
|
-
function getStorage2(type) {
|
|
6333
|
-
try {
|
|
6334
|
-
const storage = window[type];
|
|
6335
|
-
const x = "__storage_test__";
|
|
6336
|
-
storage.setItem(x, x);
|
|
6337
|
-
storage.removeItem(x);
|
|
6338
|
-
return storage;
|
|
6339
|
-
} catch (e) {
|
|
6340
|
-
return null;
|
|
6341
|
-
}
|
|
6342
|
-
}
|
|
6343
|
-
var LocalStorage2;
|
|
6344
|
-
var init_local_storage2 = __esm({
|
|
6345
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
6346
|
-
init_defineProperty();
|
|
6347
|
-
LocalStorage2 = class {
|
|
6348
|
-
constructor(id) {
|
|
6349
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6350
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
6351
|
-
_defineProperty(this, "storage", void 0);
|
|
6352
|
-
_defineProperty(this, "id", void 0);
|
|
6353
|
-
_defineProperty(this, "config", {});
|
|
6354
|
-
this.storage = getStorage2(type);
|
|
6355
|
-
this.id = id;
|
|
6356
|
-
this.config = {};
|
|
6357
|
-
Object.assign(this.config, defaultSettings);
|
|
6358
|
-
this._loadConfiguration();
|
|
6359
|
-
}
|
|
6360
|
-
getConfiguration() {
|
|
6361
|
-
return this.config;
|
|
6362
|
-
}
|
|
6363
|
-
setConfiguration(configuration) {
|
|
6364
|
-
this.config = {};
|
|
6365
|
-
return this.updateConfiguration(configuration);
|
|
6366
|
-
}
|
|
6367
|
-
updateConfiguration(configuration) {
|
|
6368
|
-
Object.assign(this.config, configuration);
|
|
6369
|
-
if (this.storage) {
|
|
6370
|
-
const serialized = JSON.stringify(this.config);
|
|
6371
|
-
this.storage.setItem(this.id, serialized);
|
|
6372
|
-
}
|
|
6373
|
-
return this;
|
|
6374
|
-
}
|
|
6375
|
-
_loadConfiguration() {
|
|
6376
|
-
let configuration = {};
|
|
6377
|
-
if (this.storage) {
|
|
6378
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
6379
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
6380
|
-
}
|
|
6381
|
-
Object.assign(this.config, configuration);
|
|
6382
|
-
return this;
|
|
6383
|
-
}
|
|
6384
|
-
};
|
|
6385
|
-
}
|
|
6386
|
-
});
|
|
6387
|
-
|
|
6388
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
6389
|
-
function formatTime2(ms) {
|
|
6390
|
-
let formatted;
|
|
6391
|
-
if (ms < 10) {
|
|
6392
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
6393
|
-
} else if (ms < 100) {
|
|
6394
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
6395
|
-
} else if (ms < 1e3) {
|
|
6396
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
6397
|
-
} else {
|
|
6398
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
6399
|
-
}
|
|
6400
|
-
return formatted;
|
|
6401
|
-
}
|
|
6402
|
-
function leftPad2(string) {
|
|
6403
|
-
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
6404
|
-
const padLength = Math.max(length4 - string.length, 0);
|
|
6405
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
6406
|
-
}
|
|
6407
|
-
function formatImage2(image, message, scale5) {
|
|
6408
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
6409
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
6410
|
-
if (image.width > maxWidth) {
|
|
6411
|
-
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
6412
|
-
}
|
|
6413
|
-
const width = image.width * scale5;
|
|
6414
|
-
const height = image.height * scale5;
|
|
6415
|
-
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("");
|
|
6416
|
-
return ["".concat(message, " %c+"), style];
|
|
6417
|
-
}
|
|
6418
|
-
var init_formatters2 = __esm({
|
|
6419
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
6420
|
-
}
|
|
6421
|
-
});
|
|
6422
|
-
|
|
6423
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
6424
|
-
function getColor2(color) {
|
|
6425
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
6426
|
-
}
|
|
6427
|
-
function addColor2(string, color, background) {
|
|
6428
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
6429
|
-
if (color) {
|
|
6430
|
-
color = getColor2(color);
|
|
6431
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
6432
|
-
}
|
|
6433
|
-
if (background) {
|
|
6434
|
-
color = getColor2(background);
|
|
6435
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
6436
|
-
}
|
|
6437
|
-
}
|
|
6438
|
-
return string;
|
|
6439
|
-
}
|
|
6440
|
-
var COLOR2;
|
|
6441
|
-
var init_color2 = __esm({
|
|
6442
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
6443
|
-
init_esm7();
|
|
6444
|
-
(function(COLOR3) {
|
|
6445
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
6446
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
6447
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
6448
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
6449
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
6450
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
6451
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
6452
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
6453
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
6454
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
6455
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
6456
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
6457
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
6458
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
6459
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
6460
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
6461
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
6462
|
-
}
|
|
6463
|
-
});
|
|
6464
|
-
|
|
6465
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
6466
|
-
function autobind2(obj) {
|
|
6467
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
6468
|
-
const proto = Object.getPrototypeOf(obj);
|
|
6469
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
6470
|
-
for (const key of propNames) {
|
|
6471
|
-
if (typeof obj[key] === "function") {
|
|
6472
|
-
if (!predefined.find((name) => key === name)) {
|
|
6473
|
-
obj[key] = obj[key].bind(obj);
|
|
6474
|
-
}
|
|
6475
|
-
}
|
|
6476
|
-
}
|
|
6477
|
-
}
|
|
6478
|
-
var init_autobind2 = __esm({
|
|
6479
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
6480
|
-
}
|
|
6481
|
-
});
|
|
6482
|
-
|
|
6483
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
6484
|
-
function assert5(condition, message) {
|
|
6485
|
-
if (!condition) {
|
|
6486
|
-
throw new Error(message || "Assertion failed");
|
|
6487
|
-
}
|
|
6488
|
-
}
|
|
6489
|
-
var init_assert5 = __esm({
|
|
6490
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
6491
|
-
}
|
|
6492
|
-
});
|
|
6493
|
-
|
|
6494
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
6495
|
-
function getHiResTimestamp4() {
|
|
6496
|
-
let timestamp;
|
|
6497
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
6498
|
-
var _window$performance, _window$performance$n;
|
|
6499
|
-
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);
|
|
6500
|
-
} else if ("hrtime" in process_2) {
|
|
6501
|
-
var _process$hrtime;
|
|
6502
|
-
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);
|
|
6503
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
6504
|
-
} else {
|
|
6505
|
-
timestamp = Date.now();
|
|
6506
|
-
}
|
|
6507
|
-
return timestamp;
|
|
6508
|
-
}
|
|
6509
|
-
var init_hi_res_timestamp4 = __esm({
|
|
6510
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
6511
|
-
init_esm7();
|
|
6512
|
-
}
|
|
6513
|
-
});
|
|
6514
|
-
|
|
6515
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
6516
|
-
function noop3() {
|
|
6517
|
-
}
|
|
6518
|
-
function normalizeLogLevel2(logLevel) {
|
|
6519
|
-
if (!logLevel) {
|
|
6520
|
-
return 0;
|
|
6521
|
-
}
|
|
6522
|
-
let resolvedLevel;
|
|
6523
|
-
switch (typeof logLevel) {
|
|
6524
|
-
case "number":
|
|
6525
|
-
resolvedLevel = logLevel;
|
|
6526
|
-
break;
|
|
6527
|
-
case "object":
|
|
6528
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
6529
|
-
break;
|
|
6530
|
-
default:
|
|
6531
|
-
return 0;
|
|
6532
|
-
}
|
|
6533
|
-
assert5(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
6534
|
-
return resolvedLevel;
|
|
6535
|
-
}
|
|
6536
|
-
function normalizeArguments2(opts) {
|
|
6537
|
-
const {
|
|
6538
|
-
logLevel,
|
|
6539
|
-
message
|
|
6540
|
-
} = opts;
|
|
6541
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
6542
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
6543
|
-
while (args.length && args.shift() !== message) {
|
|
6544
|
-
}
|
|
6545
|
-
switch (typeof logLevel) {
|
|
6546
|
-
case "string":
|
|
6547
|
-
case "function":
|
|
6548
|
-
if (message !== void 0) {
|
|
6549
|
-
args.unshift(message);
|
|
6550
|
-
}
|
|
6551
|
-
opts.message = logLevel;
|
|
6552
|
-
break;
|
|
6553
|
-
case "object":
|
|
6554
|
-
Object.assign(opts, logLevel);
|
|
6555
|
-
break;
|
|
6556
|
-
default:
|
|
6557
|
-
}
|
|
6558
|
-
if (typeof opts.message === "function") {
|
|
6559
|
-
opts.message = opts.message();
|
|
6560
|
-
}
|
|
6561
|
-
const messageType = typeof opts.message;
|
|
6562
|
-
assert5(messageType === "string" || messageType === "object");
|
|
6563
|
-
return Object.assign(opts, {
|
|
6564
|
-
args
|
|
6565
|
-
}, opts.opts);
|
|
6566
|
-
}
|
|
6567
|
-
function decorateMessage2(id, message, opts) {
|
|
6568
|
-
if (typeof message === "string") {
|
|
6569
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
6570
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
6571
|
-
message = addColor2(message, opts.color, opts.background);
|
|
6572
|
-
}
|
|
6573
|
-
return message;
|
|
6574
|
-
}
|
|
6575
|
-
function logImageInNode2(_ref2) {
|
|
6576
|
-
let {
|
|
6577
|
-
image,
|
|
6578
|
-
message = "",
|
|
6579
|
-
scale: scale5 = 1
|
|
6580
|
-
} = _ref2;
|
|
6581
|
-
let asciify = null;
|
|
6582
|
-
try {
|
|
6583
|
-
asciify = module.require("asciify-image");
|
|
6584
|
-
} catch (error) {
|
|
6585
|
-
}
|
|
6586
|
-
if (asciify) {
|
|
6587
|
-
return () => asciify(image, {
|
|
6588
|
-
fit: "box",
|
|
6589
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
6590
|
-
}).then((data) => console.log(data));
|
|
6591
|
-
}
|
|
6592
|
-
return noop3;
|
|
6593
|
-
}
|
|
6594
|
-
function logImageInBrowser2(_ref3) {
|
|
6595
|
-
let {
|
|
6596
|
-
image,
|
|
6597
|
-
message = "",
|
|
6598
|
-
scale: scale5 = 1
|
|
6599
|
-
} = _ref3;
|
|
6600
|
-
if (typeof image === "string") {
|
|
6601
|
-
const img = new Image();
|
|
6602
|
-
img.onload = () => {
|
|
6603
|
-
const args = formatImage2(img, message, scale5);
|
|
6604
|
-
console.log(...args);
|
|
6605
|
-
};
|
|
6606
|
-
img.src = image;
|
|
6607
|
-
return noop3;
|
|
6608
|
-
}
|
|
6609
|
-
const element = image.nodeName || "";
|
|
6610
|
-
if (element.toLowerCase() === "img") {
|
|
6611
|
-
console.log(...formatImage2(image, message, scale5));
|
|
6612
|
-
return noop3;
|
|
6613
|
-
}
|
|
6614
|
-
if (element.toLowerCase() === "canvas") {
|
|
6615
|
-
const img = new Image();
|
|
6616
|
-
img.onload = () => console.log(...formatImage2(img, message, scale5));
|
|
6617
|
-
img.src = image.toDataURL();
|
|
6618
|
-
return noop3;
|
|
6619
|
-
}
|
|
6620
|
-
return noop3;
|
|
6621
|
-
}
|
|
6622
|
-
function getTableHeader2(table) {
|
|
6623
|
-
for (const key in table) {
|
|
6624
|
-
for (const title in table[key]) {
|
|
6625
|
-
return title || "untitled";
|
|
6626
|
-
}
|
|
6627
|
-
}
|
|
6628
|
-
return "empty";
|
|
6629
|
-
}
|
|
6630
|
-
var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
|
|
6631
|
-
var init_log2 = __esm({
|
|
6632
|
-
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
6633
|
-
init_defineProperty();
|
|
6634
|
-
init_esm7();
|
|
6635
|
-
init_local_storage2();
|
|
6636
|
-
init_formatters2();
|
|
6637
|
-
init_color2();
|
|
6638
|
-
init_autobind2();
|
|
6639
|
-
init_assert5();
|
|
6640
|
-
init_hi_res_timestamp4();
|
|
6641
|
-
originalConsole2 = {
|
|
6642
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
6643
|
-
log: console.log,
|
|
6644
|
-
info: console.info,
|
|
6645
|
-
warn: console.warn,
|
|
6646
|
-
error: console.error
|
|
6647
|
-
};
|
|
6648
|
-
DEFAULT_SETTINGS2 = {
|
|
6649
|
-
enabled: true,
|
|
6650
|
-
level: 0
|
|
6651
|
-
};
|
|
6652
|
-
cache2 = {};
|
|
6653
|
-
ONCE2 = {
|
|
6654
|
-
once: true
|
|
6655
|
-
};
|
|
6656
|
-
Log2 = class {
|
|
6657
|
-
constructor() {
|
|
6658
|
-
let {
|
|
6659
|
-
id
|
|
6660
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
6661
|
-
id: ""
|
|
6662
|
-
};
|
|
6663
|
-
_defineProperty(this, "id", void 0);
|
|
6664
|
-
_defineProperty(this, "VERSION", VERSION3);
|
|
6665
|
-
_defineProperty(this, "_startTs", getHiResTimestamp4());
|
|
6666
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp4());
|
|
6667
|
-
_defineProperty(this, "_storage", void 0);
|
|
6668
|
-
_defineProperty(this, "userData", {});
|
|
6669
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
6670
|
-
this.id = id;
|
|
6671
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
6672
|
-
this.userData = {};
|
|
6673
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
6674
|
-
autobind2(this);
|
|
6675
|
-
Object.seal(this);
|
|
6676
|
-
}
|
|
6677
|
-
set level(newLevel) {
|
|
6678
|
-
this.setLevel(newLevel);
|
|
6679
|
-
}
|
|
6680
|
-
get level() {
|
|
6681
|
-
return this.getLevel();
|
|
6682
|
-
}
|
|
6683
|
-
isEnabled() {
|
|
6684
|
-
return this._storage.config.enabled;
|
|
6685
|
-
}
|
|
6686
|
-
getLevel() {
|
|
6687
|
-
return this._storage.config.level;
|
|
6688
|
-
}
|
|
6689
|
-
getTotal() {
|
|
6690
|
-
return Number((getHiResTimestamp4() - this._startTs).toPrecision(10));
|
|
6691
|
-
}
|
|
6692
|
-
getDelta() {
|
|
6693
|
-
return Number((getHiResTimestamp4() - this._deltaTs).toPrecision(10));
|
|
6694
|
-
}
|
|
6695
|
-
set priority(newPriority) {
|
|
6696
|
-
this.level = newPriority;
|
|
6697
|
-
}
|
|
6698
|
-
get priority() {
|
|
6699
|
-
return this.level;
|
|
6700
|
-
}
|
|
6701
|
-
getPriority() {
|
|
6702
|
-
return this.level;
|
|
6703
|
-
}
|
|
6704
|
-
enable() {
|
|
6705
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
6706
|
-
this._storage.updateConfiguration({
|
|
6707
|
-
enabled
|
|
6708
|
-
});
|
|
6709
|
-
return this;
|
|
6710
|
-
}
|
|
6711
|
-
setLevel(level) {
|
|
6712
|
-
this._storage.updateConfiguration({
|
|
6713
|
-
level
|
|
6714
|
-
});
|
|
6715
|
-
return this;
|
|
6716
|
-
}
|
|
6717
|
-
get(setting) {
|
|
6718
|
-
return this._storage.config[setting];
|
|
6719
|
-
}
|
|
6720
|
-
set(setting, value) {
|
|
6721
|
-
this._storage.updateConfiguration({
|
|
6722
|
-
[setting]: value
|
|
6723
|
-
});
|
|
6724
|
-
}
|
|
6725
|
-
settings() {
|
|
6726
|
-
if (console.table) {
|
|
6727
|
-
console.table(this._storage.config);
|
|
6728
|
-
} else {
|
|
6729
|
-
console.log(this._storage.config);
|
|
6730
|
-
}
|
|
6731
|
-
}
|
|
6732
|
-
assert(condition, message) {
|
|
6733
|
-
assert5(condition, message);
|
|
6734
|
-
}
|
|
6735
|
-
warn(message) {
|
|
6736
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
6737
|
-
}
|
|
6738
|
-
error(message) {
|
|
6739
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
6740
|
-
}
|
|
6741
|
-
deprecated(oldUsage, newUsage) {
|
|
6742
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
6743
|
-
}
|
|
6744
|
-
removed(oldUsage, newUsage) {
|
|
6745
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
6746
|
-
}
|
|
6747
|
-
probe(logLevel, message) {
|
|
6748
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
6749
|
-
time: true,
|
|
6750
|
-
once: true
|
|
6751
|
-
});
|
|
6752
|
-
}
|
|
6753
|
-
log(logLevel, message) {
|
|
6754
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
6755
|
-
}
|
|
6756
|
-
info(logLevel, message) {
|
|
6757
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
6758
|
-
}
|
|
6759
|
-
once(logLevel, message) {
|
|
6760
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6761
|
-
args[_key - 2] = arguments[_key];
|
|
6762
|
-
}
|
|
6763
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
6764
|
-
}
|
|
6765
|
-
table(logLevel, table, columns) {
|
|
6766
|
-
if (table) {
|
|
6767
|
-
return this._getLogFunction(logLevel, table, console.table || noop3, columns && [columns], {
|
|
6768
|
-
tag: getTableHeader2(table)
|
|
6769
|
-
});
|
|
6770
|
-
}
|
|
6771
|
-
return noop3;
|
|
6772
|
-
}
|
|
6773
|
-
image(_ref) {
|
|
6774
|
-
let {
|
|
6775
|
-
logLevel,
|
|
6776
|
-
priority,
|
|
6777
|
-
image,
|
|
6778
|
-
message = "",
|
|
6779
|
-
scale: scale5 = 1
|
|
6780
|
-
} = _ref;
|
|
6781
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
6782
|
-
return noop3;
|
|
6783
|
-
}
|
|
6784
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
6785
|
-
image,
|
|
6786
|
-
message,
|
|
6787
|
-
scale: scale5
|
|
6788
|
-
}) : logImageInNode2({
|
|
6789
|
-
image,
|
|
6790
|
-
message,
|
|
6791
|
-
scale: scale5
|
|
6792
|
-
});
|
|
6793
|
-
}
|
|
6794
|
-
time(logLevel, message) {
|
|
6795
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
6213
|
+
};
|
|
6214
|
+
REMOVED_LOADER_OPTIONS = {
|
|
6215
|
+
throws: "nothrow",
|
|
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}`)();
|
|
6796
6283
|
}
|
|
6797
|
-
|
|
6798
|
-
|
|
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}'?`;
|
|
6799
6294
|
}
|
|
6800
|
-
|
|
6801
|
-
|
|
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}'?`;
|
|
6802
6299
|
}
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
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]
|
|
6806
6323
|
};
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
message,
|
|
6810
|
-
opts
|
|
6811
|
-
});
|
|
6812
|
-
const {
|
|
6813
|
-
collapsed
|
|
6814
|
-
} = opts;
|
|
6815
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
6816
|
-
return this._getLogFunction(options);
|
|
6817
|
-
}
|
|
6818
|
-
groupCollapsed(logLevel, message) {
|
|
6819
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6820
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
6821
|
-
collapsed: true
|
|
6822
|
-
}));
|
|
6823
|
-
}
|
|
6824
|
-
groupEnd(logLevel) {
|
|
6825
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop3);
|
|
6826
|
-
}
|
|
6827
|
-
withGroup(logLevel, message, func) {
|
|
6828
|
-
this.group(logLevel, message)();
|
|
6829
|
-
try {
|
|
6830
|
-
func();
|
|
6831
|
-
} finally {
|
|
6832
|
-
this.groupEnd(logLevel)();
|
|
6833
|
-
}
|
|
6834
|
-
}
|
|
6835
|
-
trace() {
|
|
6836
|
-
if (console.trace) {
|
|
6837
|
-
console.trace();
|
|
6838
|
-
}
|
|
6839
|
-
}
|
|
6840
|
-
_shouldLog(logLevel) {
|
|
6841
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
6842
|
-
}
|
|
6843
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
6844
|
-
if (this._shouldLog(logLevel)) {
|
|
6845
|
-
opts = normalizeArguments2({
|
|
6846
|
-
logLevel,
|
|
6847
|
-
message,
|
|
6848
|
-
args,
|
|
6849
|
-
opts
|
|
6850
|
-
});
|
|
6851
|
-
method = method || opts.method;
|
|
6852
|
-
assert5(method);
|
|
6853
|
-
opts.total = this.getTotal();
|
|
6854
|
-
opts.delta = this.getDelta();
|
|
6855
|
-
this._deltaTs = getHiResTimestamp4();
|
|
6856
|
-
const tag = opts.tag || opts.message;
|
|
6857
|
-
if (opts.once) {
|
|
6858
|
-
if (!cache2[tag]) {
|
|
6859
|
-
cache2[tag] = getHiResTimestamp4();
|
|
6860
|
-
} else {
|
|
6861
|
-
return noop3;
|
|
6862
|
-
}
|
|
6863
|
-
}
|
|
6864
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
6865
|
-
return method.bind(console, message, ...opts.args);
|
|
6866
|
-
}
|
|
6867
|
-
return noop3;
|
|
6324
|
+
} else {
|
|
6325
|
+
mergedOptions[key] = options[key];
|
|
6868
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;
|
|
6869
6346
|
};
|
|
6870
|
-
_defineProperty(Log2, "VERSION", VERSION3);
|
|
6871
6347
|
}
|
|
6872
6348
|
});
|
|
6873
6349
|
|
|
6874
|
-
//
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
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
|
+
};
|
|
6883
6400
|
}
|
|
6884
6401
|
});
|
|
6885
6402
|
|
|
6886
6403
|
// ../core/src/lib/utils/log.ts
|
|
6887
6404
|
var log;
|
|
6888
|
-
var
|
|
6405
|
+
var init_log2 = __esm({
|
|
6889
6406
|
"../core/src/lib/utils/log.ts"() {
|
|
6890
|
-
|
|
6891
|
-
log = new
|
|
6407
|
+
init_esm6();
|
|
6408
|
+
log = new Log({ id: "loaders.gl" });
|
|
6892
6409
|
}
|
|
6893
6410
|
});
|
|
6894
6411
|
|
|
@@ -7077,7 +6594,7 @@
|
|
|
7077
6594
|
"../core/src/lib/api/select-loader.ts"() {
|
|
7078
6595
|
init_src2();
|
|
7079
6596
|
init_normalize_loader();
|
|
7080
|
-
|
|
6597
|
+
init_log2();
|
|
7081
6598
|
init_resource_utils();
|
|
7082
6599
|
init_register_loaders();
|
|
7083
6600
|
init_is_type();
|
|
@@ -8020,6 +7537,7 @@
|
|
|
8020
7537
|
this._lodJudge = null;
|
|
8021
7538
|
this._expireDate = null;
|
|
8022
7539
|
this._expiredContent = null;
|
|
7540
|
+
this.implicitTiling = null;
|
|
8023
7541
|
Object.seal(this);
|
|
8024
7542
|
}
|
|
8025
7543
|
destroy() {
|
|
@@ -8061,6 +7579,12 @@
|
|
|
8061
7579
|
get contentFailed() {
|
|
8062
7580
|
return this.contentState === TILE_CONTENT_STATE.FAILED;
|
|
8063
7581
|
}
|
|
7582
|
+
get distanceToCamera() {
|
|
7583
|
+
return this._distanceToCamera;
|
|
7584
|
+
}
|
|
7585
|
+
get screenSpaceError() {
|
|
7586
|
+
return this._screenSpaceError;
|
|
7587
|
+
}
|
|
8064
7588
|
getScreenSpaceError(frameState, useParentLodMetric) {
|
|
8065
7589
|
switch (this.tileset.type) {
|
|
8066
7590
|
case TILESET_TYPE.I3S:
|
|
@@ -8302,8 +7826,20 @@
|
|
|
8302
7826
|
case "i3s":
|
|
8303
7827
|
return {
|
|
8304
7828
|
...this.tileset.options.i3s,
|
|
8305
|
-
|
|
8306
|
-
|
|
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
|
+
},
|
|
8307
7843
|
isTileHeader: false
|
|
8308
7844
|
};
|
|
8309
7845
|
case "3d-tiles":
|
|
@@ -8511,8 +8047,7 @@
|
|
|
8511
8047
|
...tileset.loadOptions,
|
|
8512
8048
|
i3s: {
|
|
8513
8049
|
...tileset.loadOptions.i3s,
|
|
8514
|
-
isTileHeader: true
|
|
8515
|
-
loadContent: false
|
|
8050
|
+
isTileHeader: true
|
|
8516
8051
|
}
|
|
8517
8052
|
};
|
|
8518
8053
|
return await load(nodeUrl, loader, options);
|
|
@@ -8600,6 +8135,7 @@
|
|
|
8600
8135
|
TILES_GPU_MEMORY = "Tile Memory Use";
|
|
8601
8136
|
Tileset3D = class {
|
|
8602
8137
|
constructor(json, options) {
|
|
8138
|
+
this.contentFormats = { draco: false, meshopt: false, dds: false, ktx2: false };
|
|
8603
8139
|
this.updatePromise = null;
|
|
8604
8140
|
assert2(json);
|
|
8605
8141
|
this.options = { ...DEFAULT_PROPS4, ...options };
|
|
@@ -8972,9 +8508,37 @@
|
|
|
8972
8508
|
if (tile && tile.content) {
|
|
8973
8509
|
calculateTransformProps(tile, tile.content);
|
|
8974
8510
|
}
|
|
8511
|
+
this.updateContentTypes(tile);
|
|
8975
8512
|
this._addTileToCache(tile);
|
|
8976
8513
|
this.options.onTileLoad(tile);
|
|
8977
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
|
+
}
|
|
8978
8542
|
_onStartTileLoading() {
|
|
8979
8543
|
this._pendingCount++;
|
|
8980
8544
|
this.stats.get(TILES_LOADING).incrementCount();
|
|
@@ -9096,10 +8660,10 @@
|
|
|
9096
8660
|
|
|
9097
8661
|
// src/bundle.ts
|
|
9098
8662
|
var require_bundle = __commonJS({
|
|
9099
|
-
"src/bundle.ts"(exports,
|
|
8663
|
+
"src/bundle.ts"(exports, module) {
|
|
9100
8664
|
var moduleExports = (init_src4(), src_exports);
|
|
9101
8665
|
globalThis.loaders = globalThis.loaders || {};
|
|
9102
|
-
|
|
8666
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
9103
8667
|
}
|
|
9104
8668
|
});
|
|
9105
8669
|
require_bundle();
|