@loaders.gl/tiles 3.4.0-alpha.3 → 3.4.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/constants.d.ts +6 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +0 -1
  4. package/dist/dist.min.js +240 -440
  5. package/dist/es5/constants.js.map +1 -1
  6. package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
  7. package/dist/es5/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
  8. package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
  9. package/dist/es5/tileset/helpers/3d-tiles-options.js.map +1 -1
  10. package/dist/es5/tileset/helpers/bounding-volume.js.map +1 -1
  11. package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
  12. package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
  13. package/dist/es5/tileset/helpers/tiles-3d-lod.js.map +1 -1
  14. package/dist/es5/tileset/helpers/transform-utils.js.map +1 -1
  15. package/dist/es5/tileset/helpers/zoom.js.map +1 -1
  16. package/dist/es5/tileset/tile-3d.js +41 -71
  17. package/dist/es5/tileset/tile-3d.js.map +1 -1
  18. package/dist/es5/tileset/tileset-3d.js +68 -102
  19. package/dist/es5/tileset/tileset-3d.js.map +1 -1
  20. package/dist/es5/tileset/tileset-cache.js +4 -7
  21. package/dist/es5/tileset/tileset-cache.js.map +1 -1
  22. package/dist/es5/tileset/tileset-traverser.js +12 -22
  23. package/dist/es5/tileset/tileset-traverser.js.map +1 -1
  24. package/dist/es5/utils/managed-array.js.map +1 -1
  25. package/dist/esm/constants.js.map +1 -1
  26. package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
  27. package/dist/esm/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
  28. package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
  29. package/dist/esm/tileset/helpers/3d-tiles-options.js.map +1 -1
  30. package/dist/esm/tileset/helpers/bounding-volume.js.map +1 -1
  31. package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
  32. package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
  33. package/dist/esm/tileset/helpers/tiles-3d-lod.js.map +1 -1
  34. package/dist/esm/tileset/helpers/transform-utils.js.map +1 -1
  35. package/dist/esm/tileset/helpers/zoom.js.map +1 -1
  36. package/dist/esm/tileset/tile-3d.js +39 -71
  37. package/dist/esm/tileset/tile-3d.js.map +1 -1
  38. package/dist/esm/tileset/tileset-3d.js +64 -94
  39. package/dist/esm/tileset/tileset-3d.js.map +1 -1
  40. package/dist/esm/tileset/tileset-cache.js +4 -7
  41. package/dist/esm/tileset/tileset-cache.js.map +1 -1
  42. package/dist/esm/tileset/tileset-traverser.js +9 -19
  43. package/dist/esm/tileset/tileset-traverser.js.map +1 -1
  44. package/dist/esm/utils/managed-array.js.map +1 -1
  45. package/dist/tileset/helpers/3d-tiles-options.d.ts +3 -2
  46. package/dist/tileset/helpers/3d-tiles-options.d.ts.map +1 -1
  47. package/dist/tileset/tile-3d.d.ts +36 -21
  48. package/dist/tileset/tile-3d.d.ts.map +1 -1
  49. package/dist/tileset/tile-3d.js +58 -43
  50. package/dist/tileset/tileset-3d.d.ts +90 -43
  51. package/dist/tileset/tileset-3d.d.ts.map +1 -1
  52. package/dist/tileset/tileset-3d.js +108 -127
  53. package/dist/tileset/tileset-cache.d.ts +5 -4
  54. package/dist/tileset/tileset-cache.d.ts.map +1 -1
  55. package/dist/tileset/tileset-cache.js +4 -10
  56. package/dist/tileset/tileset-traverser.d.ts +32 -21
  57. package/dist/tileset/tileset-traverser.d.ts.map +1 -1
  58. package/dist/tileset/tileset-traverser.js +23 -35
  59. package/package.json +4 -4
  60. package/src/constants.ts +18 -0
  61. package/src/tileset/helpers/3d-tiles-options.ts +3 -1
  62. package/src/tileset/tile-3d.ts +70 -109
  63. package/src/tileset/tileset-3d.ts +178 -216
  64. package/src/tileset/tileset-cache.ts +20 -15
  65. package/src/tileset/tileset-traverser.ts +52 -68
package/dist/dist.min.js CHANGED
@@ -3394,7 +3394,7 @@
3394
3394
  }
3395
3395
  });
3396
3396
 
3397
- // node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
3397
+ // ../../node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
3398
3398
  function getHiResTimestamp() {
3399
3399
  let timestamp;
3400
3400
  if (typeof window !== "undefined" && window.performance) {
@@ -3408,14 +3408,14 @@
3408
3408
  return timestamp;
3409
3409
  }
3410
3410
  var init_hi_res_timestamp = __esm({
3411
- "node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
3411
+ "../../node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
3412
3412
  }
3413
3413
  });
3414
3414
 
3415
- // node_modules/@probe.gl/stats/dist/lib/stat.js
3415
+ // ../../node_modules/@probe.gl/stats/dist/lib/stat.js
3416
3416
  var Stat;
