@deck.gl/geo-layers 9.0.28 → 9.0.30
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.dev.js +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +2 -2
- package/dist/tileset-2d/tileset-2d.js +5 -5
- package/dist.min.js +1 -1
- package/package.json +6 -6
- package/src/tileset-2d/tileset-2d.ts +5 -5
package/dist/dist.dev.js
CHANGED
|
@@ -11291,7 +11291,7 @@ var __exports__ = (() => {
|
|
|
11291
11291
|
this.setOptions(this.opts);
|
|
11292
11292
|
this.onTileLoad = (tile) => {
|
|
11293
11293
|
this.opts.onTileLoad?.(tile);
|
|
11294
|
-
if (this.opts.maxCacheByteSize) {
|
|
11294
|
+
if (this.opts.maxCacheByteSize != null) {
|
|
11295
11295
|
this._cacheByteSize += tile.byteLength;
|
|
11296
11296
|
this._resizeCache();
|
|
11297
11297
|
}
|
|
@@ -11514,13 +11514,13 @@ var __exports__ = (() => {
|
|
|
11514
11514
|
}
|
|
11515
11515
|
_resizeCache() {
|
|
11516
11516
|
const { _cache, opts } = this;
|
|
11517
|
-
const maxCacheSize = opts.maxCacheSize
|
|
11518
|
-
const maxCacheByteSize = opts.maxCacheByteSize
|
|
11517
|
+
const maxCacheSize = opts.maxCacheSize ?? (opts.maxCacheByteSize != null ? Infinity : DEFAULT_CACHE_SCALE * this.selectedTiles.length);
|
|
11518
|
+
const maxCacheByteSize = opts.maxCacheByteSize ?? Infinity;
|
|
11519
11519
|
const overflown = _cache.size > maxCacheSize || this._cacheByteSize > maxCacheByteSize;
|
|
11520
11520
|
if (overflown) {
|
|
11521
11521
|
for (const [id, tile] of _cache) {
|
|
11522
11522
|
if (!tile.isVisible && !tile.isSelected) {
|
|
11523
|
-
this._cacheByteSize -= opts.maxCacheByteSize ? tile.byteLength : 0;
|
|
11523
|
+
this._cacheByteSize -= opts.maxCacheByteSize != null ? tile.byteLength : 0;
|
|
11524
11524
|
_cache.delete(id);
|
|
11525
11525
|
this.opts.onTileUnload?.(tile);
|
|
11526
11526
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1076,7 +1076,7 @@ var Tileset2D = class {
|
|
|
1076
1076
|
this.onTileLoad = (tile) => {
|
|
1077
1077
|
var _a, _b;
|
|
1078
1078
|
(_b = (_a = this.opts).onTileLoad) == null ? void 0 : _b.call(_a, tile);
|
|
1079
|
-
if (this.opts.maxCacheByteSize) {
|
|
1079
|
+
if (this.opts.maxCacheByteSize != null) {
|
|
1080
1080
|
this._cacheByteSize += tile.byteLength;
|
|
1081
1081
|
this._resizeCache();
|
|
1082
1082
|
}
|
|
@@ -1293,13 +1293,13 @@ var Tileset2D = class {
|
|
|
1293
1293
|
_resizeCache() {
|
|
1294
1294
|
var _a, _b;
|
|
1295
1295
|
const { _cache, opts } = this;
|
|
1296
|
-
const maxCacheSize = opts.maxCacheSize
|
|
1297
|
-
const maxCacheByteSize = opts.maxCacheByteSize
|
|
1296
|
+
const maxCacheSize = opts.maxCacheSize ?? (opts.maxCacheByteSize != null ? Infinity : DEFAULT_CACHE_SCALE * this.selectedTiles.length);
|
|
1297
|
+
const maxCacheByteSize = opts.maxCacheByteSize ?? Infinity;
|
|
1298
1298
|
const overflown = _cache.size > maxCacheSize || this._cacheByteSize > maxCacheByteSize;
|
|
1299
1299
|
if (overflown) {
|
|
1300
1300
|
for (const [id, tile] of _cache) {
|
|
1301
1301
|
if (!tile.isVisible && !tile.isSelected) {
|
|
1302
|
-
this._cacheByteSize -= opts.maxCacheByteSize ? tile.byteLength : 0;
|
|
1302
|
+
this._cacheByteSize -= opts.maxCacheByteSize != null ? tile.byteLength : 0;
|
|
1303
1303
|
_cache.delete(id);
|
|
1304
1304
|
(_b = (_a = this.opts).onTileUnload) == null ? void 0 : _b.call(_a, tile);
|
|
1305
1305
|
}
|