@loaders.gl/tiles 4.0.0-alpha.17 → 4.0.0-alpha.18

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 (2) hide show
  1. package/dist/dist.min.js +73 -37
  2. package/package.json +4 -4
package/dist/dist.min.js CHANGED
@@ -1,5 +1,10 @@
1
1
  (() => {
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
8
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
4
9
  var __esm = (fn, res) => function __init() {
5
10
  return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
@@ -12,6 +17,17 @@
12
17
  for (var name in all)
13
18
  __defProp(target, name, { get: all[name], enumerable: true });
14
19
  };
20
+ var __reExport = (target, module, desc) => {
21
+ if (module && typeof module === "object" || typeof module === "function") {
22
+ for (let key of __getOwnPropNames(module))
23
+ if (!__hasOwnProp.call(target, key) && key !== "default")
24
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
25
+ }
26
+ return target;
27
+ };
28
+ var __toModule = (module) => {
29
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
30
+ };
15
31
 
16
32
  // ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
17
33
  function assert(condition, message) {
@@ -4832,55 +4848,55 @@
4832
4848
  return this._length;
4833
4849
  }
4834
4850
  add(item) {
4835
- const node2 = new DoublyLinkedListNode(item, this.tail, null);
4851
+ const node3 = new DoublyLinkedListNode(item, this.tail, null);
4836
4852
  if (this.tail) {
4837
- this.tail.next = node2;
4838
- this.tail = node2;
4853
+ this.tail.next = node3;
4854
+ this.tail = node3;
4839
4855
  } else {
4840
- this.head = node2;
4841
- this.tail = node2;
4856
+ this.head = node3;
4857
+ this.tail = node3;
4842
4858
  }
4843
4859
  ++this._length;
4844
- return node2;
4860
+ return node3;
4845
4861
  }
4846
- remove(node2) {
4847
- if (!node2) {
4862
+ remove(node3) {
4863
+ if (!node3) {
4848
4864
  return;
4849
4865
  }
4850
- if (node2.previous && node2.next) {
4851
- node2.previous.next = node2.next;
4852
- node2.next.previous = node2.previous;
4853
- } else if (node2.previous) {
4854
- node2.previous.next = null;
4855
- this.tail = node2.previous;
4856
- } else if (node2.next) {
4857
- node2.next.previous = null;
4858
- this.head = node2.next;
4866
+ if (node3.previous && node3.next) {
4867
+ node3.previous.next = node3.next;
4868
+ node3.next.previous = node3.previous;
4869
+ } else if (node3.previous) {
4870
+ node3.previous.next = null;
4871
+ this.tail = node3.previous;
4872
+ } else if (node3.next) {
4873
+ node3.next.previous = null;
4874
+ this.head = node3.next;
4859
4875
  } else {
4860
4876
  this.head = null;
4861
4877
  this.tail = null;
4862
4878
  }
4863
- node2.next = null;
4864
- node2.previous = null;
4879
+ node3.next = null;
4880
+ node3.previous = null;
4865
4881
  --this._length;
4866
4882
  }
4867
- splice(node2, nextNode) {
4868
- if (node2 === nextNode) {
4883
+ splice(node3, nextNode) {
4884
+ if (node3 === nextNode) {
4869
4885
  return;
4870
4886
  }
4871
4887
  this.remove(nextNode);
4872
- this._insert(node2, nextNode);
4888
+ this._insert(node3, nextNode);
4873
4889
  }
4874
- _insert(node2, nextNode) {
4875
- const oldNodeNext = node2.next;
4876
- node2.next = nextNode;
4877
- if (this.tail === node2) {
4890
+ _insert(node3, nextNode) {
4891
+ const oldNodeNext = node3.next;
4892
+ node3.next = nextNode;
4893
+ if (this.tail === node3) {
4878
4894
  this.tail = nextNode;
4879
4895
  } else {
4880
4896
  oldNodeNext.previous = nextNode;
4881
4897
  }
4882
4898
  nextNode.next = oldNodeNext;
4883
- nextNode.previous = node2;
4899
+ nextNode.previous = node3;
4884
4900
  ++this._length;
4885
4901
  }
4886
4902
  };
@@ -4902,9 +4918,9 @@
4902
4918
  this._list.splice(this._list.tail, this._sentinel);
4903
4919
  }
4904
4920
  touch(tile) {
4905
- const node2 = tile._cacheNode;
4906
- if (node2) {
4907
- this._list.splice(this._sentinel, node2);
4921
+ const node3 = tile._cacheNode;
4922
+ if (node3) {
4923
+ this._list.splice(this._sentinel, node3);
4908
4924
  }
4909
4925
  }
4910
4926
  add(tileset, tile, addCallback) {
@@ -4916,11 +4932,11 @@
4916
4932
  }
4917
4933
  }
4918
4934
  unloadTile(tileset, tile, unloadCallback) {
4919
- const node2 = tile._cacheNode;
4920
- if (!node2) {
4935
+ const node3 = tile._cacheNode;
4936
+ if (!node3) {
4921
4937
  return;
4922
4938
  }
4923
- this._list.remove(node2);
4939
+ this._list.remove(node3);
4924
4940
  tile._cacheNode = null;
4925
4941
  if (unloadCallback) {
4926
4942
  unloadCallback(tileset, tile);
@@ -4932,10 +4948,10 @@
4932
4948
  const list = this._list;
4933
4949
  const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
4934
4950
  const sentinel = this._sentinel;
4935
- let node2 = list.head;
4936
- while (node2 !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
4937
- const tile = node2.item;
4938
- node2 = node2.next;
4951
+ let node3 = list.head;
4952
+ while (node3 !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
4953
+ const tile = node3.item;
4954
+ node3 = node3.next;
4939
4955
  this.unloadTile(tileset, tile, unloadCallback);
4940
4956
  }
4941
4957
  }
@@ -5902,18 +5918,38 @@
5902
5918
  }
5903
5919
  });
5904
5920
 
5921
+ // (disabled):../core/src/lib/fetch/fetch-file.node
5922
+ var require_fetch_file = __commonJS({
5923
+ "(disabled):../core/src/lib/fetch/fetch-file.node"() {
5924
+ }
5925
+ });
5926
+
5905
5927
  // ../core/src/lib/fetch/fetch-file.ts
5928
+ function isNodePath(url) {
5929
+ return !isRequestURL(url) && !isDataURL(url);
5930
+ }
5931
+ function isRequestURL(url) {
5932
+ return url.startsWith("http:") || url.startsWith("https:");
5933
+ }
5934
+ function isDataURL(url) {
5935
+ return url.startsWith("data:");
5936
+ }
5906
5937
  async function fetchFile(urlOrData, fetchOptions) {
5907
5938
  if (typeof urlOrData === "string") {
5908
5939
  const url = resolvePath(urlOrData);
5940
+ if (isNodePath(url) && node2?.fetchFileNode) {
5941
+ return node2.fetchFileNode(url, fetchOptions);
5942
+ }
5909
5943
  return await fetch(url, fetchOptions);
5910
5944
  }
5911
5945
  return await makeResponse(urlOrData);
5912
5946
  }
5947
+ var node2;
5913
5948
  var init_fetch_file = __esm({
5914
5949
  "../core/src/lib/fetch/fetch-file.ts"() {
5915
5950
  init_src2();
5916
5951
  init_response_utils();
5952
+ node2 = __toModule(require_fetch_file());
5917
5953
  }
5918
5954
  });
5919
5955
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/tiles",
3
- "version": "4.0.0-alpha.17",
3
+ "version": "4.0.0-alpha.18",
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": "4.0.0-alpha.17",
37
- "@loaders.gl/math": "4.0.0-alpha.17",
36
+ "@loaders.gl/loader-utils": "4.0.0-alpha.18",
37
+ "@loaders.gl/math": "4.0.0-alpha.18",
38
38
  "@math.gl/core": "^3.5.1",
39
39
  "@math.gl/culling": "^3.5.1",
40
40
  "@math.gl/geospatial": "^3.5.1",
@@ -47,5 +47,5 @@
47
47
  "devDependencies": {
48
48
  "@deck.gl/core": "^8.9.0"
49
49
  },
50
- "gitHead": "68a743e2460cc89bf89edabfd08b395380d7d10c"
50
+ "gitHead": "7bc633f46560f661bdd46cf1015ea27b3694ebce"
51
51
  }