@loaders.gl/tiles 3.3.0-alpha.13 → 3.3.0-alpha.14
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 +79 -79
- package/package.json +4 -4
package/dist/dist.min.js
CHANGED
|
@@ -4160,46 +4160,7 @@
|
|
|
4160
4160
|
}
|
|
4161
4161
|
});
|
|
4162
4162
|
|
|
4163
|
-
// ../loader-utils/src/lib/binary-utils/buffer-utils.ts
|
|
4164
|
-
function isBuffer(value) {
|
|
4165
|
-
return value && typeof value === "object" && value.isBuffer;
|
|
4166
|
-
}
|
|
4167
|
-
function bufferToArrayBuffer(buffer) {
|
|
4168
|
-
if (isBuffer(buffer)) {
|
|
4169
|
-
const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
|
|
4170
|
-
return typedArray.slice().buffer;
|
|
4171
|
-
}
|
|
4172
|
-
return buffer;
|
|
4173
|
-
}
|
|
4174
|
-
var init_buffer_utils = __esm({
|
|
4175
|
-
"../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
|
|
4176
|
-
}
|
|
4177
|
-
});
|
|
4178
|
-
|
|
4179
4163
|
// ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
|
|
4180
|
-
function toArrayBuffer(data) {
|
|
4181
|
-
if (isBuffer(data)) {
|
|
4182
|
-
return bufferToArrayBuffer(data);
|
|
4183
|
-
}
|
|
4184
|
-
if (data instanceof ArrayBuffer) {
|
|
4185
|
-
return data;
|
|
4186
|
-
}
|
|
4187
|
-
if (ArrayBuffer.isView(data)) {
|
|
4188
|
-
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
4189
|
-
return data.buffer;
|
|
4190
|
-
}
|
|
4191
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
4192
|
-
}
|
|
4193
|
-
if (typeof data === "string") {
|
|
4194
|
-
const text = data;
|
|
4195
|
-
const uint8Array = new TextEncoder().encode(text);
|
|
4196
|
-
return uint8Array.buffer;
|
|
4197
|
-
}
|
|
4198
|
-
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
4199
|
-
return data._toArrayBuffer();
|
|
4200
|
-
}
|
|
4201
|
-
throw new Error("toArrayBuffer");
|
|
4202
|
-
}
|
|
4203
4164
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
4204
4165
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
4205
4166
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -4227,7 +4188,6 @@
|
|
|
4227
4188
|
}
|
|
4228
4189
|
var init_array_buffer_utils = __esm({
|
|
4229
4190
|
"../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
|
|
4230
|
-
init_buffer_utils();
|
|
4231
4191
|
}
|
|
4232
4192
|
});
|
|
4233
4193
|
|
|
@@ -4370,6 +4330,45 @@
|
|
|
4370
4330
|
}
|
|
4371
4331
|
});
|
|
4372
4332
|
|
|
4333
|
+
// (disabled):../loader-utils/src/lib/node/buffer
|
|
4334
|
+
var init_buffer = __esm({
|
|
4335
|
+
"(disabled):../loader-utils/src/lib/node/buffer"() {
|
|
4336
|
+
}
|
|
4337
|
+
});
|
|
4338
|
+
|
|
4339
|
+
// ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
|
|
4340
|
+
function isBuffer(value) {
|
|
4341
|
+
return value && typeof value === "object" && value.isBuffer;
|
|
4342
|
+
}
|
|
4343
|
+
function toArrayBuffer2(data) {
|
|
4344
|
+
if (isBuffer(data)) {
|
|
4345
|
+
return node.toArrayBuffer(data);
|
|
4346
|
+
}
|
|
4347
|
+
if (data instanceof ArrayBuffer) {
|
|
4348
|
+
return data;
|
|
4349
|
+
}
|
|
4350
|
+
if (ArrayBuffer.isView(data)) {
|
|
4351
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
4352
|
+
return data.buffer;
|
|
4353
|
+
}
|
|
4354
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
4355
|
+
}
|
|
4356
|
+
if (typeof data === "string") {
|
|
4357
|
+
const text = data;
|
|
4358
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
4359
|
+
return uint8Array.buffer;
|
|
4360
|
+
}
|
|
4361
|
+
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
4362
|
+
return data._toArrayBuffer();
|
|
4363
|
+
}
|
|
4364
|
+
throw new Error("toArrayBuffer");
|
|
4365
|
+
}
|
|
4366
|
+
var init_memory_conversion_utils = __esm({
|
|
4367
|
+
"../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
|
|
4368
|
+
init_buffer();
|
|
4369
|
+
}
|
|
4370
|
+
});
|
|
4371
|
+
|
|
4373
4372
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
4374
4373
|
var path_exports = {};
|
|
4375
4374
|
__export(path_exports, {
|
|
@@ -4413,6 +4412,7 @@
|
|
|
4413
4412
|
init_async_iteration();
|
|
4414
4413
|
init_request_scheduler();
|
|
4415
4414
|
init_file_aliases();
|
|
4415
|
+
init_memory_conversion_utils();
|
|
4416
4416
|
init_path();
|
|
4417
4417
|
}
|
|
4418
4418
|
});
|
|
@@ -4446,55 +4446,55 @@
|
|
|
4446
4446
|
return this._length;
|
|
4447
4447
|
}
|
|
4448
4448
|
add(item) {
|
|
4449
|
-
const
|
|
4449
|
+
const node2 = new DoublyLinkedListNode(item, this.tail, null);
|
|
4450
4450
|
if (this.tail) {
|
|
4451
|
-
this.tail.next =
|
|
4452
|
-
this.tail =
|
|
4451
|
+
this.tail.next = node2;
|
|
4452
|
+
this.tail = node2;
|
|
4453
4453
|
} else {
|
|
4454
|
-
this.head =
|
|
4455
|
-
this.tail =
|
|
4454
|
+
this.head = node2;
|
|
4455
|
+
this.tail = node2;
|
|
4456
4456
|
}
|
|
4457
4457
|
++this._length;
|
|
4458
|
-
return
|
|
4458
|
+
return node2;
|
|
4459
4459
|
}
|
|
4460
|
-
remove(
|
|
4461
|
-
if (!
|
|
4460
|
+
remove(node2) {
|
|
4461
|
+
if (!node2) {
|
|
4462
4462
|
return;
|
|
4463
4463
|
}
|
|
4464
|
-
if (
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
} else if (
|
|
4468
|
-
|
|
4469
|
-
this.tail =
|
|
4470
|
-
} else if (
|
|
4471
|
-
|
|
4472
|
-
this.head =
|
|
4464
|
+
if (node2.previous && node2.next) {
|
|
4465
|
+
node2.previous.next = node2.next;
|
|
4466
|
+
node2.next.previous = node2.previous;
|
|
4467
|
+
} else if (node2.previous) {
|
|
4468
|
+
node2.previous.next = null;
|
|
4469
|
+
this.tail = node2.previous;
|
|
4470
|
+
} else if (node2.next) {
|
|
4471
|
+
node2.next.previous = null;
|
|
4472
|
+
this.head = node2.next;
|
|
4473
4473
|
} else {
|
|
4474
4474
|
this.head = null;
|
|
4475
4475
|
this.tail = null;
|
|
4476
4476
|
}
|
|
4477
|
-
|
|
4478
|
-
|
|
4477
|
+
node2.next = null;
|
|
4478
|
+
node2.previous = null;
|
|
4479
4479
|
--this._length;
|
|
4480
4480
|
}
|
|
4481
|
-
splice(
|
|
4482
|
-
if (
|
|
4481
|
+
splice(node2, nextNode) {
|
|
4482
|
+
if (node2 === nextNode) {
|
|
4483
4483
|
return;
|
|
4484
4484
|
}
|
|
4485
4485
|
this.remove(nextNode);
|
|
4486
|
-
this._insert(
|
|
4486
|
+
this._insert(node2, nextNode);
|
|
4487
4487
|
}
|
|
4488
|
-
_insert(
|
|
4489
|
-
const oldNodeNext =
|
|
4490
|
-
|
|
4491
|
-
if (this.tail ===
|
|
4488
|
+
_insert(node2, nextNode) {
|
|
4489
|
+
const oldNodeNext = node2.next;
|
|
4490
|
+
node2.next = nextNode;
|
|
4491
|
+
if (this.tail === node2) {
|
|
4492
4492
|
this.tail = nextNode;
|
|
4493
4493
|
} else {
|
|
4494
4494
|
oldNodeNext.previous = nextNode;
|
|
4495
4495
|
}
|
|
4496
4496
|
nextNode.next = oldNodeNext;
|
|
4497
|
-
nextNode.previous =
|
|
4497
|
+
nextNode.previous = node2;
|
|
4498
4498
|
++this._length;
|
|
4499
4499
|
}
|
|
4500
4500
|
};
|
|
@@ -4519,9 +4519,9 @@
|
|
|
4519
4519
|
this._list.splice(this._list.tail, this._sentinel);
|
|
4520
4520
|
}
|
|
4521
4521
|
touch(tile) {
|
|
4522
|
-
const
|
|
4523
|
-
if (defined(
|
|
4524
|
-
this._list.splice(this._sentinel,
|
|
4522
|
+
const node2 = tile._cacheNode;
|
|
4523
|
+
if (defined(node2)) {
|
|
4524
|
+
this._list.splice(this._sentinel, node2);
|
|
4525
4525
|
}
|
|
4526
4526
|
}
|
|
4527
4527
|
add(tileset, tile, addCallback) {
|
|
@@ -4533,11 +4533,11 @@
|
|
|
4533
4533
|
}
|
|
4534
4534
|
}
|
|
4535
4535
|
unloadTile(tileset, tile, unloadCallback) {
|
|
4536
|
-
const
|
|
4537
|
-
if (!defined(
|
|
4536
|
+
const node2 = tile._cacheNode;
|
|
4537
|
+
if (!defined(node2)) {
|
|
4538
4538
|
return;
|
|
4539
4539
|
}
|
|
4540
|
-
this._list.remove(
|
|
4540
|
+
this._list.remove(node2);
|
|
4541
4541
|
tile._cacheNode = void 0;
|
|
4542
4542
|
if (unloadCallback) {
|
|
4543
4543
|
unloadCallback(tileset, tile);
|
|
@@ -4549,10 +4549,10 @@
|
|
|
4549
4549
|
const list = this._list;
|
|
4550
4550
|
const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
|
|
4551
4551
|
const sentinel = this._sentinel;
|
|
4552
|
-
let
|
|
4553
|
-
while (
|
|
4554
|
-
const tile =
|
|
4555
|
-
|
|
4552
|
+
let node2 = list.head;
|
|
4553
|
+
while (node2 !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
|
|
4554
|
+
const tile = node2.item;
|
|
4555
|
+
node2 = node2.next;
|
|
4556
4556
|
this.unloadTile(tileset, tile, unloadCallback);
|
|
4557
4557
|
}
|
|
4558
4558
|
}
|
|
@@ -6679,7 +6679,7 @@
|
|
|
6679
6679
|
if (done) {
|
|
6680
6680
|
return;
|
|
6681
6681
|
}
|
|
6682
|
-
yield
|
|
6682
|
+
yield toArrayBuffer2(value);
|
|
6683
6683
|
}
|
|
6684
6684
|
} catch (error) {
|
|
6685
6685
|
reader.releaseLock();
|
|
@@ -6687,7 +6687,7 @@
|
|
|
6687
6687
|
}
|
|
6688
6688
|
async function* makeNodeStreamIterator(stream, options) {
|
|
6689
6689
|
for await (const chunk of stream) {
|
|
6690
|
-
yield
|
|
6690
|
+
yield toArrayBuffer2(chunk);
|
|
6691
6691
|
}
|
|
6692
6692
|
}
|
|
6693
6693
|
var init_make_stream_iterator = __esm({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tiles",
|
|
3
|
-
"version": "3.3.0-alpha.
|
|
3
|
+
"version": "3.3.0-alpha.14",
|
|
4
4
|
"description": "Common components for different tiles loaders.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@loaders.gl/loader-utils": "3.3.0-alpha.
|
|
37
|
-
"@loaders.gl/math": "3.3.0-alpha.
|
|
36
|
+
"@loaders.gl/loader-utils": "3.3.0-alpha.14",
|
|
37
|
+
"@loaders.gl/math": "3.3.0-alpha.14",
|
|
38
38
|
"@math.gl/core": "^3.5.1",
|
|
39
39
|
"@math.gl/culling": "^3.5.1",
|
|
40
40
|
"@math.gl/geospatial": "^3.5.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@loaders.gl/core": "^3.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "cc91201ca3c0581a5c9edf7a8bc0fc230212bf3d"
|
|
48
48
|
}
|