@loaders.gl/mvt 4.3.0-alpha.6 → 4.3.0-alpha.8

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.
@@ -771,52 +771,6 @@
771
771
  }
772
772
  });
773
773
 
774
- // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
775
- function _typeof(obj) {
776
- "@babel/helpers - typeof";
777
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
778
- return typeof obj2;
779
- } : function(obj2) {
780
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
781
- }, _typeof(obj);
782
- }
783
-
784
- // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
785
- function _toPrimitive(input, hint) {
786
- if (_typeof(input) !== "object" || input === null)
787
- return input;
788
- var prim = input[Symbol.toPrimitive];
789
- if (prim !== void 0) {
790
- var res = prim.call(input, hint || "default");
791
- if (_typeof(res) !== "object")
792
- return res;
793
- throw new TypeError("@@toPrimitive must return a primitive value.");
794
- }
795
- return (hint === "string" ? String : Number)(input);
796
- }
797
-
798
- // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
799
- function _toPropertyKey(arg) {
800
- var key = _toPrimitive(arg, "string");
801
- return _typeof(key) === "symbol" ? key : String(key);
802
- }
803
-
804
- // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
805
- function _defineProperty(obj, key, value) {
806
- key = _toPropertyKey(key);
807
- if (key in obj) {
808
- Object.defineProperty(obj, key, {
809
- value,
810
- enumerable: true,
811
- configurable: true,
812
- writable: true
813
- });
814
- } else {
815
- obj[key] = value;
816
- }
817
- return obj;
818
- }
819
-
820
774
  // ../../node_modules/@math.gl/polygon/dist/polygon-utils.js
821
775
  var DimIndex = {
822
776
  x: 0,
@@ -824,11 +778,7 @@
824
778
  z: 2
825
779
  };
826
780
  function getPolygonSignedArea(points, options = {}) {
827
- const {
828
- start = 0,
829
- end = points.length,
830
- plane = "xy"
831
- } = options;
781
+ const { start = 0, end = points.length, plane = "xy" } = options;
832
782
  const dim = options.size || 2;
833
783
  let area2 = 0;
834
784
  const i0 = DimIndex[plane[0]];
@@ -882,12 +832,7 @@
882
832
  let i;
883
833
  let last;
884
834
  if (area2 === void 0) {
885
- area2 = getPolygonSignedArea(data, {
886
- start,
887
- end,
888
- size: dim,
889
- plane
890
- });
835
+ area2 = getPolygonSignedArea(data, { start, end, size: dim, plane });
891
836
  }
892
837
  let i0 = DimIndex[plane[0]];
893
838
  let i1 = DimIndex[plane[1]];
@@ -1222,7 +1167,10 @@
1222
1167
  return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
1223
1168
  }