3417
3417
  var init_stat = __esm({
3418
- "node_modules/@probe.gl/stats/dist/lib/stat.js"() {
3418
+ "../../node_modules/@probe.gl/stats/dist/lib/stat.js"() {
3419
3419
  init_defineProperty();
3420
3420
  init_hi_res_timestamp();
3421
3421
  Stat = class {
@@ -3531,10 +3531,10 @@
3531
3531
  }
3532
3532
  });
3533
3533
 
3534
- // node_modules/@probe.gl/stats/dist/lib/stats.js
3534
+ // ../../node_modules/@probe.gl/stats/dist/lib/stats.js
3535
3535
  var Stats;
3536
3536
  var init_stats = __esm({
3537
- "node_modules/@probe.gl/stats/dist/lib/stats.js"() {
3537
+ "../../node_modules/@probe.gl/stats/dist/lib/stats.js"() {
3538
3538
  init_defineProperty();
3539
3539
  init_stat();
3540
3540
  Stats = class {
@@ -3584,29 +3584,28 @@
3584
3584
  stats.forEach((stat) => this._getOrCreate(stat));
3585
3585
  }
3586
3586
  _getOrCreate(stat) {
3587
- if (!stat || !stat.name) {
3588
- return null;
3589
- }
3590
3587
  const {
3591
3588
  name,
3592
3589
  type
3593
3590
  } = stat;
3594
- if (!this.stats[name]) {
3591
+ let result = this.stats[name];
3592
+ if (!result) {
3595
3593
  if (stat instanceof Stat) {
3596
- this.stats[name] = stat;
3594
+ result = stat;
3597
3595
  } else {
3598
- this.stats[name] = new Stat(name, type);
3596
+ result = new Stat(name, type);
3599
3597
  }
3598
+ this.stats[name] = result;
3600
3599
  }
3601
- return this.stats[name] || null;
3600
+ return result;
3602
3601
  }
3603
3602
  };
3604
3603
  }
3605
3604
  });
3606
3605
 
3607
- // node_modules/@probe.gl/stats/dist/index.js
3606
+ // ../../node_modules/@probe.gl/stats/dist/index.js
3608
3607
  var init_dist = __esm({
3609
- "node_modules/@probe.gl/stats/dist/index.js"() {
3608
+ "../../node_modules/@probe.gl/stats/dist/index.js"() {
3610
3609
  init_stats();
3611
3610
  init_stat();
3612
3611
  init_hi_res_timestamp();
@@ -4252,230 +4251,11 @@
4252
4251
  }
4253
4252
  });
4254
4253
 
4255
- // ../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
4256
- function getHiResTimestamp2() {
4257
- let timestamp;
4258
- if (typeof window !== "undefined" && window.performance) {
4259
- timestamp = window.performance.now();
4260
- } else if (typeof process !== "undefined" && process.hrtime) {
4261
- const timeParts = process.hrtime();
4262
- timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
4263
- } else {
4264
- timestamp = Date.now();
4265
- }
4266
- return timestamp;
4267
- }
4268
- var init_hi_res_timestamp2 = __esm({
4269
- "../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
4270
- }
4271
- });
4272
-
4273
- // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js
4274
- var Stat2;
4275
- var init_stat2 = __esm({
4276
- "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js"() {
4277
- init_defineProperty();
4278
- init_hi_res_timestamp2();
4279
- Stat2 = class {
4280
- constructor(name, type) {
4281
- _defineProperty(this, "name", void 0);
4282
- _defineProperty(this, "type", void 0);
4283
- _defineProperty(this, "sampleSize", 1);
4284
- _defineProperty(this, "time", 0);
4285
- _defineProperty(this, "count", 0);
4286
- _defineProperty(this, "samples", 0);
4287
- _defineProperty(this, "lastTiming", 0);
4288
- _defineProperty(this, "lastSampleTime", 0);
4289
- _defineProperty(this, "lastSampleCount", 0);
4290
- _defineProperty(this, "_count", 0);
4291
- _defineProperty(this, "_time", 0);
4292
- _defineProperty(this, "_samples", 0);
4293
- _defineProperty(this, "_startTime", 0);
4294
- _defineProperty(this, "_timerPending", false);
4295
- this.name = name;
4296
- this.type = type;
4297
- this.reset();
4298
- }
4299
- reset() {
4300
- this.time = 0;
4301
- this.count = 0;
4302
- this.samples = 0;
4303
- this.lastTiming = 0;
4304
- this.lastSampleTime = 0;
4305
- this.lastSampleCount = 0;
4306
- this._count = 0;
4307
- this._time = 0;
4308
- this._samples = 0;
4309
- this._startTime = 0;
4310
- this._timerPending = false;
4311
- return this;
4312
- }
4313
- setSampleSize(samples) {
4314
- this.sampleSize = samples;
4315
- return this;
4316
- }
4317
- incrementCount() {
4318
- this.addCount(1);
4319
- return this;
4320
- }
4321
- decrementCount() {
4322
- this.subtractCount(1);
4323
- return this;
4324
- }
4325
- addCount(value) {
4326
- this._count += value;
4327
- this._samples++;
4328
- this._checkSampling();
4329
- return this;
4330
- }
4331
- subtractCount(value) {
4332
- this._count -= value;
4333
- this._samples++;
4334
- this._checkSampling();
4335
- return this;
4336
- }
4337
- addTime(time) {
4338
- this._time += time;
4339
- this.lastTiming = time;
4340
- this._samples++;
4341
- this._checkSampling();
4342
- return this;
4343
- }
4344
- timeStart() {
4345
- this._startTime = getHiResTimestamp2();
4346
- this._timerPending = true;
4347
- return this;
4348
- }
4349
- timeEnd() {
4350
- if (!this._timerPending) {
4351
- return this;
4352
- }
4353
- this.addTime(getHiResTimestamp2() - this._startTime);
4354
- this._timerPending = false;
4355
- this._checkSampling();
4356
- return this;
4357
- }
4358
- getSampleAverageCount() {
4359
- return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;
4360
- }
4361
- getSampleAverageTime() {
4362
- return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;
4363
- }
4364
- getSampleHz() {
4365
- return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1e3) : 0;
4366
- }
4367
- getAverageCount() {
4368
- return this.samples > 0 ? this.count / this.samples : 0;
4369
- }
4370
- getAverageTime() {
4371
- return this.samples > 0 ? this.time / this.samples : 0;
4372
- }
4373
- getHz() {
4374
- return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
4375
- }
4376
- _checkSampling() {
4377
- if (this._samples === this.sampleSize) {
4378
- this.lastSampleTime = this._time;
4379
- this.lastSampleCount = this._count;
4380
- this.count += this._count;
4381
- this.time += this._time;
4382
- this.samples += this._samples;
4383
- this._time = 0;
4384
- this._count = 0;
4385
- this._samples = 0;
4386
- }
4387
- }
4388
- };
4389
- }
4390
- });
4391
-
4392
- // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js
4393
- var Stats2;
4394
- var init_stats2 = __esm({
4395
- "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js"() {
4396
- init_defineProperty();
4397
- init_stat2();
4398
- Stats2 = class {
4399
- constructor(options) {
4400
- _defineProperty(this, "id", void 0);
4401
- _defineProperty(this, "stats", {});
4402
- this.id = options.id;
4403
- this.stats = {};
4404
- this._initializeStats(options.stats);
4405
- Object.seal(this);
4406
- }
4407
- get(name) {
4408
- let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
4409
- return this._getOrCreate({
4410
- name,
4411
- type
4412
- });
4413
- }
4414
- get size() {
4415
- return Object.keys(this.stats).length;
4416
- }
4417
- reset() {
4418
- for (const stat of Object.values(this.stats)) {
4419
- stat.reset();
4420
- }
4421
- return this;
4422
- }
4423
- forEach(fn) {
4424
- for (const stat of Object.values(this.stats)) {
4425
- fn(stat);
4426
- }
4427
- }
4428
- getTable() {
4429
- const table = {};
4430
- this.forEach((stat) => {
4431
- table[stat.name] = {
4432
- time: stat.time || 0,
4433
- count: stat.count || 0,
4434
- average: stat.getAverageTime() || 0,
4435
- hz: stat.getHz() || 0
4436
- };
4437
- });
4438
- return table;
4439
- }
4440
- _initializeStats() {
4441
- let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4442
- stats.forEach((stat) => this._getOrCreate(stat));
4443
- }
4444
- _getOrCreate(stat) {
4445
- if (!stat || !stat.name) {
4446
- return null;
4447
- }
4448
- const {
4449
- name,
4450
- type
4451
- } = stat;
4452
- if (!this.stats[name]) {
4453
- if (stat instanceof Stat2) {
4454
- this.stats[name] = stat;
4455
- } else {
4456
- this.stats[name] = new Stat2(name, type);
4457
- }
4458
- }
4459
- return this.stats[name] || null;
4460
- }
4461
- };
4462
- }
4463
- });
4464
-
4465
- // ../loader-utils/node_modules/@probe.gl/stats/dist/index.js
4466
- var init_dist2 = __esm({
4467
- "../loader-utils/node_modules/@probe.gl/stats/dist/index.js"() {
4468
- init_stats2();
4469
- init_stat2();
4470
- init_hi_res_timestamp2();
4471
- }
4472
- });
4473
-
4474
4254
  // ../loader-utils/src/lib/request-utils/request-scheduler.ts
4475
4255
  var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
4476
4256
  var init_request_scheduler = __esm({
4477
4257
  "../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
4478
- init_dist2();
4258
+ init_dist();
4479
4259
  STAT_QUEUED_REQUESTS = "Queued Requests";
4480
4260
  STAT_ACTIVE_REQUESTS = "Active Requests";
4481
4261
  STAT_CANCELLED_REQUESTS = "Cancelled Requests";
@@ -4493,7 +4273,7 @@
4493
4273
  this.requestMap = new Map();
4494
4274
  this.deferredUpdate = null;
4495
4275
  this.props = { ...DEFAULT_PROPS2, ...props };
4496
- this.stats = new Stats2({ id: this.props.id });
4276
+ this.stats = new Stats({ id: this.props.id });
4497
4277
  this.stats.get(STAT_QUEUED_REQUESTS);
4498
4278
  this.stats.get(STAT_ACTIVE_REQUESTS);
4499
4279
  this.stats.get(STAT_CANCELLED_REQUESTS);
@@ -4889,9 +4669,6 @@
4889
4669
  });
4890
4670
 
4891
4671
  // src/tileset/tileset-cache.ts
4892
- function defined(x) {
4893
- return x !== void 0 && x !== null;
4894
- }
4895
4672
  var TilesetCache;
4896
4673
  var init_tileset_cache = __esm({
4897
4674
  "src/tileset/tileset-cache.ts"() {
@@ -4907,12 +4684,12 @@
4907
4684
  }
4908
4685
  touch(tile) {
4909
4686
  const node2 = tile._cacheNode;
4910
- if (defined(node2)) {
4687
+ if (node2) {
4911
4688
  this._list.splice(this._sentinel, node2);
4912
4689
  }
4913
4690
  }
4914
4691
  add(tileset, tile, addCallback) {
4915
- if (!defined(tile._cacheNode)) {
4692
+ if (!tile._cacheNode) {
4916
4693
  tile._cacheNode = this._list.add(tile);
4917
4694
  if (addCallback) {
4918
4695
  addCallback(tileset, tile);
@@ -4921,11 +4698,11 @@
4921
4698
  }
4922
4699
  unloadTile(tileset, tile, unloadCallback) {
4923
4700
  const node2 = tile._cacheNode;
4924
- if (!defined(node2)) {
4701
+ if (!node2) {
4925
4702
  return;
4926
4703
  }
4927
4704
  this._list.remove(node2);
4928
- tile._cacheNode = void 0;
4705
+ tile._cacheNode = null;
4929
4706
  if (unloadCallback) {
4930
4707
  unloadCallback(tileset, tile);
4931
4708
  }
@@ -5751,39 +5528,60 @@
5751
5528
  }
5752
5529
  });
5753
5530
 
5531
+ // ../core/src/lib/utils/url-utils.ts
5532
+ function extractQueryString(url) {
5533
+ const matches3 = url.match(QUERY_STRING_PATTERN);
5534
+ return matches3 && matches3[0];
5535
+ }
5536
+ function stripQueryString(url) {
5537
+ return url.replace(QUERY_STRING_PATTERN, "");
5538
+ }
5539
+ var QUERY_STRING_PATTERN;
5540
+ var init_url_utils = __esm({
5541
+ "../core/src/lib/utils/url-utils.ts"() {
5542
+ QUERY_STRING_PATTERN = /\?.*/;
5543
+ }
5544
+ });
5545
+
5754
5546
  // ../core/src/lib/utils/resource-utils.ts
5755
- function getResourceUrlAndType(resource) {
5547
+ function getResourceUrl(resource) {
5756
5548
  if (isResponse(resource)) {
5757
- const url = stripQueryString(resource.url || "");
5758
- const contentTypeHeader = resource.headers.get("content-type") || "";
5759
- return {
5760
- url,
5761
- type: parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(url)
5762
- };
5549
+ const response = resource;
5550
+ return response.url;
5763
5551
  }
5764
5552
  if (isBlob(resource)) {
5765
- return {
5766
- url: stripQueryString(resource.name || ""),
5767
- type: resource.type || ""
5768
- };
5553
+ const blob = resource;
5554
+ return blob.name || "";
5769
5555
  }
5770
5556
  if (typeof resource === "string") {
5771
- return {
5772
- url: stripQueryString(resource),
5773
- type: parseMIMETypeFromURL(resource)
5774
- };
5557
+ return resource;
5775
5558
  }
5776
- return {
5777
- url: "",
5778
- type: ""
5779
- };
5559
+ return "";
5560
+ }
5561
+ function getResourceMIMEType(resource) {
5562
+ if (isResponse(resource)) {
5563
+ const response = resource;
5564
+ const contentTypeHeader = response.headers.get("content-type") || "";
5565
+ const noQueryUrl = stripQueryString(response.url);
5566
+ return parseMIMEType(contentTypeHeader) || parseMIMETypeFromURL(noQueryUrl);
5567
+ }
5568
+ if (isBlob(resource)) {
5569
+ const blob = resource;
5570
+ return blob.type || "";
5571
+ }
5572
+ if (typeof resource === "string") {
5573
+ return parseMIMETypeFromURL(resource);
5574
+ }
5575
+ return "";
5780
5576
  }
5781
5577
  function getResourceContentLength(resource) {
5782
5578
  if (isResponse(resource)) {
5783
- return resource.headers["content-length"] || -1;
5579
+ const response = resource;
5580
+ return response.headers["content-length"] || -1;
5784
5581
  }
5785
5582
  if (isBlob(resource)) {
5786
- return resource.size;
5583
+ const blob = resource;
5584
+ return blob.size;
5787
5585
  }
5788
5586
  if (typeof resource === "string") {
5789
5587
  return resource.length;
@@ -5796,15 +5594,11 @@
5796
5594
  }
5797
5595
  return -1;
5798
5596
  }
5799
- function stripQueryString(url) {
5800
- return url.replace(QUERY_STRING_PATTERN, "");
5801
- }
5802
- var QUERY_STRING_PATTERN;
5803
5597
  var init_resource_utils = __esm({
5804
5598
  "../core/src/lib/utils/resource-utils.ts"() {
5805
5599
  init_is_type();
5806
5600
  init_mime_type_utils();
5807
- QUERY_STRING_PATTERN = /\?.*/;
5601
+ init_url_utils();
5808
5602
  }
5809
5603
  });
5810
5604
 
@@ -5818,7 +5612,8 @@
5818
5612
  if (contentLength >= 0) {
5819
5613
  headers["content-length"] = String(contentLength);
5820
5614
  }
5821
- const { url, type } = getResourceUrlAndType(resource);
5615
+ const url = getResourceUrl(resource);
5616
+ const type = getResourceMIMEType(resource);
5822
5617
  if (type) {
5823
5618
  headers["content-type"] = type;
5824
5619
  }
@@ -5907,7 +5702,7 @@
5907
5702
  }
5908
5703
  });
5909
5704
 
5910
- // ../core/node_modules/@probe.gl/env/dist/lib/is-electron.js
5705
+ // ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
5911
5706
  function isElectron(mockUserAgent) {
5912
5707
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
5913
5708
  return true;
@@ -5923,54 +5718,54 @@
5923
5718
  return false;
5924
5719
  }
5925
5720
  var init_is_electron = __esm({
5926
- "../core/node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
5721
+ "../../node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
5927
5722
  }
5928
5723
  });
5929
5724
 
5930
- // ../core/node_modules/@probe.gl/env/dist/lib/is-browser.js
5725
+ // ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
5931
5726
  function isBrowser3() {
5932
5727
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
5933
5728
  return !isNode || isElectron();
5934
5729
  }
5935
5730
  var init_is_browser = __esm({
5936
- "../core/node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
5731
+ "../../node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
5937
5732
  init_is_electron();
5938
5733
  }
5939
5734
  });
5940
5735
 
5941
- // ../core/node_modules/@probe.gl/env/dist/lib/globals.js
5942
- var self2, window2, document2, process2, console2, navigator2;
5736
+ // ../../node_modules/@probe.gl/env/dist/lib/globals.js
5737
+ var self_3, window_3, document_3, process_, console_, navigator_;
5943
5738
  var init_globals3 = __esm({
5944
- "../core/node_modules/@probe.gl/env/dist/lib/globals.js"() {
5945
- self2 = globalThis.self || globalThis.window || globalThis.global;
5946
- window2 = globalThis.window || globalThis.self || globalThis.global;
5947
- document2 = globalThis.document || {};
5948
- process2 = globalThis.process || {};
5949
- console2 = globalThis.console;
5950
- navigator2 = globalThis.navigator || {};
5739
+ "../../node_modules/@probe.gl/env/dist/lib/globals.js"() {
5740
+ self_3 = globalThis.self || globalThis.window || globalThis.global;
5741
+ window_3 = globalThis.window || globalThis.self || globalThis.global;
5742
+ document_3 = globalThis.document || {};
5743
+ process_ = globalThis.process || {};
5744
+ console_ = globalThis.console;
5745
+ navigator_ = globalThis.navigator || {};
5951
5746
  }
5952
5747
  });
5953
5748
 
5954
- // ../core/node_modules/@probe.gl/env/dist/utils/globals.js
5749
+ // ../../node_modules/@probe.gl/env/dist/utils/globals.js
5955
5750
  var VERSION2, isBrowser4;
5956
5751
  var init_globals4 = __esm({
5957
- "../core/node_modules/@probe.gl/env/dist/utils/globals.js"() {
5752
+ "../../node_modules/@probe.gl/env/dist/utils/globals.js"() {
5958
5753
  init_is_browser();
5959
5754
  VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
5960
5755
  isBrowser4 = isBrowser3();
5961
5756
  }
5962
5757
  });
5963
5758
 
5964
- // ../core/node_modules/@probe.gl/env/dist/index.js
5965
- var init_dist3 = __esm({
5966
- "../core/node_modules/@probe.gl/env/dist/index.js"() {
5759
+ // ../../node_modules/@probe.gl/env/dist/index.js
5760
+ var init_dist2 = __esm({
5761
+ "../../node_modules/@probe.gl/env/dist/index.js"() {
5967
5762
  init_globals4();
5968
5763
  init_globals3();
5969
5764
  init_is_browser();
5970
5765
  }
5971
5766
  });
5972
5767
 
5973
- // ../core/node_modules/@probe.gl/log/dist/utils/local-storage.js
5768
+ // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
5974
5769
  function getStorage(type) {
5975
5770
  try {
5976
5771
  const storage = window[type];
@@ -5984,7 +5779,7 @@
5984
5779
  }
5985
5780
  var LocalStorage;
5986
5781
  var init_local_storage = __esm({
5987
- "../core/node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
5782
+ "../../node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
5988
5783
  init_defineProperty();
5989
5784
  LocalStorage = class {
5990
5785
  constructor(id, defaultConfig) {
@@ -6020,7 +5815,7 @@
6020
5815
  }
6021
5816
  });
6022
5817
 
6023
- // ../core/node_modules/@probe.gl/log/dist/utils/formatters.js
5818
+ // ../../node_modules/@probe.gl/log/dist/utils/formatters.js
6024
5819
  function formatTime(ms) {
6025
5820
  let formatted;
6026
5821
  if (ms < 10) {
@@ -6051,11 +5846,11 @@
6051
5846
  return ["".concat(message, " %c+"), style];
6052
5847
  }
6053
5848
  var init_formatters = __esm({
6054
- "../core/node_modules/@probe.gl/log/dist/utils/formatters.js"() {
5849
+ "../../node_modules/@probe.gl/log/dist/utils/formatters.js"() {
6055
5850
  }
6056
5851
  });
6057
5852
 
6058
- // ../core/node_modules/@probe.gl/log/dist/utils/color.js
5853
+ // ../../node_modules/@probe.gl/log/dist/utils/color.js
6059
5854
  function getColor(color) {
6060
5855
  if (typeof color !== "string") {
6061
5856
  return color;
@@ -6078,8 +5873,8 @@
6078
5873
  }
6079
5874
  var COLOR, BACKGROUND_INCREMENT;
6080
5875
  var init_color = __esm({
6081
- "../core/node_modules/@probe.gl/log/dist/utils/color.js"() {
6082
- init_dist3();
5876
+ "../../node_modules/@probe.gl/log/dist/utils/color.js"() {
5877
+ init_dist2();
6083
5878
  (function(COLOR2) {
6084
5879
  COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
6085
5880
  COLOR2[COLOR2["RED"] = 31] = "RED";
@@ -6102,7 +5897,7 @@
6102
5897
  }
6103
5898
  });
6104
5899
 
6105
- // ../core/node_modules/@probe.gl/log/dist/utils/autobind.js
5900
+ // ../../node_modules/@probe.gl/log/dist/utils/autobind.js
6106
5901
  function autobind(obj) {
6107
5902
  let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
6108
5903
  const proto = Object.getPrototypeOf(obj);
@@ -6118,43 +5913,43 @@
6118
5913
  }
6119
5914
  }
6120
5915
  var init_autobind = __esm({
6121
- "../core/node_modules/@probe.gl/log/dist/utils/autobind.js"() {
5916
+ "../../node_modules/@probe.gl/log/dist/utils/autobind.js"() {
6122
5917
  }
6123
5918
  });
6124
5919
 
6125
- // ../core/node_modules/@probe.gl/log/dist/utils/assert.js
5920
+ // ../../node_modules/@probe.gl/log/dist/utils/assert.js
6126
5921
  function assert4(condition, message) {
6127
5922
  if (!condition) {
6128
5923
  throw new Error(message || "Assertion failed");
6129
5924
  }
6130
5925
  }
6131
5926
  var init_assert4 = __esm({
6132
- "../core/node_modules/@probe.gl/log/dist/utils/assert.js"() {
5927
+ "../../node_modules/@probe.gl/log/dist/utils/assert.js"() {
6133
5928
  }
6134
5929
  });
6135
5930
 
6136
- // ../core/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
6137
- function getHiResTimestamp3() {
5931
+ // ../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
5932
+ function getHiResTimestamp2() {
6138
5933
  let timestamp;
6139
- if (isBrowser3() && window2.performance) {
5934
+ if (isBrowser3() && window_3.performance) {
6140
5935
  var _window$performance, _window$performance$n;
6141
- timestamp = window2 === null || window2 === void 0 ? void 0 : (_window$performance = window2.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);
6142
- } else if ("hrtime" in process2) {
5936
+ 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);
5937
+ } else if ("hrtime" in process_) {
6143
5938
  var _process$hrtime;
6144
- const timeParts = process2 === null || process2 === void 0 ? void 0 : (_process$hrtime = process2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process2);
5939
+ const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
6145
5940
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
6146
5941
  } else {
6147
5942
  timestamp = Date.now();
6148
5943
  }
6149
5944
  return timestamp;
6150
5945
  }
6151
- var init_hi_res_timestamp3 = __esm({
6152
- "../core/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
6153
- init_dist3();
5946
+ var init_hi_res_timestamp2 = __esm({
5947
+ "../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
5948
+ init_dist2();
6154
5949
  }
6155
5950
  });
6156
5951
 
6157
- // ../core/node_modules/@probe.gl/log/dist/log.js
5952
+ // ../../node_modules/@probe.gl/log/dist/log.js
6158
5953
  function noop() {
6159
5954
  }
6160
5955
  function normalizeLogLevel(logLevel) {
@@ -6261,15 +6056,15 @@
6261
6056
  }
6262
6057
  var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
6263
6058
  var init_log = __esm({
6264
- "../core/node_modules/@probe.gl/log/dist/log.js"() {
6059
+ "../../node_modules/@probe.gl/log/dist/log.js"() {
6265
6060
  init_defineProperty();
6266
- init_dist3();
6061
+ init_dist2();
6267
6062
  init_local_storage();
6268
6063
  init_formatters();
6269
6064
  init_color();
6270
6065
  init_autobind();
6271
6066
  init_assert4();
6272
- init_hi_res_timestamp3();
6067
+ init_hi_res_timestamp2();
6273
6068
  originalConsole = {
6274
6069
  debug: isBrowser3() ? console.debug || console.log : console.log,
6275
6070
  log: console.log,
@@ -6294,8 +6089,8 @@
6294
6089
  };
6295
6090
  _defineProperty(this, "id", void 0);
6296
6091
  _defineProperty(this, "VERSION", VERSION2);
6297
- _defineProperty(this, "_startTs", getHiResTimestamp3());
6298
- _defineProperty(this, "_deltaTs", getHiResTimestamp3());
6092
+ _defineProperty(this, "_startTs", getHiResTimestamp2());
6093
+ _defineProperty(this, "_deltaTs", getHiResTimestamp2());
6299
6094
  _defineProperty(this, "_storage", void 0);
6300
6095
  _defineProperty(this, "userData", {});
6301
6096
  _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
@@ -6319,10 +6114,10 @@
6319
6114
  return this._storage.config.level;
6320
6115
  }
6321
6116
  getTotal() {
6322
- return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
6117
+ return Number((getHiResTimestamp2() - this._startTs).toPrecision(10));
6323
6118
  }
6324
6119
  getDelta() {
6325
- return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
6120
+ return Number((getHiResTimestamp2() - this._deltaTs).toPrecision(10));
6326
6121
  }
6327
6122
  set priority(newPriority) {
6328
6123
  this.level = newPriority;
@@ -6481,11 +6276,11 @@
6481
6276
  assert4(method);
6482
6277
  opts.total = this.getTotal();
6483
6278
  opts.delta = this.getDelta();
6484
- this._deltaTs = getHiResTimestamp3();
6279
+ this._deltaTs = getHiResTimestamp2();
6485
6280
  const tag = opts.tag || opts.message;
6486
6281
  if (opts.once && tag) {
6487
6282
  if (!cache[tag]) {
6488
- cache[tag] = getHiResTimestamp3();
6283
+ cache[tag] = getHiResTimestamp2();
6489
6284
  } else {
6490
6285
  return noop;
6491
6286
  }
@@ -6500,10 +6295,10 @@
6500
6295
  }
6501
6296
  });
6502
6297
 
6503
- // ../core/node_modules/@probe.gl/log/dist/index.js
6298
+ // ../../node_modules/@probe.gl/log/dist/index.js
6504
6299
  var dist_default;
6505
- var init_dist4 = __esm({
6506
- "../core/node_modules/@probe.gl/log/dist/index.js"() {
6300
+ var init_dist3 = __esm({
6301
+ "../../node_modules/@probe.gl/log/dist/index.js"() {
6507
6302
  init_log();
6508
6303
  init_log();
6509
6304
  dist_default = new Log({
@@ -6516,7 +6311,7 @@
6516
6311
  var probeLog, NullLog, ConsoleLog;
6517
6312
  var init_loggers = __esm({
6518
6313
  "../core/src/lib/loader-utils/loggers.ts"() {
6519
- init_dist4();
6314
+ init_dist3();
6520
6315
  probeLog = new Log({ id: "loaders.gl" });
6521
6316
  NullLog = class {
6522
6317
  log() {
@@ -6759,7 +6554,7 @@
6759
6554
  var log;
6760
6555
  var init_log2 = __esm({
6761
6556
  "../core/src/lib/utils/log.ts"() {
6762
- init_dist4();
6557
+ init_dist3();
6763
6558
  log = new Log({ id: "loaders.gl" });
6764
6559
  }
6765
6560
  });
@@ -6804,8 +6599,9 @@
6804
6599
  return loader;
6805
6600
  }
6806
6601
  function selectLoaderInternal(data, loaders, options, context) {
6807
- const { url, type } = getResourceUrlAndType(data);
6808
- const testUrl = url || context?.url;
6602
+ const url = getResourceUrl(data);
6603
+ const type = getResourceMIMEType(data);
6604
+ const testUrl = stripQueryString(url) || context?.url;
6809
6605
  let loader = null;
6810
6606
  let reason = "";
6811
6607
  if (options?.mimeType) {
@@ -6834,7 +6630,8 @@
6834
6630
  return true;
6835
6631
  }
6836
6632
  function getNoValidLoaderMessage(data) {
6837
- const { url, type } = getResourceUrlAndType(data);
6633
+ const url = getResourceUrl(data);
6634
+ const type = getResourceMIMEType(data);
6838
6635
  let message = "No valid loader found (";
6839
6636
  message += url ? `${path_exports.filename(url)}, ` : "no url provided, ";
6840
6637
  message += `MIME type: ${type ? `"${type}"` : "not provided"}, `;
@@ -6953,6 +6750,7 @@
6953
6750
  init_resource_utils();
6954
6751
  init_register_loaders();
6955
6752
  init_is_type();
6753
+ init_url_utils();
6956
6754
  EXT_PATTERN = /\.([^.]+)$/;
6957
6755
  }
6958
6756
  });
@@ -7165,18 +6963,25 @@
7165
6963
  });
7166
6964
 
7167
6965
  // ../core/src/lib/loader-utils/loader-context.ts
7168
- function getLoaderContext(context, options, previousContext = null) {
7169
- if (previousContext) {
7170
- return previousContext;
6966
+ function getLoaderContext(context, options, parentContext) {
6967
+ if (parentContext) {
6968
+ return parentContext;
7171
6969
  }
7172
- const resolvedContext = {
6970
+ const newContext = {
7173
6971
  fetch: getFetchFunction(options, context),
7174
6972
  ...context
7175
6973
  };
7176
- if (!Array.isArray(resolvedContext.loaders)) {
7177
- resolvedContext.loaders = null;
6974
+ if (newContext.url) {
6975
+ const baseUrl = stripQueryString(newContext.url);
6976
+ newContext.baseUrl = baseUrl;
6977
+ newContext.queryString = extractQueryString(newContext.url);
6978
+ newContext.filename = path_exports.filename(baseUrl);
6979
+ newContext.baseUrl = path_exports.dirname(baseUrl);
7178
6980
  }
7179
- return resolvedContext;
6981
+ if (!Array.isArray(newContext.loaders)) {
6982
+ newContext.loaders = null;
6983
+ }
6984
+ return newContext;
7180
6985
  }
7181
6986
  function getLoadersFromContext(loaders, context) {
7182
6987
  if (!context && loaders && !Array.isArray(loaders)) {
@@ -7195,6 +7000,8 @@
7195
7000
  var init_loader_context = __esm({
7196
7001
  "../core/src/lib/loader-utils/loader-context.ts"() {
7197
7002
  init_get_fetch_function();
7003
+ init_url_utils();
7004
+ init_src2();
7198
7005
  }
7199
7006
  });
7200
7007
 
@@ -7208,7 +7015,7 @@
7208
7015
  }
7209
7016
  data = await data;
7210
7017
  options = options || {};
7211
- const { url } = getResourceUrlAndType(data);
7018
+ const url = getResourceUrl(data);
7212
7019
  const typedLoaders = loaders;
7213
7020
  const candidateLoaders = getLoadersFromContext(typedLoaders, context);
7214
7021
  const loader = await selectLoader(data, candidateLoaders, options);
@@ -7216,7 +7023,7 @@
7216
7023
  return null;
7217
7024
  }
7218
7025
  options = normalizeOptions(options, loader, candidateLoaders, url);
7219
- context = getLoaderContext({ url, parse, loaders: candidateLoaders }, options, context);
7026
+ context = getLoaderContext({ url, parse, loaders: candidateLoaders }, options, context || null);
7220
7027
  return await parseWithLoader(loader, data, options, context);
7221
7028
  }
7222
7029
  async function parseWithLoader(loader, data, options, context) {
@@ -7330,7 +7137,7 @@
7330
7137
  });
7331
7138
 
7332
7139
  // src/tileset/helpers/bounding-volume.ts
7333
- function defined2(x) {
7140
+ function defined(x) {
7334
7141
  return x !== void 0 && x !== null;
7335
7142
  }
7336
7143
  function createBoundingVolume(boundingVolumeHeader, transform, result) {
@@ -7402,7 +7209,7 @@
7402
7209
  zAxis[1],
7403
7210
  zAxis[2]
7404
7211
  ]);
7405
- if (defined2(result)) {
7212
+ if (defined(result)) {
7406
7213
  result.center = center;
7407
7214
  result.halfAxes = halfAxes;
7408
7215
  return result;
@@ -7415,7 +7222,7 @@
7415
7222
  const scale5 = transform.getScale(scratchScale);
7416
7223
  const uniformScale = Math.max(Math.max(scale5[0], scale5[1]), scale5[2]);
7417
7224
  const radius = sphere[3] * uniformScale;
7418
- if (defined2(result)) {
7225
+ if (defined(result)) {
7419
7226
  result.center = center;
7420
7227
  result.radius = radius;
7421
7228
  return result;
@@ -7717,16 +7524,16 @@
7717
7524
  };
7718
7525
  TilesetTraverser = class {
7719
7526
  constructor(options) {
7527
+ this.root = null;
7528
+ this.selectedTiles = {};
7529
+ this.requestedTiles = {};
7530
+ this.emptyTiles = {};
7720
7531
  this.lastUpdate = new Date().getTime();
7721
7532
  this.updateDebounceTime = 1e3;
7722
- this.options = { ...DEFAULT_PROPS3, ...options };
7723
7533
  this._traversalStack = new ManagedArray();
7724
7534
  this._emptyTraversalStack = new ManagedArray();
7725
7535
  this._frameNumber = null;
7726
- this.root = null;
7727
- this.selectedTiles = {};
7728
- this.requestedTiles = {};
7729
- this.emptyTiles = {};
7536
+ this.options = { ...DEFAULT_PROPS3, ...options };
7730
7537
  }
7731
7538
  traversalFinished(frameState) {
7732
7539
  return true;
@@ -7740,9 +7547,6 @@
7740
7547
  this.executeTraversal(root, frameState);
7741
7548
  }
7742
7549
  reset() {
7743
- this.requestedTiles = {};
7744
- this.selectedTiles = {};
7745
- this.emptyTiles = {};
7746
7550
  this._traversalStack.reset();
7747
7551
  this._emptyTraversalStack.reset();
7748
7552
  }
@@ -7789,7 +7593,6 @@
7789
7593
  for (const child of children) {
7790
7594
  this.updateTile(child, frameState);
7791
7595
  }
7792
- return true;
7793
7596
  }
7794
7597
  updateAndPushChildren(tile, frameState, stack, depth) {
7795
7598
  const { loadSiblings, skipLevelOfDetail } = this.options;
@@ -7868,7 +7671,7 @@
7868
7671
  shouldSelectTile(tile) {
7869
7672
  return tile.contentAvailable && !this.options.skipLevelOfDetail;
7870
7673
  }
7871
- shouldRefine(tile, frameState, useParentMetric) {
7674
+ shouldRefine(tile, frameState, useParentMetric = false) {
7872
7675
  let screenSpaceError = tile._screenSpaceError;
7873
7676
  if (useParentMetric) {
7874
7677
  screenSpaceError = tile.getScreenSpaceError(frameState, true);
@@ -7931,7 +7734,7 @@
7931
7734
  });
7932
7735
 
7933
7736
  // src/tileset/tile-3d.ts
7934
- function defined3(x) {
7737
+ function defined2(x) {
7935
7738
  return x !== void 0 && x !== null;
7936
7739
  }
7937
7740
  var scratchVector9, Tile3D;
@@ -7949,14 +7752,6 @@
7949
7752
  scratchVector9 = new Vector3();
7950
7753
  Tile3D = class {
7951
7754
  constructor(tileset, header, parentHeader, extendedId = "") {
7952
- this.header = header;
7953
- this.tileset = tileset;
7954
- this.id = extendedId || header.id;
7955
- this.url = header.url;
7956
- this.parent = parentHeader;
7957
- this.refine = this._getRefine(header.refine);
7958
- this.type = header.type;
7959
- this.contentUrl = header.contentUrl;
7960
7755
  this.lodMetricType = "geometricError";
7961
7756
  this.lodMetricValue = 0;
7962
7757
  this.boundingVolume = null;
@@ -7964,40 +7759,46 @@
7964
7759
  this.contentState = TILE_CONTENT_STATE.UNLOADED;
7965
7760
  this.gpuMemoryUsageInBytes = 0;
7966
7761
  this.children = [];
7967
- this.hasEmptyContent = false;
7968
- this.hasTilesetContent = false;
7969
7762
  this.depth = 0;
7970
7763
  this.viewportIds = [];
7971
- this.userData = {};
7764
+ this.transform = new Matrix4();
7972
7765
  this.extensions = null;
7973
- this._priority = 0;
7974
- this._touchedFrame = 0;
7975
- this._visitedFrame = 0;
7976
- this._selectedFrame = 0;
7977
- this._requestedFrame = 0;
7978
- this._screenSpaceError = 0;
7766
+ this.implicitTiling = null;
7767
+ this.userData = {};
7768
+ this.hasEmptyContent = false;
7769
+ this.hasTilesetContent = false;
7770
+ this.traverser = new TilesetTraverser({});
7979
7771
  this._cacheNode = null;
7980
7772
  this._frameNumber = null;
7981
- this._cacheNode = null;
7982
- this.traverser = new TilesetTraverser({});
7983
- this._shouldRefine = false;
7773
+ this._expireDate = null;
7774
+ this._expiredContent = null;
7984
7775
  this._distanceToCamera = 0;
7985
- this._centerZDepth = 0;
7776
+ this._screenSpaceError = 0;
7986
7777
  this._visible = void 0;
7987
- this._inRequestVolume = false;
7988
- this._stackLength = 0;
7989
- this._selectionDepth = 0;
7990
7778
  this._initialTransform = new Matrix4();
7991
- this.transform = new Matrix4();
7779
+ this._priority = 0;
7780
+ this._selectedFrame = 0;
7781
+ this._requestedFrame = 0;
7782
+ this._selectionDepth = 0;
7783
+ this._touchedFrame = 0;
7784
+ this._centerZDepth = 0;
7785
+ this._shouldRefine = false;
7786
+ this._stackLength = 0;
7787
+ this._visitedFrame = 0;
7788
+ this._inRequestVolume = false;
7789
+ this.header = header;
7790
+ this.tileset = tileset;
7791
+ this.id = extendedId || header.id;
7792
+ this.url = header.url;
7793
+ this.parent = parentHeader;
7794
+ this.refine = this._getRefine(header.refine);
7795
+ this.type = header.type;
7796
+ this.contentUrl = header.contentUrl;
7992
7797
  this._initializeLodMetric(header);
7993
7798
  this._initializeTransforms(header);
7994
7799
  this._initializeBoundingVolumes(header);
7995
7800
  this._initializeContent(header);
7996
7801
  this._initializeRenderingState(header);
7997
- this._lodJudge = null;
7998
- this._expireDate = null;
7999
- this._expiredContent = null;
8000
- this.implicitTiling = null;
8001
7802
  Object.seal(this);
8002
7803
  }
8003
7804
  destroy() {
@@ -8064,6 +7865,9 @@
8064
7865
  unselect() {
8065
7866
  this._selectedFrame = 0;
8066
7867
  }
7868
+ _getGpuMemoryUsageInBytes() {
7869
+ return this.content.gpuMemoryUsageInBytes || this.content.byteLength || 0;
7870
+ }
8067
7871
  _getPriority() {
8068
7872
  const traverser = this.tileset._traverser;
8069
7873
  const { skipLevelOfDetail } = traverser.options;
@@ -8180,7 +7984,7 @@
8180
7984
  return !viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0;
8181
7985
  }
8182
7986
  updateExpiration() {
8183
- if (defined3(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
7987
+ if (defined2(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
8184
7988
  const now = Date.now();
8185
7989
  if (Date.lessThan(this._expireDate, now)) {
8186
7990
  this.contentState = TILE_CONTENT_STATE.EXPIRED;
@@ -8263,6 +8067,8 @@
8263
8067
  }
8264
8068
  if (this._isTileset()) {
8265
8069
  this.hasTilesetContent = true;
8070
+ } else {
8071
+ this.gpuMemoryUsageInBytes = this._getGpuMemoryUsageInBytes();
8266
8072
  }
8267
8073
  }
8268
8074
  _updateBoundingVolume(header) {
@@ -8532,20 +8338,6 @@
8532
8338
  });
8533
8339
 
8534
8340
  // src/tileset/tileset-3d.ts
8535
- function getQueryParamString(queryParams) {
8536
- const queryParamStrings = [];
8537
- for (const key of Object.keys(queryParams)) {
8538
- queryParamStrings.push(`${key}=${queryParams[key]}`);
8539
- }
8540
- switch (queryParamStrings.length) {
8541
- case 0:
8542
- return "";
8543
- case 1:
8544
- return `?${queryParamStrings[0]}`;
8545
- default:
8546
- return `?${queryParamStrings.join("&")}`;
8547
- }
8548
- }
8549
8341
  var DEFAULT_PROPS4, TILES_TOTAL, TILES_IN_MEMORY, TILES_IN_VIEW, TILES_RENDERABLE, TILES_LOADED, TILES_LOADING, TILES_UNLOADED, TILES_LOAD_FAILED, POINTS_COUNT, TILES_GPU_MEMORY, Tileset3D;
8550
8342
  var init_tileset_3d = __esm({
8551
8343
  "src/tileset/tileset-3d.ts"() {
@@ -8600,57 +8392,56 @@
8600
8392
  POINTS_COUNT = "Points/Vertices";
8601
8393
  TILES_GPU_MEMORY = "Tile Memory Use";
8602
8394
  Tileset3D = class {
8603
- constructor(json, options) {
8604
- this.contentFormats = { draco: false, meshopt: false, dds: false, ktx2: false };
8605
- this.updatePromise = null;
8606
- assert2(json);
8607
- this.options = { ...DEFAULT_PROPS4, ...options };
8608
- this.tileset = json;
8609
- this.loader = json.loader;
8610
- this.type = json.type;
8611
- this.url = json.url;
8612
- this.basePath = json.basePath || path_exports.dirname(this.url);
8613
- this.modelMatrix = this.options.modelMatrix;
8614
- this.ellipsoid = this.options.ellipsoid;
8615
- this.lodMetricType = json.lodMetricType;
8616
- this.lodMetricValue = json.lodMetricValue;
8617
- this.refine = json.root.refine;
8618
- this.loadOptions = this.options.loadOptions || {};
8395
+ constructor(tileset, options) {
8619
8396
  this.root = null;
8620
8397
  this.roots = {};
8398
+ this.asset = {};
8399
+ this.description = "";
8400
+ this.extras = null;
8401
+ this.attributions = {};
8402
+ this.credits = {};
8403
+ this.contentFormats = { draco: false, meshopt: false, dds: false, ktx2: false };
8621
8404
  this.cartographicCenter = null;
8622
8405
  this.cartesianCenter = null;
8623
8406
  this.zoom = 1;
8624
8407
  this.boundingVolume = null;
8408
+ this.dynamicScreenSpaceErrorComputedDensity = 0;
8409
+ this.maximumMemoryUsage = 32;
8410
+ this.gpuMemoryUsageInBytes = 0;
8411
+ this._frameNumber = 0;
8412
+ this._queryParams = {};
8413
+ this._extensionsUsed = [];
8414
+ this._tiles = {};
8415
+ this._pendingCount = 0;
8416
+ this.selectedTiles = [];
8625
8417
  this.traverseCounter = 0;
8626
8418
  this.geometricError = 0;
8627
- this._traverser = this._initializeTraverser();
8419
+ this.lastUpdatedVieports = null;
8420
+ this._requestedTiles = [];
8421
+ this._emptyTiles = [];
8422
+ this.frameStateData = {};
8628
8423
  this._cache = new TilesetCache();
8424
+ this.updatePromise = null;
8425
+ this.options = { ...DEFAULT_PROPS4, ...options };
8426
+ this.tileset = tileset;
8427
+ this.loader = tileset.loader;
8428
+ this.type = tileset.type;
8429
+ this.url = tileset.url;
8430
+ this.basePath = tileset.basePath || path_exports.dirname(this.url);
8431
+ this.modelMatrix = this.options.modelMatrix;
8432
+ this.ellipsoid = this.options.ellipsoid;
8433
+ this.lodMetricType = tileset.lodMetricType;
8434
+ this.lodMetricValue = tileset.lodMetricValue;
8435
+ this.refine = tileset.root.refine;
8436
+ this.loadOptions = this.options.loadOptions || {};
8437
+ this._traverser = this._initializeTraverser();
8629
8438
  this._requestScheduler = new RequestScheduler({
8630
8439
  throttleRequests: this.options.throttleRequests,
8631
8440
  maxRequests: this.options.maxRequests
8632
8441
  });
8633
- this._frameNumber = 0;
8634
- this._pendingCount = 0;
8635
- this._tiles = {};
8636
- this.selectedTiles = [];
8637
- this._emptyTiles = [];
8638
- this._requestedTiles = [];
8639
- this.frameStateData = {};
8640
- this.lastUpdatedVieports = null;
8641
- this._queryParams = {};
8642
- this._queryParamsString = "";
8643
- this.maximumMemoryUsage = this.options.maximumMemoryUsage || 32;
8644
- this.gpuMemoryUsageInBytes = 0;
8645
8442
  this.stats = new Stats({ id: this.url });
8646
8443
  this._initializeStats();
8647
- this._extensionsUsed = void 0;
8648
- this.dynamicScreenSpaceErrorComputedDensity = 0;
8649
- this.extras = null;
8650
- this.asset = {};
8651
- this.credits = {};
8652
- this.description = this.options.description || "";
8653
- this.tilesetInitializationPromise = this._initializeTileSet(json);
8444
+ this.tilesetInitializationPromise = this._initializeTileSet(tileset);
8654
8445
  }
8655
8446
  destroy() {
8656
8447
  this._destroy();
@@ -8665,10 +8456,8 @@
8665
8456
  return this._frameNumber;
8666
8457
  }
8667
8458
  get queryParams() {
8668
- if (!this._queryParamsString) {
8669
- this._queryParamsString = getQueryParamString(this._queryParams);
8670
- }
8671
- return this._queryParamsString;
8459
+ const search = new URLSearchParams(this._queryParams).toString();
8460
+ return search ? `?${search}` : "";
8672
8461
  }
8673
8462
  setProps(props) {
8674
8463
  this.options = { ...this.options, ...props };
@@ -8681,10 +8470,10 @@
8681
8470
  if (isDataUrl) {
8682
8471
  return tilePath;
8683
8472
  }
8684
- return `${tilePath}${this.queryParams}`;
8473
+ return `${tilePath}${tilePath.includes("?") ? "&" : "?"}${this.queryParams}`;
8685
8474
  }
8686
8475
  hasExtension(extensionName) {
8687
- return Boolean(this._extensionsUsed && this._extensionsUsed.indexOf(extensionName) > -1);
8476
+ return Boolean(this._extensionsUsed.indexOf(extensionName) > -1);
8688
8477
  }
8689
8478
  update(viewports = null) {
8690
8479
  this.tilesetInitializationPromise.then(() => {
@@ -8871,7 +8660,6 @@
8871
8660
  }
8872
8661
  calculateViewPropsTiles3D() {
8873
8662
  const root = this.root;
8874
- assert2(root);
8875
8663
  const { center } = root.boundingVolume;
8876
8664
  if (!center) {
8877
8665
  console.warn("center was not pre-calculated for the root tile");
@@ -8914,6 +8702,13 @@
8914
8702
  const children = tile.header.children || [];
8915
8703
  for (const childHeader of children) {
8916
8704
  const childTile = new Tile3D(this, childHeader, tile);
8705
+ if (childTile.contentUrl?.includes("?session=")) {
8706
+ const url = new URL(childTile.contentUrl);
8707
+ const session = url.searchParams.get("session");
8708
+ if (session) {
8709
+ this._queryParams.session = session;
8710
+ }
8711
+ }
8917
8712
  tile.children.push(childTile);
8918
8713
  childTile.depth = tile.depth + 1;
8919
8714
  stack.push(childTile);
@@ -8949,7 +8744,7 @@
8949
8744
  this._onStartTileLoading();
8950
8745
  loaded = await tile.loadContent();
8951
8746
  } catch (error) {
8952
- this._onTileLoadError(tile, error);
8747
+ this._onTileLoadError(tile, error instanceof Error ? error : new Error("load failed"));
8953
8748
  } finally {
8954
8749
  this._onEndTileLoading();
8955
8750
  this._onTileLoad(tile, loaded);
@@ -9019,11 +8814,11 @@
9019
8814
  _updateCacheStats(tile) {
9020
8815
  this.stats.get(TILES_LOADED).incrementCount();
9021
8816
  this.stats.get(TILES_IN_MEMORY).incrementCount();
9022
- this.gpuMemoryUsageInBytes += tile.content.byteLength || 0;
8817
+ this.gpuMemoryUsageInBytes += tile.gpuMemoryUsageInBytes || 0;
9023
8818
  this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
9024
8819
  }
9025
8820
  _unloadTile(tile) {
9026
- this.gpuMemoryUsageInBytes -= tile.content && tile.content.byteLength || 0;
8821
+ this.gpuMemoryUsageInBytes -= tile.gpuMemoryUsageInBytes || 0;
9027
8822
  this.stats.get(TILES_IN_MEMORY).decrementCount();
9028
8823
  this.stats.get(TILES_UNLOADED).incrementCount();
9029
8824
  this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
@@ -9065,6 +8860,11 @@
9065
8860
  tile.destroy();
9066
8861
  }
9067
8862
  _initializeTiles3DTileset(tilesetJson) {
8863
+ if (tilesetJson.queryString) {
8864
+ const searchParams = new URLSearchParams(tilesetJson.queryString);
8865
+ const queryParams = Object.fromEntries(searchParams.entries());
8866
+ this._queryParams = { ...this._queryParams, ...queryParams };
8867
+ }
9068
8868
  this.asset = tilesetJson.asset;
9069
8869
  if (!this.asset) {
9070
8870
  throw new Error("Tileset must have an asset property.");
@@ -9081,7 +8881,7 @@
9081
8881
  this.description = this.options.description || "";
9082
8882
  this.properties = tilesetJson.properties;
9083
8883
  this.geometricError = tilesetJson.geometricError;
9084
- this._extensionsUsed = tilesetJson.extensionsUsed;
8884
+ this._extensionsUsed = tilesetJson.extensionsUsed || [];
9085
8885
  this.extras = tilesetJson.extras;
9086
8886
  }
9087
8887
  _initializeI3STileset() {