@loaders.gl/tiles 3.1.7 → 3.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +302 -318
- package/dist/es5/tileset/helpers/frame-state.js +79 -0
- package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
- package/dist/es5/tileset/helpers/i3s-lod.js +17 -26
- package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/zoom.js +32 -0
- package/dist/es5/tileset/helpers/zoom.js.map +1 -1
- package/dist/es5/tileset/tile-3d.js +5 -0
- package/dist/es5/tileset/tile-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-3d.js +244 -85
- package/dist/es5/tileset/tileset-3d.js.map +1 -1
- package/dist/es5/tileset/traversers/i3s-frame-counter.js +45 -0
- package/dist/es5/tileset/traversers/i3s-frame-counter.js.map +1 -0
- package/dist/es5/tileset/traversers/i3s-tile-manager.js +17 -0
- package/dist/es5/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/es5/tileset/traversers/i3s-tileset-traverser.js +6 -1
- package/dist/es5/tileset/traversers/i3s-tileset-traverser.js.map +1 -1
- package/dist/es5/tileset/traversers/tileset-traverser.js +13 -1
- package/dist/es5/tileset/traversers/tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/helpers/frame-state.js +52 -0
- package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
- package/dist/esm/tileset/helpers/i3s-lod.js +17 -27
- package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/zoom.js +17 -0
- package/dist/esm/tileset/helpers/zoom.js.map +1 -1
- package/dist/esm/tileset/tile-3d.js +4 -0
- package/dist/esm/tileset/tile-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-3d.js +95 -17
- package/dist/esm/tileset/tileset-3d.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-frame-counter.js +23 -0
- package/dist/esm/tileset/traversers/i3s-frame-counter.js.map +1 -0
- package/dist/esm/tileset/traversers/i3s-tile-manager.js +15 -0
- package/dist/esm/tileset/traversers/i3s-tile-manager.js.map +1 -1
- package/dist/esm/tileset/traversers/i3s-tileset-traverser.js +5 -1
- package/dist/esm/tileset/traversers/i3s-tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/traversers/tileset-traverser.js +14 -1
- package/dist/esm/tileset/traversers/tileset-traverser.js.map +1 -1
- package/dist/tileset/helpers/frame-state.d.ts +14 -0
- package/dist/tileset/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset/helpers/frame-state.js +49 -1
- package/dist/tileset/helpers/i3s-lod.d.ts.map +1 -1
- package/dist/tileset/helpers/i3s-lod.js +17 -16
- package/dist/tileset/helpers/zoom.d.ts +35 -0
- package/dist/tileset/helpers/zoom.d.ts.map +1 -1
- package/dist/tileset/helpers/zoom.js +41 -1
- package/dist/tileset/tile-3d.d.ts +5 -0
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +7 -0
- package/dist/tileset/tileset-3d.d.ts +36 -4
- package/dist/tileset/tileset-3d.d.ts.map +1 -1
- package/dist/tileset/tileset-3d.js +99 -20
- package/dist/tileset/traversers/i3s-frame-counter.d.ts +24 -0
- package/dist/tileset/traversers/i3s-frame-counter.d.ts.map +1 -0
- package/dist/tileset/traversers/i3s-frame-counter.js +37 -0
- package/dist/tileset/traversers/i3s-tile-manager.d.ts +10 -2
- package/dist/tileset/traversers/i3s-tile-manager.d.ts.map +1 -1
- package/dist/tileset/traversers/i3s-tile-manager.js +24 -0
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts +9 -2
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/i3s-tileset-traverser.js +10 -1
- package/dist/tileset/traversers/tileset-traverser.d.ts +5 -1
- package/dist/tileset/traversers/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/traversers/tileset-traverser.js +10 -1
- package/package.json +5 -5
- package/src/tileset/helpers/frame-state.ts +56 -0
- package/src/tileset/helpers/i3s-lod.ts +18 -19
- package/src/tileset/helpers/zoom.ts +64 -0
- package/src/tileset/tile-3d.ts +8 -0
- package/src/tileset/tileset-3d.ts +123 -21
- package/src/tileset/traversers/i3s-frame-counter.ts +35 -0
- package/src/tileset/traversers/i3s-tile-manager.ts +26 -2
- package/src/tileset/traversers/i3s-tileset-traverser.ts +16 -3
- package/src/tileset/traversers/tileset-traverser.ts +13 -2
package/dist/dist.min.js
CHANGED
|
@@ -3215,7 +3215,7 @@
|
|
|
3215
3215
|
}
|
|
3216
3216
|
});
|
|
3217
3217
|
|
|
3218
|
-
// node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
3218
|
+
// ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
3219
3219
|
function getHiResTimestamp() {
|
|
3220
3220
|
let timestamp;
|
|
3221
3221
|
if (typeof window !== "undefined" && window.performance) {
|
|
@@ -3229,14 +3229,14 @@
|
|
|
3229
3229
|
return timestamp;
|
|
3230
3230
|
}
|
|
3231
3231
|
var init_hi_res_timestamp = __esm({
|
|
3232
|
-
"node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
3232
|
+
"../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
3233
3233
|
}
|
|
3234
3234
|
});
|
|
3235
3235
|
|
|
3236
|
-
// node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
3236
|
+
// ../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
3237
3237
|
var Stat;
|
|
3238
3238
|
var init_stat = __esm({
|
|
3239
|
-
"node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
3239
|
+
"../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
3240
3240
|
init_defineProperty();
|
|
3241
3241
|
init_hi_res_timestamp();
|
|
3242
3242
|
Stat = class {
|
|
@@ -3352,10 +3352,10 @@
|
|
|
3352
3352
|
}
|
|
3353
3353
|
});
|
|
3354
3354
|
|
|
3355
|
-
// node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
3355
|
+
// ../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
3356
3356
|
var Stats;
|
|
3357
3357
|
var init_stats = __esm({
|
|
3358
|
-
"node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
3358
|
+
"../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
3359
3359
|
init_defineProperty();
|
|
3360
3360
|
init_stat();
|
|
3361
3361
|
Stats = class {
|
|
@@ -3425,9 +3425,9 @@
|
|
|
3425
3425
|
}
|
|
3426
3426
|
});
|
|
3427
3427
|
|
|
3428
|
-
// node_modules/@probe.gl/stats/dist/esm/index.js
|
|
3428
|
+
// ../../node_modules/@probe.gl/stats/dist/esm/index.js
|
|
3429
3429
|
var init_esm3 = __esm({
|
|
3430
|
-
"node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
3430
|
+
"../../node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
3431
3431
|
init_stats();
|
|
3432
3432
|
init_stat();
|
|
3433
3433
|
init_hi_res_timestamp();
|
|
@@ -3469,7 +3469,7 @@
|
|
|
3469
3469
|
var DEFAULT_VERSION, VERSION;
|
|
3470
3470
|
var init_version = __esm({
|
|
3471
3471
|
"../worker-utils/src/lib/env-utils/version.ts"() {
|
|
3472
|
-
DEFAULT_VERSION = "
|
|
3472
|
+
DEFAULT_VERSION = "beta";
|
|
3473
3473
|
VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
3474
3474
|
if (typeof __VERSION__ === "undefined") {
|
|
3475
3475
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
@@ -3516,13 +3516,13 @@
|
|
|
3516
3516
|
init_assert3();
|
|
3517
3517
|
WorkerJob = class {
|
|
3518
3518
|
constructor(jobName, workerThread) {
|
|
3519
|
-
this.name = jobName;
|
|
3520
|
-
this.workerThread = workerThread;
|
|
3521
3519
|
this.isRunning = true;
|
|
3522
3520
|
this._resolve = () => {
|
|
3523
3521
|
};
|
|
3524
3522
|
this._reject = () => {
|
|
3525
3523
|
};
|
|
3524
|
+
this.name = jobName;
|
|
3525
|
+
this.workerThread = workerThread;
|
|
3526
3526
|
this.result = new Promise((resolve, reject) => {
|
|
3527
3527
|
this._resolve = resolve;
|
|
3528
3528
|
this._reject = reject;
|
|
@@ -3549,6 +3549,21 @@
|
|
|
3549
3549
|
}
|
|
3550
3550
|
});
|
|
3551
3551
|
|
|
3552
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.js
|
|
3553
|
+
var Worker2;
|
|
3554
|
+
var init_worker_threads_browser = __esm({
|
|
3555
|
+
"../worker-utils/src/lib/node/worker_threads-browser.js"() {
|
|
3556
|
+
Worker2 = class {
|
|
3557
|
+
on(message, cb) {
|
|
3558
|
+
}
|
|
3559
|
+
postMessage(...args) {
|
|
3560
|
+
}
|
|
3561
|
+
terminate() {
|
|
3562
|
+
}
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
});
|
|
3566
|
+
|
|
3552
3567
|
// ../worker-utils/src/lib/worker-utils/get-loadable-worker-url.ts
|
|
3553
3568
|
function getLoadableWorkerURL(props) {
|
|
3554
3569
|
assert3(props.source && !props.url || !props.source && props.url);
|
|
@@ -3636,6 +3651,8 @@
|
|
|
3636
3651
|
var NOOP, WorkerThread;
|
|
3637
3652
|
var init_worker_thread = __esm({
|
|
3638
3653
|
"../worker-utils/src/lib/worker-farm/worker-thread.ts"() {
|
|
3654
|
+
init_worker_threads_browser();
|
|
3655
|
+
init_globals2();
|
|
3639
3656
|
init_assert3();
|
|
3640
3657
|
init_get_loadable_worker_url();
|
|
3641
3658
|
init_get_transfer_list();
|
|
@@ -3652,10 +3669,10 @@
|
|
|
3652
3669
|
this.url = url;
|
|
3653
3670
|
this.onMessage = NOOP;
|
|
3654
3671
|
this.onError = (error) => console.log(error);
|
|
3655
|
-
this.worker = this._createBrowserWorker();
|
|
3672
|
+
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
3656
3673
|
}
|
|
3657
3674
|
static isSupported() {
|
|
3658
|
-
return typeof Worker !== "undefined";
|
|
3675
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== void 0;
|
|
3659
3676
|
}
|
|
3660
3677
|
destroy() {
|
|
3661
3678
|
this.onMessage = NOOP;
|
|
@@ -3698,6 +3715,27 @@
|
|
|
3698
3715
|
worker.onmessageerror = (event) => console.error(event);
|
|
3699
3716
|
return worker;
|
|
3700
3717
|
}
|
|
3718
|
+
_createNodeWorker() {
|
|
3719
|
+
let worker;
|
|
3720
|
+
if (this.url) {
|
|
3721
|
+
const absolute = this.url.includes(":/") || this.url.startsWith("/");
|
|
3722
|
+
const url = absolute ? this.url : `./${this.url}`;
|
|
3723
|
+
worker = new Worker2(url, { eval: false });
|
|
3724
|
+
} else if (this.source) {
|
|
3725
|
+
worker = new Worker2(this.source, { eval: true });
|
|
3726
|
+
} else {
|
|
3727
|
+
throw new Error("no worker");
|
|
3728
|
+
}
|
|
3729
|
+
worker.on("message", (data) => {
|
|
3730
|
+
this.onMessage(data);
|
|
3731
|
+
});
|
|
3732
|
+
worker.on("error", (error) => {
|
|
3733
|
+
this.onError(error);
|
|
3734
|
+
});
|
|
3735
|
+
worker.on("exit", (code) => {
|
|
3736
|
+
});
|
|
3737
|
+
return worker;
|
|
3738
|
+
}
|
|
3701
3739
|
};
|
|
3702
3740
|
}
|
|
3703
3741
|
});
|
|
@@ -3726,6 +3764,9 @@
|
|
|
3726
3764
|
this.url = props.url;
|
|
3727
3765
|
this.setProps(props);
|
|
3728
3766
|
}
|
|
3767
|
+
static isSupported() {
|
|
3768
|
+
return WorkerThread.isSupported();
|
|
3769
|
+
}
|
|
3729
3770
|
destroy() {
|
|
3730
3771
|
this.idleQueue.forEach((worker) => worker.destroy());
|
|
3731
3772
|
this.isDestroyed = true;
|
|
@@ -3822,9 +3863,9 @@
|
|
|
3822
3863
|
DEFAULT_PROPS = {
|
|
3823
3864
|
maxConcurrency: 3,
|
|
3824
3865
|
maxMobileConcurrency: 1,
|
|
3866
|
+
reuseWorkers: true,
|
|
3825
3867
|
onDebug: () => {
|
|
3826
|
-
}
|
|
3827
|
-
reuseWorkers: true
|
|
3868
|
+
}
|
|
3828
3869
|
};
|
|
3829
3870
|
WorkerFarm = class {
|
|
3830
3871
|
constructor(props) {
|
|
@@ -3845,6 +3886,7 @@
|
|
|
3845
3886
|
for (const workerPool of this.workerPools.values()) {
|
|
3846
3887
|
workerPool.destroy();
|
|
3847
3888
|
}
|
|
3889
|
+
this.workerPools = new Map();
|
|
3848
3890
|
}
|
|
3849
3891
|
setProps(props) {
|
|
3850
3892
|
this.props = { ...this.props, ...props };
|
|
@@ -3904,7 +3946,7 @@
|
|
|
3904
3946
|
var init_get_worker_url = __esm({
|
|
3905
3947
|
"../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
|
|
3906
3948
|
init_assert3();
|
|
3907
|
-
NPM_TAG = "
|
|
3949
|
+
NPM_TAG = "beta";
|
|
3908
3950
|
}
|
|
3909
3951
|
});
|
|
3910
3952
|
|
|
@@ -3928,6 +3970,7 @@
|
|
|
3928
3970
|
var init_src = __esm({
|
|
3929
3971
|
"../worker-utils/src/index.ts"() {
|
|
3930
3972
|
init_assert3();
|
|
3973
|
+
init_globals2();
|
|
3931
3974
|
init_worker_farm();
|
|
3932
3975
|
init_get_worker_url();
|
|
3933
3976
|
init_validate_worker_version();
|
|
@@ -3939,6 +3982,9 @@
|
|
|
3939
3982
|
if (!WorkerFarm.isSupported()) {
|
|
3940
3983
|
return false;
|
|
3941
3984
|
}
|
|
3985
|
+
if (!isBrowser2 && !options?._nodeWorkers) {
|
|
3986
|
+
return false;
|
|
3987
|
+
}
|
|
3942
3988
|
return loader.worker && options?.worker;
|
|
3943
3989
|
}
|
|
3944
3990
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
@@ -3980,6 +4026,7 @@
|
|
|
3980
4026
|
var init_parse_with_worker = __esm({
|
|
3981
4027
|
"../loader-utils/src/lib/worker-loader-utils/parse-with-worker.ts"() {
|
|
3982
4028
|
init_src();
|
|
4029
|
+
init_src();
|
|
3983
4030
|
}
|
|
3984
4031
|
});
|
|
3985
4032
|
|
|
@@ -4068,230 +4115,11 @@
|
|
|
4068
4115
|
}
|
|
4069
4116
|
});
|
|
4070
4117
|
|
|
4071
|
-
// ../loader-utils/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
4072
|
-
function getHiResTimestamp2() {
|
|
4073
|
-
let timestamp;
|
|
4074
|
-
if (typeof window !== "undefined" && window.performance) {
|
|
4075
|
-
timestamp = window.performance.now();
|
|
4076
|
-
} else if (typeof process !== "undefined" && process.hrtime) {
|
|
4077
|
-
const timeParts = process.hrtime();
|
|
4078
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
4079
|
-
} else {
|
|
4080
|
-
timestamp = Date.now();
|
|
4081
|
-
}
|
|
4082
|
-
return timestamp;
|
|
4083
|
-
}
|
|
4084
|
-
var init_hi_res_timestamp2 = __esm({
|
|
4085
|
-
"../loader-utils/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
4086
|
-
}
|
|
4087
|
-
});
|
|
4088
|
-
|
|
4089
|
-
// ../loader-utils/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
4090
|
-
var Stat2;
|
|
4091
|
-
var init_stat2 = __esm({
|
|
4092
|
-
"../loader-utils/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
4093
|
-
init_defineProperty();
|
|
4094
|
-
init_hi_res_timestamp2();
|
|
4095
|
-
Stat2 = class {
|
|
4096
|
-
constructor(name, type) {
|
|
4097
|
-
_defineProperty(this, "name", void 0);
|
|
4098
|
-
_defineProperty(this, "type", void 0);
|
|
4099
|
-
_defineProperty(this, "sampleSize", 1);
|
|
4100
|
-
_defineProperty(this, "time", void 0);
|
|
4101
|
-
_defineProperty(this, "count", void 0);
|
|
4102
|
-
_defineProperty(this, "samples", void 0);
|
|
4103
|
-
_defineProperty(this, "lastTiming", void 0);
|
|
4104
|
-
_defineProperty(this, "lastSampleTime", void 0);
|
|
4105
|
-
_defineProperty(this, "lastSampleCount", void 0);
|
|
4106
|
-
_defineProperty(this, "_count", 0);
|
|
4107
|
-
_defineProperty(this, "_time", 0);
|
|
4108
|
-
_defineProperty(this, "_samples", 0);
|
|
4109
|
-
_defineProperty(this, "_startTime", 0);
|
|
4110
|
-
_defineProperty(this, "_timerPending", false);
|
|
4111
|
-
this.name = name;
|
|
4112
|
-
this.type = type;
|
|
4113
|
-
this.reset();
|
|
4114
|
-
}
|
|
4115
|
-
setSampleSize(samples) {
|
|
4116
|
-
this.sampleSize = samples;
|
|
4117
|
-
return this;
|
|
4118
|
-
}
|
|
4119
|
-
incrementCount() {
|
|
4120
|
-
this.addCount(1);
|
|
4121
|
-
return this;
|
|
4122
|
-
}
|
|
4123
|
-
decrementCount() {
|
|
4124
|
-
this.subtractCount(1);
|
|
4125
|
-
return this;
|
|
4126
|
-
}
|
|
4127
|
-
addCount(value) {
|
|
4128
|
-
this._count += value;
|
|
4129
|
-
this._samples++;
|
|
4130
|
-
this._checkSampling();
|
|
4131
|
-
return this;
|
|
4132
|
-
}
|
|
4133
|
-
subtractCount(value) {
|
|
4134
|
-
this._count -= value;
|
|
4135
|
-
this._samples++;
|
|
4136
|
-
this._checkSampling();
|
|
4137
|
-
return this;
|
|
4138
|
-
}
|
|
4139
|
-
addTime(time) {
|
|
4140
|
-
this._time += time;
|
|
4141
|
-
this.lastTiming = time;
|
|
4142
|
-
this._samples++;
|
|
4143
|
-
this._checkSampling();
|
|
4144
|
-
return this;
|
|
4145
|
-
}
|
|
4146
|
-
timeStart() {
|
|
4147
|
-
this._startTime = getHiResTimestamp2();
|
|
4148
|
-
this._timerPending = true;
|
|
4149
|
-
return this;
|
|
4150
|
-
}
|
|
4151
|
-
timeEnd() {
|
|
4152
|
-
if (!this._timerPending) {
|
|
4153
|
-
return this;
|
|
4154
|
-
}
|
|
4155
|
-
this.addTime(getHiResTimestamp2() - this._startTime);
|
|
4156
|
-
this._timerPending = false;
|
|
4157
|
-
this._checkSampling();
|
|
4158
|
-
return this;
|
|
4159
|
-
}
|
|
4160
|
-
getSampleAverageCount() {
|
|
4161
|
-
return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;
|
|
4162
|
-
}
|
|
4163
|
-
getSampleAverageTime() {
|
|
4164
|
-
return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;
|
|
4165
|
-
}
|
|
4166
|
-
getSampleHz() {
|
|
4167
|
-
return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1e3) : 0;
|
|
4168
|
-
}
|
|
4169
|
-
getAverageCount() {
|
|
4170
|
-
return this.samples > 0 ? this.count / this.samples : 0;
|
|
4171
|
-
}
|
|
4172
|
-
getAverageTime() {
|
|
4173
|
-
return this.samples > 0 ? this.time / this.samples : 0;
|
|
4174
|
-
}
|
|
4175
|
-
getHz() {
|
|
4176
|
-
return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
|
|
4177
|
-
}
|
|
4178
|
-
reset() {
|
|
4179
|
-
this.time = 0;
|
|
4180
|
-
this.count = 0;
|
|
4181
|
-
this.samples = 0;
|
|
4182
|
-
this.lastTiming = 0;
|
|
4183
|
-
this.lastSampleTime = 0;
|
|
4184
|
-
this.lastSampleCount = 0;
|
|
4185
|
-
this._count = 0;
|
|
4186
|
-
this._time = 0;
|
|
4187
|
-
this._samples = 0;
|
|
4188
|
-
this._startTime = 0;
|
|
4189
|
-
this._timerPending = false;
|
|
4190
|
-
return this;
|
|
4191
|
-
}
|
|
4192
|
-
_checkSampling() {
|
|
4193
|
-
if (this._samples === this.sampleSize) {
|
|
4194
|
-
this.lastSampleTime = this._time;
|
|
4195
|
-
this.lastSampleCount = this._count;
|
|
4196
|
-
this.count += this._count;
|
|
4197
|
-
this.time += this._time;
|
|
4198
|
-
this.samples += this._samples;
|
|
4199
|
-
this._time = 0;
|
|
4200
|
-
this._count = 0;
|
|
4201
|
-
this._samples = 0;
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
};
|
|
4205
|
-
}
|
|
4206
|
-
});
|
|
4207
|
-
|
|
4208
|
-
// ../loader-utils/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
4209
|
-
var Stats2;
|
|
4210
|
-
var init_stats2 = __esm({
|
|
4211
|
-
"../loader-utils/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
4212
|
-
init_defineProperty();
|
|
4213
|
-
init_stat2();
|
|
4214
|
-
Stats2 = class {
|
|
4215
|
-
constructor(options) {
|
|
4216
|
-
_defineProperty(this, "id", void 0);
|
|
4217
|
-
_defineProperty(this, "stats", {});
|
|
4218
|
-
this.id = options.id;
|
|
4219
|
-
this.stats = {};
|
|
4220
|
-
this._initializeStats(options.stats);
|
|
4221
|
-
Object.seal(this);
|
|
4222
|
-
}
|
|
4223
|
-
get(name) {
|
|
4224
|
-
let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
4225
|
-
return this._getOrCreate({
|
|
4226
|
-
name,
|
|
4227
|
-
type
|
|
4228
|
-
});
|
|
4229
|
-
}
|
|
4230
|
-
get size() {
|
|
4231
|
-
return Object.keys(this.stats).length;
|
|
4232
|
-
}
|
|
4233
|
-
reset() {
|
|
4234
|
-
for (const key in this.stats) {
|
|
4235
|
-
this.stats[key].reset();
|
|
4236
|
-
}
|
|
4237
|
-
return this;
|
|
4238
|
-
}
|
|
4239
|
-
forEach(fn) {
|
|
4240
|
-
for (const key in this.stats) {
|
|
4241
|
-
fn(this.stats[key]);
|
|
4242
|
-
}
|
|
4243
|
-
}
|
|
4244
|
-
getTable() {
|
|
4245
|
-
const table = {};
|
|
4246
|
-
this.forEach((stat) => {
|
|
4247
|
-
table[stat.name] = {
|
|
4248
|
-
time: stat.time || 0,
|
|
4249
|
-
count: stat.count || 0,
|
|
4250
|
-
average: stat.getAverageTime() || 0,
|
|
4251
|
-
hz: stat.getHz() || 0
|
|
4252
|
-
};
|
|
4253
|
-
});
|
|
4254
|
-
return table;
|
|
4255
|
-
}
|
|
4256
|
-
_initializeStats() {
|
|
4257
|
-
let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
4258
|
-
stats.forEach((stat) => this._getOrCreate(stat));
|
|
4259
|
-
}
|
|
4260
|
-
_getOrCreate(stat) {
|
|
4261
|
-
if (!stat || !stat.name) {
|
|
4262
|
-
return null;
|
|
4263
|
-
}
|
|
4264
|
-
const {
|
|
4265
|
-
name,
|
|
4266
|
-
type
|
|
4267
|
-
} = stat;
|
|
4268
|
-
if (!this.stats[name]) {
|
|
4269
|
-
if (stat instanceof Stat2) {
|
|
4270
|
-
this.stats[name] = stat;
|
|
4271
|
-
} else {
|
|
4272
|
-
this.stats[name] = new Stat2(name, type);
|
|
4273
|
-
}
|
|
4274
|
-
}
|
|
4275
|
-
return this.stats[name];
|
|
4276
|
-
}
|
|
4277
|
-
};
|
|
4278
|
-
}
|
|
4279
|
-
});
|
|
4280
|
-
|
|
4281
|
-
// ../loader-utils/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
4282
|
-
var init_esm4 = __esm({
|
|
4283
|
-
"../loader-utils/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
4284
|
-
init_stats2();
|
|
4285
|
-
init_stat2();
|
|
4286
|
-
init_hi_res_timestamp2();
|
|
4287
|
-
}
|
|
4288
|
-
});
|
|
4289
|
-
|
|
4290
4118
|
// ../loader-utils/src/lib/request-utils/request-scheduler.ts
|
|
4291
4119
|
var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
|
|
4292
4120
|
var init_request_scheduler = __esm({
|
|
4293
4121
|
"../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
|
|
4294
|
-
|
|
4122
|
+
init_esm3();
|
|
4295
4123
|
STAT_QUEUED_REQUESTS = "Queued Requests";
|
|
4296
4124
|
STAT_ACTIVE_REQUESTS = "Active Requests";
|
|
4297
4125
|
STAT_CANCELLED_REQUESTS = "Cancelled Requests";
|
|
@@ -4309,7 +4137,7 @@
|
|
|
4309
4137
|
this.requestMap = new Map();
|
|
4310
4138
|
this.deferredUpdate = null;
|
|
4311
4139
|
this.props = { ...DEFAULT_PROPS2, ...props };
|
|
4312
|
-
this.stats = new
|
|
4140
|
+
this.stats = new Stats({ id: this.props.id });
|
|
4313
4141
|
this.stats.get(STAT_QUEUED_REQUESTS);
|
|
4314
4142
|
this.stats.get(STAT_ACTIVE_REQUESTS);
|
|
4315
4143
|
this.stats.get(STAT_CANCELLED_REQUESTS);
|
|
@@ -5190,7 +5018,7 @@
|
|
|
5190
5018
|
});
|
|
5191
5019
|
|
|
5192
5020
|
// ../../node_modules/@math.gl/culling/dist/esm/index.js
|
|
5193
|
-
var
|
|
5021
|
+
var init_esm4 = __esm({
|
|
5194
5022
|
"../../node_modules/@math.gl/culling/dist/esm/index.js"() {
|
|
5195
5023
|
init_constants2();
|
|
5196
5024
|
init_axis_aligned_bounding_box();
|
|
@@ -5216,23 +5044,59 @@
|
|
|
5216
5044
|
const viewportCenterCartesian = Ellipsoid.WGS84.cartographicToCartesian(viewportCenterCartographic, new Vector3());
|
|
5217
5045
|
const enuToFixedTransform = Ellipsoid.WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);
|
|
5218
5046
|
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
5219
|
-
const
|
|
5047
|
+
const cameraPositionCartesian2 = Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, new Vector3());
|
|
5220
5048
|
const cameraDirectionCartesian = new Vector3(enuToFixedTransform.transformAsVector(new Vector3(cameraDirection).scale(metersPerUnit))).normalize();
|
|
5221
5049
|
const cameraUpCartesian = new Vector3(enuToFixedTransform.transformAsVector(new Vector3(cameraUp).scale(metersPerUnit))).normalize();
|
|
5222
5050
|
commonSpacePlanesToWGS84(viewport, viewportCenterCartesian);
|
|
5051
|
+
const ViewportClass = viewport.constructor;
|
|
5052
|
+
const { longitude, latitude, width, bearing, zoom } = viewport;
|
|
5053
|
+
const topDownViewport = new ViewportClass({
|
|
5054
|
+
longitude,
|
|
5055
|
+
latitude,
|
|
5056
|
+
height,
|
|
5057
|
+
width,
|
|
5058
|
+
bearing,
|
|
5059
|
+
zoom,
|
|
5060
|
+
pitch: 0
|
|
5061
|
+
});
|
|
5223
5062
|
return {
|
|
5224
5063
|
camera: {
|
|
5225
|
-
position:
|
|
5064
|
+
position: cameraPositionCartesian2,
|
|
5226
5065
|
direction: cameraDirectionCartesian,
|
|
5227
5066
|
up: cameraUpCartesian
|
|
5228
5067
|
},
|
|
5229
5068
|
viewport,
|
|
5069
|
+
topDownViewport,
|
|
5230
5070
|
height,
|
|
5231
5071
|
cullingVolume,
|
|
5232
5072
|
frameNumber,
|
|
5233
5073
|
sseDenominator: 1.15
|
|
5234
5074
|
};
|
|
5235
5075
|
}
|
|
5076
|
+
function limitSelectedTiles(tiles, frameState, maximumTilesSelected) {
|
|
5077
|
+
if (maximumTilesSelected === 0 || tiles.length <= maximumTilesSelected) {
|
|
5078
|
+
return [tiles, []];
|
|
5079
|
+
}
|
|
5080
|
+
const tuples = [];
|
|
5081
|
+
const { longitude: viewportLongitude, latitude: viewportLatitude } = frameState.viewport;
|
|
5082
|
+
for (const [index, tile] of tiles.entries()) {
|
|
5083
|
+
const [longitude, latitude] = tile.header.mbs;
|
|
5084
|
+
const deltaLon = Math.abs(viewportLongitude - longitude);
|
|
5085
|
+
const deltaLat = Math.abs(viewportLatitude - latitude);
|
|
5086
|
+
const distance = Math.sqrt(deltaLat * deltaLat + deltaLon * deltaLon);
|
|
5087
|
+
tuples.push([index, distance]);
|
|
5088
|
+
}
|
|
5089
|
+
const tuplesSorted = tuples.sort((a, b) => a[1] - b[1]);
|
|
5090
|
+
const selectedTiles = [];
|
|
5091
|
+
for (let i = 0; i < maximumTilesSelected; i++) {
|
|
5092
|
+
selectedTiles.push(tiles[tuplesSorted[i][0]]);
|
|
5093
|
+
}
|
|
5094
|
+
const unselectedTiles = [];
|
|
5095
|
+
for (let i = maximumTilesSelected; i < tuplesSorted.length; i++) {
|
|
5096
|
+
unselectedTiles.push(tiles[tuplesSorted[i][0]]);
|
|
5097
|
+
}
|
|
5098
|
+
return [selectedTiles, unselectedTiles];
|
|
5099
|
+
}
|
|
5236
5100
|
function commonSpacePlanesToWGS84(viewport, viewportCenterCartesian) {
|
|
5237
5101
|
const frustumPlanes = viewport.getFrustumPlanes();
|
|
5238
5102
|
let i = 0;
|
|
@@ -5249,7 +5113,7 @@
|
|
|
5249
5113
|
var init_frame_state = __esm({
|
|
5250
5114
|
"src/tileset/helpers/frame-state.ts"() {
|
|
5251
5115
|
init_esm();
|
|
5252
|
-
|
|
5116
|
+
init_esm4();
|
|
5253
5117
|
init_esm2();
|
|
5254
5118
|
scratchVector7 = new Vector3();
|
|
5255
5119
|
scratchPosition3 = new Vector3();
|
|
@@ -5281,6 +5145,15 @@
|
|
|
5281
5145
|
}
|
|
5282
5146
|
return 1;
|
|
5283
5147
|
}
|
|
5148
|
+
function getZoomFromFullExtent(fullExtent, cartorgraphicCenter, cartesianCenter) {
|
|
5149
|
+
const extentVertex = Ellipsoid.WGS84.cartographicToCartesian([fullExtent.xmax, fullExtent.ymax, fullExtent.zmax], new Vector3());
|
|
5150
|
+
const extentSize = Math.sqrt(Math.pow(extentVertex[0] - cartesianCenter[0], 2) + Math.pow(extentVertex[1] - cartesianCenter[1], 2) + Math.pow(extentVertex[2] - cartesianCenter[2], 2));
|
|
5151
|
+
return Math.log2(WGS84_RADIUS_Z2 / (extentSize + cartorgraphicCenter[2]));
|
|
5152
|
+
}
|
|
5153
|
+
function getZoomFromExtent(extent, cartorgraphicCenter, cartesianCenter) {
|
|
5154
|
+
const [xmin, ymin, xmax, ymax] = extent;
|
|
5155
|
+
return getZoomFromFullExtent({ xmin, xmax, ymin, ymax, zmin: 0, zmax: 0 }, cartorgraphicCenter, cartesianCenter);
|
|
5156
|
+
}
|
|
5284
5157
|
function getObbSize(halfAxes) {
|
|
5285
5158
|
halfAxes.getColumn(0, scratchVector8);
|
|
5286
5159
|
const axeY = halfAxes.getColumn(1);
|
|
@@ -5293,7 +5166,8 @@
|
|
|
5293
5166
|
var init_zoom = __esm({
|
|
5294
5167
|
"src/tileset/helpers/zoom.ts"() {
|
|
5295
5168
|
init_esm();
|
|
5296
|
-
|
|
5169
|
+
init_esm4();
|
|
5170
|
+
init_esm2();
|
|
5297
5171
|
WGS84_RADIUS_X2 = 6378137;
|
|
5298
5172
|
WGS84_RADIUS_Y2 = 6378137;
|
|
5299
5173
|
WGS84_RADIUS_Z2 = 6356752314245179e-9;
|
|
@@ -5440,7 +5314,7 @@
|
|
|
5440
5314
|
text += ` ${await response.text()}`;
|
|
5441
5315
|
}
|
|
5442
5316
|
message += text;
|
|
5443
|
-
message = message.length > 60 ? `${message.slice(60)}...` : message;
|
|
5317
|
+
message = message.length > 60 ? `${message.slice(0, 60)}...` : message;
|
|
5444
5318
|
} catch (error) {
|
|
5445
5319
|
}
|
|
5446
5320
|
return message;
|
|
@@ -5715,7 +5589,7 @@
|
|
|
5715
5589
|
});
|
|
5716
5590
|
|
|
5717
5591
|
// ../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js
|
|
5718
|
-
function
|
|
5592
|
+
function getHiResTimestamp2() {
|
|
5719
5593
|
let timestamp;
|
|
5720
5594
|
if (isBrowser4 && window_3.performance) {
|
|
5721
5595
|
timestamp = window_3.performance.now();
|
|
@@ -5727,7 +5601,7 @@
|
|
|
5727
5601
|
}
|
|
5728
5602
|
return timestamp;
|
|
5729
5603
|
}
|
|
5730
|
-
var
|
|
5604
|
+
var init_hi_res_timestamp2 = __esm({
|
|
5731
5605
|
"../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5732
5606
|
init_globals4();
|
|
5733
5607
|
}
|
|
@@ -5854,7 +5728,7 @@
|
|
|
5854
5728
|
init_color();
|
|
5855
5729
|
init_autobind();
|
|
5856
5730
|
init_assert4();
|
|
5857
|
-
|
|
5731
|
+
init_hi_res_timestamp2();
|
|
5858
5732
|
originalConsole = {
|
|
5859
5733
|
debug: isBrowser4 ? console.debug || console.log : console.log,
|
|
5860
5734
|
log: console.log,
|
|
@@ -5878,8 +5752,8 @@
|
|
|
5878
5752
|
}) {
|
|
5879
5753
|
this.id = id;
|
|
5880
5754
|
this.VERSION = VERSION2;
|
|
5881
|
-
this._startTs =
|
|
5882
|
-
this._deltaTs =
|
|
5755
|
+
this._startTs = getHiResTimestamp2();
|
|
5756
|
+
this._deltaTs = getHiResTimestamp2();
|
|
5883
5757
|
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
5884
5758
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
5885
5759
|
this.userData = {};
|
|
@@ -5900,10 +5774,10 @@
|
|
|
5900
5774
|
return this._storage.config.level;
|
|
5901
5775
|
}
|
|
5902
5776
|
getTotal() {
|
|
5903
|
-
return Number((
|
|
5777
|
+
return Number((getHiResTimestamp2() - this._startTs).toPrecision(10));
|
|
5904
5778
|
}
|
|
5905
5779
|
getDelta() {
|
|
5906
|
-
return Number((
|
|
5780
|
+
return Number((getHiResTimestamp2() - this._deltaTs).toPrecision(10));
|
|
5907
5781
|
}
|
|
5908
5782
|
set priority(newPriority) {
|
|
5909
5783
|
this.level = newPriority;
|
|
@@ -6058,11 +5932,11 @@
|
|
|
6058
5932
|
assert4(method);
|
|
6059
5933
|
opts.total = this.getTotal();
|
|
6060
5934
|
opts.delta = this.getDelta();
|
|
6061
|
-
this._deltaTs =
|
|
5935
|
+
this._deltaTs = getHiResTimestamp2();
|
|
6062
5936
|
const tag = opts.tag || opts.message;
|
|
6063
5937
|
if (opts.once) {
|
|
6064
5938
|
if (!cache[tag]) {
|
|
6065
|
-
cache[tag] =
|
|
5939
|
+
cache[tag] = getHiResTimestamp2();
|
|
6066
5940
|
} else {
|
|
6067
5941
|
return noop2;
|
|
6068
5942
|
}
|
|
@@ -6077,42 +5951,42 @@
|
|
|
6077
5951
|
}
|
|
6078
5952
|
});
|
|
6079
5953
|
|
|
6080
|
-
// ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
6081
|
-
var
|
|
6082
|
-
"../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
5954
|
+
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
5955
|
+
var init_hi_res_timestamp3 = __esm({
|
|
5956
|
+
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
6083
5957
|
}
|
|
6084
5958
|
});
|
|
6085
5959
|
|
|
6086
|
-
// ../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
6087
|
-
var
|
|
6088
|
-
"../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
6089
|
-
|
|
5960
|
+
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
5961
|
+
var init_stat2 = __esm({
|
|
5962
|
+
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
5963
|
+
init_hi_res_timestamp3();
|
|
6090
5964
|
}
|
|
6091
5965
|
});
|
|
6092
5966
|
|
|
6093
|
-
// ../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
6094
|
-
var
|
|
6095
|
-
"../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
6096
|
-
|
|
5967
|
+
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
5968
|
+
var init_stats2 = __esm({
|
|
5969
|
+
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
5970
|
+
init_stat2();
|
|
6097
5971
|
}
|
|
6098
5972
|
});
|
|
6099
5973
|
|
|
6100
|
-
// ../../node_modules/@probe.gl/stats/dist/esm/index.js
|
|
6101
|
-
var
|
|
6102
|
-
"../../node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
5974
|
+
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
5975
|
+
var init_esm5 = __esm({
|
|
5976
|
+
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
5977
|
+
init_stats2();
|
|
5978
|
+
init_stat2();
|
|
5979
|
+
init_hi_res_timestamp3();
|
|
6106
5980
|
}
|
|
6107
5981
|
});
|
|
6108
5982
|
|
|
6109
5983
|
// ../../node_modules/probe.gl/dist/esm/index.js
|
|
6110
5984
|
var esm_default;
|
|
6111
|
-
var
|
|
5985
|
+
var init_esm6 = __esm({
|
|
6112
5986
|
"../../node_modules/probe.gl/dist/esm/index.js"() {
|
|
6113
5987
|
init_log();
|
|
6114
5988
|
init_log();
|
|
6115
|
-
|
|
5989
|
+
init_esm5();
|
|
6116
5990
|
esm_default = new Log({
|
|
6117
5991
|
id: "probe.gl"
|
|
6118
5992
|
});
|
|
@@ -6123,7 +5997,7 @@
|
|
|
6123
5997
|
var probeLog, NullLog, ConsoleLog;
|
|
6124
5998
|
var init_loggers = __esm({
|
|
6125
5999
|
"../core/src/lib/loader-utils/loggers.ts"() {
|
|
6126
|
-
|
|
6000
|
+
init_esm6();
|
|
6127
6001
|
probeLog = new Log({ id: "loaders.gl" });
|
|
6128
6002
|
NullLog = class {
|
|
6129
6003
|
log() {
|
|
@@ -6167,6 +6041,7 @@
|
|
|
6167
6041
|
var DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS;
|
|
6168
6042
|
var init_option_defaults = __esm({
|
|
6169
6043
|
"../core/src/lib/loader-utils/option-defaults.ts"() {
|
|
6044
|
+
init_src2();
|
|
6170
6045
|
init_loggers();
|
|
6171
6046
|
DEFAULT_LOADER_OPTIONS = {
|
|
6172
6047
|
fetch: null,
|
|
@@ -6177,7 +6052,8 @@
|
|
|
6177
6052
|
worker: true,
|
|
6178
6053
|
maxConcurrency: 3,
|
|
6179
6054
|
maxMobileConcurrency: 1,
|
|
6180
|
-
reuseWorkers:
|
|
6055
|
+
reuseWorkers: isBrowser,
|
|
6056
|
+
_nodeWorkers: false,
|
|
6181
6057
|
_workerType: "",
|
|
6182
6058
|
limit: 0,
|
|
6183
6059
|
_limitMB: 0,
|
|
@@ -6435,7 +6311,7 @@
|
|
|
6435
6311
|
});
|
|
6436
6312
|
|
|
6437
6313
|
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
6438
|
-
var
|
|
6314
|
+
var init_esm7 = __esm({
|
|
6439
6315
|
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
6440
6316
|
init_globals6();
|
|
6441
6317
|
init_globals5();
|
|
@@ -6555,7 +6431,7 @@
|
|
|
6555
6431
|
var COLOR2;
|
|
6556
6432
|
var init_color2 = __esm({
|
|
6557
6433
|
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
6558
|
-
|
|
6434
|
+
init_esm7();
|
|
6559
6435
|
(function(COLOR3) {
|
|
6560
6436
|
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
6561
6437
|
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
@@ -6607,7 +6483,7 @@
|
|
|
6607
6483
|
});
|
|
6608
6484
|
|
|
6609
6485
|
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
6610
|
-
function
|
|
6486
|
+
function getHiResTimestamp4() {
|
|
6611
6487
|
let timestamp;
|
|
6612
6488
|
if (isBrowser5 && "performance" in window_4) {
|
|
6613
6489
|
var _window$performance, _window$performance$n;
|
|
@@ -6621,9 +6497,9 @@
|
|
|
6621
6497
|
}
|
|
6622
6498
|
return timestamp;
|
|
6623
6499
|
}
|
|
6624
|
-
var
|
|
6500
|
+
var init_hi_res_timestamp4 = __esm({
|
|
6625
6501
|
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
6626
|
-
|
|
6502
|
+
init_esm7();
|
|
6627
6503
|
}
|
|
6628
6504
|
});
|
|
6629
6505
|
|
|
@@ -6746,13 +6622,13 @@
|
|
|
6746
6622
|
var init_log2 = __esm({
|
|
6747
6623
|
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
6748
6624
|
init_defineProperty();
|
|
6749
|
-
|
|
6625
|
+
init_esm7();
|
|
6750
6626
|
init_local_storage2();
|
|
6751
6627
|
init_formatters2();
|
|
6752
6628
|
init_color2();
|
|
6753
6629
|
init_autobind2();
|
|
6754
6630
|
init_assert5();
|
|
6755
|
-
|
|
6631
|
+
init_hi_res_timestamp4();
|
|
6756
6632
|
originalConsole2 = {
|
|
6757
6633
|
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
6758
6634
|
log: console.log,
|
|
@@ -6777,8 +6653,8 @@
|
|
|
6777
6653
|
};
|
|
6778
6654
|
_defineProperty(this, "id", void 0);
|
|
6779
6655
|
_defineProperty(this, "VERSION", VERSION3);
|
|
6780
|
-
_defineProperty(this, "_startTs",
|
|
6781
|
-
_defineProperty(this, "_deltaTs",
|
|
6656
|
+
_defineProperty(this, "_startTs", getHiResTimestamp4());
|
|
6657
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp4());
|
|
6782
6658
|
_defineProperty(this, "_storage", void 0);
|
|
6783
6659
|
_defineProperty(this, "userData", {});
|
|
6784
6660
|
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
@@ -6802,10 +6678,10 @@
|
|
|
6802
6678
|
return this._storage.config.level;
|
|
6803
6679
|
}
|
|
6804
6680
|
getTotal() {
|
|
6805
|
-
return Number((
|
|
6681
|
+
return Number((getHiResTimestamp4() - this._startTs).toPrecision(10));
|
|
6806
6682
|
}
|
|
6807
6683
|
getDelta() {
|
|
6808
|
-
return Number((
|
|
6684
|
+
return Number((getHiResTimestamp4() - this._deltaTs).toPrecision(10));
|
|
6809
6685
|
}
|
|
6810
6686
|
set priority(newPriority) {
|
|
6811
6687
|
this.level = newPriority;
|
|
@@ -6967,11 +6843,11 @@
|
|
|
6967
6843
|
assert5(method);
|
|
6968
6844
|
opts.total = this.getTotal();
|
|
6969
6845
|
opts.delta = this.getDelta();
|
|
6970
|
-
this._deltaTs =
|
|
6846
|
+
this._deltaTs = getHiResTimestamp4();
|
|
6971
6847
|
const tag = opts.tag || opts.message;
|
|
6972
6848
|
if (opts.once) {
|
|
6973
6849
|
if (!cache2[tag]) {
|
|
6974
|
-
cache2[tag] =
|
|
6850
|
+
cache2[tag] = getHiResTimestamp4();
|
|
6975
6851
|
} else {
|
|
6976
6852
|
return noop3;
|
|
6977
6853
|
}
|
|
@@ -6988,7 +6864,7 @@
|
|
|
6988
6864
|
|
|
6989
6865
|
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
6990
6866
|
var esm_default2;
|
|
6991
|
-
var
|
|
6867
|
+
var init_esm8 = __esm({
|
|
6992
6868
|
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
6993
6869
|
init_log2();
|
|
6994
6870
|
init_log2();
|
|
@@ -7002,7 +6878,7 @@
|
|
|
7002
6878
|
var log;
|
|
7003
6879
|
var init_log3 = __esm({
|
|
7004
6880
|
"../core/src/lib/utils/log.ts"() {
|
|
7005
|
-
|
|
6881
|
+
init_esm8();
|
|
7006
6882
|
log = new Log2({ id: "loaders.gl" });
|
|
7007
6883
|
}
|
|
7008
6884
|
});
|
|
@@ -7623,7 +7499,7 @@
|
|
|
7623
7499
|
var init_bounding_volume = __esm({
|
|
7624
7500
|
"src/tileset/helpers/bounding-volume.ts"() {
|
|
7625
7501
|
init_esm();
|
|
7626
|
-
|
|
7502
|
+
init_esm4();
|
|
7627
7503
|
init_esm2();
|
|
7628
7504
|
init_src2();
|
|
7629
7505
|
scratchScale = new Vector3();
|
|
@@ -7690,39 +7566,43 @@
|
|
|
7690
7566
|
return "OUT";
|
|
7691
7567
|
}
|
|
7692
7568
|
function getProjectedRadius(tile, frameState) {
|
|
7693
|
-
const
|
|
7694
|
-
const ViewportClass = originalViewport.constructor;
|
|
7695
|
-
const { longitude, latitude, height, width, bearing, zoom } = originalViewport;
|
|
7696
|
-
const viewport = new ViewportClass({ longitude, latitude, height, width, bearing, zoom, pitch: 0 });
|
|
7569
|
+
const { topDownViewport: viewport } = frameState;
|
|
7697
7570
|
const mbsLat = tile.header.mbs[1];
|
|
7698
7571
|
const mbsLon = tile.header.mbs[0];
|
|
7699
7572
|
const mbsZ = tile.header.mbs[2];
|
|
7700
7573
|
const mbsR = tile.header.mbs[3];
|
|
7701
7574
|
const mbsCenterCartesian = [...tile.boundingVolume.center];
|
|
7702
7575
|
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
const enuToCartesianMatrix = new Matrix4();
|
|
7576
|
+
Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, cameraPositionCartesian);
|
|
7577
|
+
toEye.copy(cameraPositionCartesian).subtract(mbsCenterCartesian).normalize();
|
|
7706
7578
|
Ellipsoid.WGS84.eastNorthUpToFixedFrame(mbsCenterCartesian, enuToCartesianMatrix);
|
|
7707
|
-
|
|
7708
|
-
|
|
7579
|
+
cartesianToEnuMatrix.copy(enuToCartesianMatrix).invert();
|
|
7580
|
+
cameraPositionEnu.copy(cameraPositionCartesian).transform(cartesianToEnuMatrix);
|
|
7709
7581
|
const projection = Math.sqrt(cameraPositionEnu[0] * cameraPositionEnu[0] + cameraPositionEnu[1] * cameraPositionEnu[1]);
|
|
7710
7582
|
const extraZ = projection * projection / cameraPositionEnu[2];
|
|
7711
|
-
|
|
7583
|
+
extraVertexEnu.copy([cameraPositionEnu[0], cameraPositionEnu[1], extraZ]);
|
|
7712
7584
|
const extraVertexCartesian = extraVertexEnu.transform(enuToCartesianMatrix);
|
|
7713
|
-
const extraVectorCartesian =
|
|
7585
|
+
const extraVectorCartesian = extraVertexCartesian.subtract(mbsCenterCartesian).normalize();
|
|
7714
7586
|
const radiusVector = toEye.cross(extraVectorCartesian).normalize().scale(mbsR);
|
|
7715
|
-
const sphereMbsBorderVertexCartesian =
|
|
7587
|
+
const sphereMbsBorderVertexCartesian = radiusVector.add(mbsCenterCartesian);
|
|
7716
7588
|
const sphereMbsBorderVertexCartographic = Ellipsoid.WGS84.cartesianToCartographic(sphereMbsBorderVertexCartesian);
|
|
7717
7589
|
const projectedOrigin = viewport.project([mbsLon, mbsLat, mbsZ]);
|
|
7718
7590
|
const projectedMbsBorderVertex = viewport.project(sphereMbsBorderVertexCartographic);
|
|
7719
|
-
const projectedRadius =
|
|
7591
|
+
const projectedRadius = projectedOriginVector.copy(projectedOrigin).subtract(projectedMbsBorderVertex).magnitude();
|
|
7720
7592
|
return projectedRadius;
|
|
7721
7593
|
}
|
|
7594
|
+
var cameraPositionCartesian, toEye, cameraPositionEnu, extraVertexEnu, projectedOriginVector, enuToCartesianMatrix, cartesianToEnuMatrix;
|
|
7722
7595
|
var init_i3s_lod = __esm({
|
|
7723
7596
|
"src/tileset/helpers/i3s-lod.ts"() {
|
|
7724
7597
|
init_esm();
|
|
7725
7598
|
init_esm2();
|
|
7599
|
+
cameraPositionCartesian = new Vector3();
|
|
7600
|
+
toEye = new Vector3();
|
|
7601
|
+
cameraPositionEnu = new Vector3();
|
|
7602
|
+
extraVertexEnu = new Vector3();
|
|
7603
|
+
projectedOriginVector = new Vector3();
|
|
7604
|
+
enuToCartesianMatrix = new Matrix4();
|
|
7605
|
+
cartesianToEnuMatrix = new Matrix4();
|
|
7726
7606
|
}
|
|
7727
7607
|
});
|
|
7728
7608
|
|
|
@@ -7844,6 +7724,8 @@
|
|
|
7844
7724
|
};
|
|
7845
7725
|
TilesetTraverser = class {
|
|
7846
7726
|
constructor(options) {
|
|
7727
|
+
this.lastUpdate = new Date().getTime();
|
|
7728
|
+
this.updateDebounceTime = 1e3;
|
|
7847
7729
|
this.options = { ...DEFAULT_PROPS3, ...options };
|
|
7848
7730
|
this._traversalStack = new ManagedArray();
|
|
7849
7731
|
this._emptyTraversalStack = new ManagedArray();
|
|
@@ -7853,6 +7735,9 @@
|
|
|
7853
7735
|
this.requestedTiles = {};
|
|
7854
7736
|
this.emptyTiles = {};
|
|
7855
7737
|
}
|
|
7738
|
+
get traversalFinished() {
|
|
7739
|
+
return true;
|
|
7740
|
+
}
|
|
7856
7741
|
traverse(root, frameState, options) {
|
|
7857
7742
|
this.root = root;
|
|
7858
7743
|
this.options = { ...this.options, ...options };
|
|
@@ -7900,7 +7785,11 @@
|
|
|
7900
7785
|
this.touchTile(tile, frameState);
|
|
7901
7786
|
tile._shouldRefine = shouldRefine && parentRefines;
|
|
7902
7787
|
}
|
|
7903
|
-
|
|
7788
|
+
const newTime = new Date().getTime();
|
|
7789
|
+
if (this.traversalFinished || newTime - this.lastUpdate > this.updateDebounceTime) {
|
|
7790
|
+
this.lastUpdate = newTime;
|
|
7791
|
+
this.options.onTraversalEnd(frameState);
|
|
7792
|
+
}
|
|
7904
7793
|
}
|
|
7905
7794
|
updateChildTiles(tile, frameState) {
|
|
7906
7795
|
const children = tile.children;
|
|
@@ -8056,7 +7945,7 @@
|
|
|
8056
7945
|
var init_tile_3d = __esm({
|
|
8057
7946
|
"src/tileset/tile-3d.ts"() {
|
|
8058
7947
|
init_esm();
|
|
8059
|
-
|
|
7948
|
+
init_esm4();
|
|
8060
7949
|
init_src3();
|
|
8061
7950
|
init_constants3();
|
|
8062
7951
|
init_bounding_volume();
|
|
@@ -8166,6 +8055,9 @@
|
|
|
8166
8055
|
throw new Error("Unsupported tileset type");
|
|
8167
8056
|
}
|
|
8168
8057
|
}
|
|
8058
|
+
unselect() {
|
|
8059
|
+
this._selectedFrame = 0;
|
|
8060
|
+
}
|
|
8169
8061
|
_getPriority() {
|
|
8170
8062
|
const traverser = this.tileset._traverser;
|
|
8171
8063
|
const { skipLevelOfDetail } = traverser.options;
|
|
@@ -8454,10 +8346,35 @@
|
|
|
8454
8346
|
}
|
|
8455
8347
|
});
|
|
8456
8348
|
|
|
8349
|
+
// src/tileset/traversers/i3s-frame-counter.ts
|
|
8350
|
+
var I3SPendingTilesRegister;
|
|
8351
|
+
var init_i3s_frame_counter = __esm({
|
|
8352
|
+
"src/tileset/traversers/i3s-frame-counter.ts"() {
|
|
8353
|
+
I3SPendingTilesRegister = class {
|
|
8354
|
+
constructor() {
|
|
8355
|
+
this.frameNumberMap = new Map();
|
|
8356
|
+
}
|
|
8357
|
+
register(frameNumber) {
|
|
8358
|
+
const oldCount = this.frameNumberMap.get(frameNumber) || 0;
|
|
8359
|
+
this.frameNumberMap.set(frameNumber, (oldCount || 0) + 1);
|
|
8360
|
+
}
|
|
8361
|
+
deregister(frameNumber) {
|
|
8362
|
+
const oldCount = this.frameNumberMap.get(frameNumber) || 1;
|
|
8363
|
+
this.frameNumberMap.set(frameNumber, (oldCount || 0) - 1);
|
|
8364
|
+
}
|
|
8365
|
+
isZero(frameNumber) {
|
|
8366
|
+
const count = this.frameNumberMap.get(frameNumber) || 0;
|
|
8367
|
+
return count === 0;
|
|
8368
|
+
}
|
|
8369
|
+
};
|
|
8370
|
+
}
|
|
8371
|
+
});
|
|
8372
|
+
|
|
8457
8373
|
// src/tileset/traversers/i3s-tile-manager.ts
|
|
8458
8374
|
var STATUS, I3STileManager;
|
|
8459
8375
|
var init_i3s_tile_manager = __esm({
|
|
8460
8376
|
"src/tileset/traversers/i3s-tile-manager.ts"() {
|
|
8377
|
+
init_i3s_frame_counter();
|
|
8461
8378
|
STATUS = {
|
|
8462
8379
|
REQUESTED: "REQUESTED",
|
|
8463
8380
|
COMPLETED: "COMPLETED",
|
|
@@ -8465,28 +8382,38 @@
|
|
|
8465
8382
|
};
|
|
8466
8383
|
I3STileManager = class {
|
|
8467
8384
|
constructor() {
|
|
8385
|
+
this.pendingTilesRegister = new I3SPendingTilesRegister();
|
|
8468
8386
|
this._statusMap = {};
|
|
8469
8387
|
}
|
|
8470
8388
|
add(request, key, callback, frameState) {
|
|
8471
8389
|
if (!this._statusMap[key]) {
|
|
8390
|
+
const { frameNumber } = frameState;
|
|
8472
8391
|
this._statusMap[key] = { request, callback, key, frameState, status: STATUS.REQUESTED };
|
|
8392
|
+
this.pendingTilesRegister.register(frameNumber);
|
|
8473
8393
|
request().then((data) => {
|
|
8474
8394
|
this._statusMap[key].status = STATUS.COMPLETED;
|
|
8395
|
+
this.pendingTilesRegister.deregister(frameNumber);
|
|
8475
8396
|
this._statusMap[key].callback(data, frameState);
|
|
8476
8397
|
}).catch((error) => {
|
|
8477
8398
|
this._statusMap[key].status = STATUS.ERROR;
|
|
8399
|
+
this.pendingTilesRegister.deregister(frameNumber);
|
|
8478
8400
|
callback(error);
|
|
8479
8401
|
});
|
|
8480
8402
|
}
|
|
8481
8403
|
}
|
|
8482
8404
|
update(key, frameState) {
|
|
8483
8405
|
if (this._statusMap[key]) {
|
|
8406
|
+
this.pendingTilesRegister.deregister(this._statusMap[key].frameState.frameNumber);
|
|
8407
|
+
this.pendingTilesRegister.register(frameState.frameNumber);
|
|
8484
8408
|
this._statusMap[key].frameState = frameState;
|
|
8485
8409
|
}
|
|
8486
8410
|
}
|
|
8487
8411
|
find(key) {
|
|
8488
8412
|
return this._statusMap[key];
|
|
8489
8413
|
}
|
|
8414
|
+
hasPendingTiles(frameNumber) {
|
|
8415
|
+
return !this.pendingTilesRegister.isZero(frameNumber);
|
|
8416
|
+
}
|
|
8490
8417
|
};
|
|
8491
8418
|
}
|
|
8492
8419
|
});
|
|
@@ -8501,6 +8428,9 @@
|
|
|
8501
8428
|
init_tile_3d();
|
|
8502
8429
|
init_i3s_tile_manager();
|
|
8503
8430
|
I3STilesetTraverser = class extends TilesetTraverser {
|
|
8431
|
+
get traversalFinished() {
|
|
8432
|
+
return !this._tileManager.hasPendingTiles(this._frameNumber || 0);
|
|
8433
|
+
}
|
|
8504
8434
|
constructor(options) {
|
|
8505
8435
|
super(options);
|
|
8506
8436
|
this._tileManager = new I3STileManager();
|
|
@@ -8551,7 +8481,7 @@
|
|
|
8551
8481
|
tile.children.push(childTile);
|
|
8552
8482
|
const frameState = this._tileManager.find(childTile.id).frameState;
|
|
8553
8483
|
this.updateTile(childTile, frameState);
|
|
8554
|
-
if (this._frameNumber === frameState.frameNumber) {
|
|
8484
|
+
if (this._frameNumber === frameState.frameNumber && (this.traversalFinished || new Date().getTime() - this.lastUpdate > this.updateDebounceTime)) {
|
|
8555
8485
|
this.executeTraversal(childTile, frameState);
|
|
8556
8486
|
}
|
|
8557
8487
|
}
|
|
@@ -8597,6 +8527,8 @@
|
|
|
8597
8527
|
throttleRequests: true,
|
|
8598
8528
|
maxRequests: 64,
|
|
8599
8529
|
maximumMemoryUsage: 32,
|
|
8530
|
+
maximumTilesSelected: 0,
|
|
8531
|
+
debounceTime: 0,
|
|
8600
8532
|
onTileLoad: () => {
|
|
8601
8533
|
},
|
|
8602
8534
|
onTileUnload: () => {
|
|
@@ -8627,6 +8559,7 @@
|
|
|
8627
8559
|
TILES_GPU_MEMORY = "Tile Memory Use";
|
|
8628
8560
|
Tileset3D = class {
|
|
8629
8561
|
constructor(json, options) {
|
|
8562
|
+
this.updatePromise = null;
|
|
8630
8563
|
assert2(json);
|
|
8631
8564
|
this.options = { ...DEFAULT_PROPS4, ...options };
|
|
8632
8565
|
this.tileset = json;
|
|
@@ -8674,7 +8607,7 @@
|
|
|
8674
8607
|
this.asset = {};
|
|
8675
8608
|
this.credits = {};
|
|
8676
8609
|
this.description = this.options.description || "";
|
|
8677
|
-
this._initializeTileSet(json);
|
|
8610
|
+
this.tilesetInitializationPromise = this._initializeTileSet(json);
|
|
8678
8611
|
}
|
|
8679
8612
|
destroy() {
|
|
8680
8613
|
this._destroy();
|
|
@@ -8710,18 +8643,39 @@
|
|
|
8710
8643
|
hasExtension(extensionName) {
|
|
8711
8644
|
return Boolean(this._extensionsUsed && this._extensionsUsed.indexOf(extensionName) > -1);
|
|
8712
8645
|
}
|
|
8713
|
-
update(viewports) {
|
|
8646
|
+
update(viewports = null) {
|
|
8647
|
+
this.tilesetInitializationPromise.then(() => {
|
|
8648
|
+
if (!viewports && this.lastUpdatedVieports) {
|
|
8649
|
+
viewports = this.lastUpdatedVieports;
|
|
8650
|
+
} else {
|
|
8651
|
+
this.lastUpdatedVieports = viewports;
|
|
8652
|
+
}
|
|
8653
|
+
this.doUpdate(viewports);
|
|
8654
|
+
});
|
|
8655
|
+
}
|
|
8656
|
+
async selectTiles(viewports = null) {
|
|
8657
|
+
await this.tilesetInitializationPromise;
|
|
8658
|
+
if (viewports) {
|
|
8659
|
+
this.lastUpdatedVieports = viewports;
|
|
8660
|
+
}
|
|
8661
|
+
if (!this.updatePromise) {
|
|
8662
|
+
this.updatePromise = new Promise((resolve) => {
|
|
8663
|
+
setTimeout(() => {
|
|
8664
|
+
this.doUpdate(this.lastUpdatedVieports);
|
|
8665
|
+
resolve(this._frameNumber);
|
|
8666
|
+
this.updatePromise = null;
|
|
8667
|
+
}, this.options.debounceTime);
|
|
8668
|
+
});
|
|
8669
|
+
}
|
|
8670
|
+
return this.updatePromise;
|
|
8671
|
+
}
|
|
8672
|
+
doUpdate(viewports = null) {
|
|
8714
8673
|
if ("loadTiles" in this.options && !this.options.loadTiles) {
|
|
8715
8674
|
return;
|
|
8716
8675
|
}
|
|
8717
8676
|
if (this.traverseCounter > 0) {
|
|
8718
8677
|
return;
|
|
8719
8678
|
}
|
|
8720
|
-
if (!viewports && this.lastUpdatedVieports) {
|
|
8721
|
-
viewports = this.lastUpdatedVieports;
|
|
8722
|
-
} else {
|
|
8723
|
-
this.lastUpdatedVieports = viewports;
|
|
8724
|
-
}
|
|
8725
8679
|
if (!(viewports instanceof Array)) {
|
|
8726
8680
|
viewports = [viewports];
|
|
8727
8681
|
}
|
|
@@ -8766,7 +8720,11 @@
|
|
|
8766
8720
|
}
|
|
8767
8721
|
const currentFrameStateData = this.frameStateData[id];
|
|
8768
8722
|
const selectedTiles = Object.values(this._traverser.selectedTiles);
|
|
8769
|
-
|
|
8723
|
+
const [filteredSelectedTiles, unselectedTiles] = limitSelectedTiles(selectedTiles, frameState, this.options.maximumTilesSelected);
|
|
8724
|
+
currentFrameStateData.selectedTiles = filteredSelectedTiles;
|
|
8725
|
+
for (const tile of unselectedTiles) {
|
|
8726
|
+
tile.unselect();
|
|
8727
|
+
}
|
|
8770
8728
|
currentFrameStateData._requestedTiles = Object.values(this._traverser.requestedTiles);
|
|
8771
8729
|
currentFrameStateData._emptyTiles = Object.values(this._traverser.emptyTiles);
|
|
8772
8730
|
this.traverseCounter--;
|
|
@@ -8828,17 +8786,43 @@
|
|
|
8828
8786
|
this.stats.get(TILES_RENDERABLE).count = tilesRenderable;
|
|
8829
8787
|
this.stats.get(POINTS_COUNT).count = pointsRenderable;
|
|
8830
8788
|
}
|
|
8831
|
-
_initializeTileSet(tilesetJson) {
|
|
8789
|
+
async _initializeTileSet(tilesetJson) {
|
|
8790
|
+
if (this.type === TILESET_TYPE.I3S) {
|
|
8791
|
+
this.calculateViewPropsI3S();
|
|
8792
|
+
tilesetJson.root = await tilesetJson.root;
|
|
8793
|
+
}
|
|
8832
8794
|
this.root = this._initializeTileHeaders(tilesetJson, null);
|
|
8833
8795
|
if (this.type === TILESET_TYPE.TILES3D) {
|
|
8834
|
-
this.
|
|
8796
|
+
this._initializeTiles3DTileset(tilesetJson);
|
|
8797
|
+
this.calculateViewPropsTiles3D();
|
|
8835
8798
|
}
|
|
8836
8799
|
if (this.type === TILESET_TYPE.I3S) {
|
|
8837
8800
|
this._initializeI3STileset();
|
|
8838
8801
|
}
|
|
8839
|
-
this._calculateViewProps();
|
|
8840
8802
|
}
|
|
8841
|
-
|
|
8803
|
+
calculateViewPropsI3S() {
|
|
8804
|
+
const fullExtent = this.tileset.fullExtent;
|
|
8805
|
+
if (fullExtent) {
|
|
8806
|
+
const { xmin, xmax, ymin, ymax, zmin, zmax } = fullExtent;
|
|
8807
|
+
this.cartographicCenter = new Vector3(xmin + (xmax - xmin) / 2, ymin + (ymax - ymin) / 2, zmin + (zmax - zmin) / 2);
|
|
8808
|
+
this.cartesianCenter = Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter, new Vector3());
|
|
8809
|
+
this.zoom = getZoomFromFullExtent(fullExtent, this.cartographicCenter, this.cartesianCenter);
|
|
8810
|
+
return;
|
|
8811
|
+
}
|
|
8812
|
+
const extent = this.tileset.store?.extent;
|
|
8813
|
+
if (extent) {
|
|
8814
|
+
const [xmin, ymin, xmax, ymax] = extent;
|
|
8815
|
+
this.cartographicCenter = new Vector3(xmin + (xmax - xmin) / 2, ymin + (ymax - ymin) / 2, 0);
|
|
8816
|
+
this.cartesianCenter = Ellipsoid.WGS84.cartographicToCartesian(this.cartographicCenter, new Vector3());
|
|
8817
|
+
this.zoom = getZoomFromExtent(extent, this.cartographicCenter, this.cartesianCenter);
|
|
8818
|
+
return;
|
|
8819
|
+
}
|
|
8820
|
+
console.warn("Extent is not defined in the tileset header");
|
|
8821
|
+
this.cartographicCenter = new Vector3();
|
|
8822
|
+
this.zoom = 1;
|
|
8823
|
+
return;
|
|
8824
|
+
}
|
|
8825
|
+
calculateViewPropsTiles3D() {
|
|
8842
8826
|
const root = this.root;
|
|
8843
8827
|
assert2(root);
|
|
8844
8828
|
const { center } = root.boundingVolume;
|
|
@@ -8996,7 +8980,7 @@
|
|
|
8996
8980
|
this._unloadTile(tile);
|
|
8997
8981
|
tile.destroy();
|
|
8998
8982
|
}
|
|
8999
|
-
|
|
8983
|
+
_initializeTiles3DTileset(tilesetJson) {
|
|
9000
8984
|
this.asset = tilesetJson.asset;
|
|
9001
8985
|
if (!this.asset) {
|
|
9002
8986
|
throw new Error("Tileset must have an asset property.");
|