1224
1169
  function isValidDiagonal(a, b) {
1225
- return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
1170
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
1171
+ (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
1172
+ (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
1173
+ equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
1226
1174
  }
1227
1175
  function area(p, q, r) {
1228
1176
  return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
@@ -1315,15 +1263,12 @@
1315
1263
  }
1316
1264
  var Vertex = class {
1317
1265
  constructor(i, x, y) {
1318
- _defineProperty(this, "i", void 0);
1319
- _defineProperty(this, "x", void 0);
1320
- _defineProperty(this, "y", void 0);
1321
- _defineProperty(this, "prev", null);
1322
- _defineProperty(this, "next", null);
1323
- _defineProperty(this, "z", 0);
1324
- _defineProperty(this, "prevZ", null);
1325
- _defineProperty(this, "nextZ", null);
1326
- _defineProperty(this, "steiner", false);
1266
+ this.prev = null;
1267
+ this.next = null;
1268
+ this.z = 0;
1269
+ this.prevZ = null;
1270
+ this.nextZ = null;
1271
+ this.steiner = false;
1327
1272
  this.i = i;
1328
1273
  this.x = x;
1329
1274
  this.y = y;
@@ -1618,6 +1563,52 @@
1618
1563
  return constructor === Float64Array || Math.fround(x) !== x ? Float64Array : Float32Array;
1619
1564
  }
1620
1565
 
1566
+ // ../../node_modules/@babel/runtime/helpers/esm/typeof.js
1567
+ function _typeof(obj) {
1568
+ "@babel/helpers - typeof";
1569
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
1570
+ return typeof obj2;
1571
+ } : function(obj2) {
1572
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1573
+ }, _typeof(obj);
1574
+ }
1575
+
1576
+ // ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1577
+ function _toPrimitive(input, hint) {
1578
+ if (_typeof(input) !== "object" || input === null)
1579
+ return input;
1580
+ var prim = input[Symbol.toPrimitive];
1581
+ if (prim !== void 0) {
1582
+ var res = prim.call(input, hint || "default");
1583
+ if (_typeof(res) !== "object")
1584
+ return res;
1585
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1586
+ }
1587
+ return (hint === "string" ? String : Number)(input);
1588
+ }
1589
+
1590
+ // ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1591
+ function _toPropertyKey(arg) {
1592
+ var key = _toPrimitive(arg, "string");
1593
+ return _typeof(key) === "symbol" ? key : String(key);
1594
+ }
1595
+
1596
+ // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
1597
+ function _defineProperty(obj, key, value) {
1598
+ key = _toPropertyKey(key);
1599
+ if (key in obj) {
1600
+ Object.defineProperty(obj, key, {
1601
+ value,
1602
+ enumerable: true,
1603
+ configurable: true,
1604
+ writable: true
1605
+ });
1606
+ } else {
1607
+ obj[key] = value;
1608
+ }
1609
+ return obj;
1610
+ }
1611
+
1621
1612
  // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
1622
1613
  function isElectron(mockUserAgent) {
1623
1614
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
@@ -1649,7 +1640,7 @@
1649
1640
  var navigator_ = globalThis.navigator || {};
1650
1641
 
1651
1642
  // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
1652
- var VERSION = true ? "4.3.0-alpha.5" : "untranspiled source";
1643
+ var VERSION = true ? "4.3.0-alpha.7" : "untranspiled source";
1653
1644
  var isBrowser2 = isBrowser();
1654
1645
 
1655
1646
  // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
@@ -2147,7 +2138,7 @@
2147
2138
  });
2148
2139
 
2149
2140
  // ../loader-utils/src/lib/log-utils/log.ts
2150
- var VERSION2 = true ? "4.3.0-alpha.5" : "latest";
2141
+ var VERSION2 = true ? "4.3.0-alpha.7" : "latest";
2151
2142
  var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
2152
2143
  function createLog() {
2153
2144
  const log2 = new Log({ id: "loaders.gl" });
@@ -3019,7 +3010,7 @@
3019
3010
  }
3020
3011
 
3021
3012
  // src/mvt-loader.ts
3022
- var VERSION3 = true ? "4.3.0-alpha.5" : "latest";
3013
+ var VERSION3 = true ? "4.3.0-alpha.7" : "latest";
3023
3014
  var MVTWorkerLoader = {
3024
3015
  dataType: null,
3025
3016
  batchType: null,
@@ -4,7 +4,7 @@
4
4
  import { parseTileJSON } from "./lib/parse-tilejson.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.3.0-alpha.5" !== 'undefined' ? "4.3.0-alpha.5" : 'latest';
7
+ const VERSION = typeof "4.3.0-alpha.7" !== 'undefined' ? "4.3.0-alpha.7" : 'latest';
8
8
  /**
9
9
  * Loader for TileJSON metadata
10
10
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loaders.gl/mvt",
3
3
  "description": "Loader for Mapbox Vector Tiles",
4
- "version": "4.3.0-alpha.6",
4
+ "version": "4.3.0-alpha.8",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -44,11 +44,11 @@
44
44
  "build-worker": "esbuild src/workers/mvt-worker.ts --bundle --outfile=dist/mvt-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
45
45
  },
46
46
  "dependencies": {
47
- "@loaders.gl/gis": "4.3.0-alpha.6",
48
- "@loaders.gl/images": "4.3.0-alpha.6",
49
- "@loaders.gl/loader-utils": "4.3.0-alpha.6",
50
- "@loaders.gl/schema": "4.3.0-alpha.6",
51
- "@math.gl/polygon": "^4.0.0",
47
+ "@loaders.gl/gis": "4.3.0-alpha.8",
48
+ "@loaders.gl/images": "4.3.0-alpha.8",
49
+ "@loaders.gl/loader-utils": "4.3.0-alpha.8",
50
+ "@loaders.gl/schema": "4.3.0-alpha.8",
51
+ "@math.gl/polygon": "^4.1.0",
52
52
  "@probe.gl/stats": "^4.0.0",
53
53
  "pbf": "^3.2.1"
54
54
  },
@@ -58,5 +58,5 @@
58
58
  "peerDependencies": {
59
59
  "@loaders.gl/core": "^4.0.0"
60
60
  },
61
- "gitHead": "315f2e232fc4e6a477c41de800a54d3e3d957e8c"
61
+ "gitHead": "c458e0c3a09543cd7c4a293d3c3f08c12acf78c0"
62
62
  }
@@ -112,18 +112,18 @@ function readValueMessage(pbf: Protobuf) {
112
112
  tag === 1
113
113
  ? pbf.readString()
114
114
  : tag === 2
115
- ? pbf.readFloat()
116
- : tag === 3
117
- ? pbf.readDouble()
118
- : tag === 4
119
- ? pbf.readVarint64()
120
- : tag === 5
121
- ? pbf.readVarint()
122
- : tag === 6
123
- ? pbf.readSVarint()
124
- : tag === 7
125
- ? pbf.readBoolean()
126
- : null;
115
+ ? pbf.readFloat()
116
+ : tag === 3
117
+ ? pbf.readDouble()
118
+ : tag === 4
119
+ ? pbf.readVarint64()
120
+ : tag === 5
121
+ ? pbf.readVarint()
122
+ : tag === 6
123
+ ? pbf.readSVarint()
124
+ : tag === 7
125
+ ? pbf.readBoolean()
126
+ : null;
127
127
  }
128
128
 
129
129
  return value;