@maptalks/3dtiles 0.12.3 → 0.12.4

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/3dtiles v0.12.3
2
+ * @maptalks/3dtiles v0.12.4
3
3
  * LICENSE : UNLICENSED
4
4
  * (c) 2016-2022 maptalks.com
5
5
  */
@@ -233,19 +233,19 @@
233
233
  getArrayBuffer: (t, e = {}) => (e || (e = {}), e.responseType = "arraybuffer", z.get(t, e)),
234
234
  getJSON: function(t, e = {}) {
235
235
  return e && e.jsonp ? z.jsonp(t) : ((e = e || {}).responseType = "json", z.get(t, e));
236
- },
237
- jsonp: function(t) {
238
- const e = "_maptalks_jsonp_" + v++;
239
- t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
240
- let n = document.createElement("script");
241
- return n.type = "text/javascript", n.src = t, new Promise(t => {
242
- window[e] = function(r) {
243
- document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
244
- t(r);
245
- }, document.getElementsByTagName("head")[0].appendChild(n);
246
- });
247
236
  }
248
237
  };
238
+ z.jsonp = function(t) {
239
+ const e = "_maptalks_jsonp_" + v++;
240
+ t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
241
+ let n = document.createElement("script");
242
+ return n.type = "text/javascript", n.src = t, new Promise(t => {
243
+ window[e] = function(r) {
244
+ document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
245
+ t(r);
246
+ }, document.getElementsByTagName("head")[0].appendChild(n);
247
+ });
248
+ };
249
249
  class j {
250
250
  constructor(t, e, n) {
251
251
  this.i = t, this.decoders = e, this.o = n, this.images = {}, this.h = {};
@@ -286,7 +286,8 @@
286
286
  requestExternalImage(t) {
287
287
  if (this.images[t.id]) return Promise.resolve(this.images[t.id]);
288
288
  const e = 0 === t.uri.indexOf("data:image/") ? t.uri : this.rootPath + "/" + t.uri;
289
- return this.h[t.id] ? this.h[t.id].then(() => this.images[t.id]) : this.h[t.id] = this.l(t.id, e);
289
+ if (this.h[t.id]) return this.h[t.id].then(() => this.images[t.id]);
290
+ return this.h[t.id] = this.l(t.id, e);
290
291
  }
291
292
  l(t, e) {
292
293
  return new Promise((n, r) => {
@@ -349,7 +350,8 @@
349
350
  });
350
351
  }
351
352
  g(t, e, n, r = 0) {
352
- const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.A(i.type), h = I(i.componentType), u = o.byteStride || 0, f = {
353
+ const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.A(i.type), h = I(i.componentType), u = o.byteStride || 0;
354
+ const f = {
353
355
  array: void 0,
354
356
  name: t,
355
357
  accessorName: e,
@@ -459,7 +461,7 @@
459
461
  r.instanceTechnique && r.instanceTechnique.values ? (s = r.instanceTechnique, i = s.values.diffuse) : (s = r,
460
462
  i = s.values.tex || s.values.diffuseTex || s.values.diffuse);
461
463
  const o = {
462
- baseColorTexture: {
464
+ "baseColorTexture": {
463
465
  index: i
464
466
  }
465
467
  };
@@ -580,7 +582,8 @@
580
582
  N(t, e) {
581
583
  const n = new Array(t.byteLength);
582
584
  for (let e = 0; e < t.byteLength; e++) n[e] = String.fromCharCode(t[e]);
583
- return n.join(""), "data:" + (e = e || "image/png") + ";base64," + function(t) {
585
+ n.join("");
586
+ return "data:" + (e = e || "image/png") + ";base64," + function(t) {
584
587
  return "undefined" != typeof self ? self.btoa(t) : window.btoa(t);
585
588
  }(unescape(encodeURIComponent(n)));
586
589
  }
@@ -604,19 +607,19 @@
604
607
  });
605
608
  }
606
609
  }
607
- const $ = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
608
- class J {
610
+ const $ = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null, J = 1313821514, K = 5130562;
611
+ class X {
609
612
  static read(t, e = 0, n = 0) {
610
613
  n || (n = t.byteLength);
611
614
  const r = new DataView(t, e, n), s = r.getUint32(4, !0);
612
- if (1 === s) return J.readV1(r, e);
613
- if (2 === s) return J.readV2(t, e);
615
+ if (1 === s) return X.readV1(r, e);
616
+ if (2 === s) return X.readV2(t, e);
614
617
  throw new Error("Unsupported glb version : " + s);
615
618
  }
616
619
  static readV1(t, e) {
617
620
  const n = t.getUint32(8, !0), r = t.getUint32(12, !0);
618
621
  if (n !== t.byteLength) throw new Error("Length in GLB header is inconsistent with glb's byte length.");
619
- const s = K(t.buffer, 20 + e, r);
622
+ const s = W(t.buffer, 20 + e, r);
620
623
  return {
621
624
  json: JSON.parse(s),
622
625
  glbBuffer: {
@@ -634,7 +637,7 @@
634
637
  const a = i.getUint32(o, !0);
635
638
  o += 4;
636
639
  const c = i.getUint32(o, !0);
637
- if (o += 4, 1313821514 === c) n = K(t, e + 12 + o, a); else if (5130562 === c) {
640
+ if (o += 4, c === J) n = W(t, e + 12 + o, a); else if (c === K) {
638
641
  s = e + 12 + o, r = a;
639
642
  break;
640
643
  }
@@ -650,7 +653,7 @@
650
653
  };
651
654
  }
652
655
  }
653
- function K(t, e, n) {
656
+ function W(t, e, n) {
654
657
  if ($) {
655
658
  const r = new Uint8Array(t, e, n);
656
659
  return $.decode(r);
@@ -661,7 +664,7 @@
661
664
  for (let r = 0; r < e; ) {
662
665
  let s = t[r++];
663
666
  if (128 & s) {
664
- let n = X[s >> 3 & 7];
667
+ let n = Z[s >> 3 & 7];
665
668
  if (!(64 & s) || !n || r + n > e) return null;
666
669
  for (s &= 63 >> n; n > 0; n -= 1) {
667
670
  const e = t[r++];
@@ -674,17 +677,18 @@
674
677
  return n;
675
678
  }(new Uint8Array(t, e, n));
676
679
  }
677
- const X = [ 1, 1, 1, 1, 2, 2, 3, 0 ], W = [ 0, 0, 0 ], Z = [ 0, 0, 0, 1 ], Y = [ 1, 1, 1 ], Q = {
680
+ const Z = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
681
+ const Y = [ 0, 0, 0 ], Q = [ 0, 0, 0, 1 ], tt = [ 1, 1, 1 ], et = {
678
682
  TRANSLATION: [ 0, 0, 0 ],
679
683
  ROTATION: [ 0, 0, 0, 1 ],
680
684
  SCALE: [ 1, 1, 1 ]
681
- }, tt = {
685
+ }, nt = {
682
686
  PREVIOUS: null,
683
687
  NEXT: null,
684
688
  PREINDEX: null,
685
689
  NEXTINDEX: null,
686
690
  INTERPOLATION: null
687
- }, et = {
691
+ }, rt = {
688
692
  P(t, e, n, r, s, i, o, c) {
689
693
  const h = S(t) ? e.animations : [ e.animations[0] ], u = {};
690
694
  for (let e = 0; e < h.length; e++) {
@@ -693,9 +697,9 @@
693
697
  const l = f.channelsMap[n];
694
698
  if (l) for (let t = 0; t < l.length; t++) {
695
699
  const e = l[t];
696
- "translation" === e.target.path ? (this.L(s, f.samplers[e.sampler], r, 1), u.translation = a(W, s)) : "rotation" === e.target.path ? (this.B(i, f.samplers[e.sampler], r, 1),
697
- u.rotation = O(Z, i)) : "scale" === e.target.path ? (this.L(o, f.samplers[e.sampler], r, 1),
698
- u.scale = a(Y, o)) : "weights" === e.target.path && c && (this.L(c, f.samplers[e.sampler], r, c.length),
700
+ "translation" === e.target.path ? (this.L(s, f.samplers[e.sampler], r, 1), u.translation = a(Y, s)) : "rotation" === e.target.path ? (this.B(i, f.samplers[e.sampler], r, 1),
701
+ u.rotation = O(Q, i)) : "scale" === e.target.path ? (this.L(o, f.samplers[e.sampler], r, 1),
702
+ u.scale = a(tt, o)) : "weights" === e.target.path && c && (this.L(c, f.samplers[e.sampler], r, c.length),
699
703
  u.weights = c);
700
704
  }
701
705
  }
@@ -705,7 +709,7 @@
705
709
  switch (e.interpolation) {
706
710
  case "LINEAR":
707
711
  {
708
- const s = this.U(tt, e, n, 1 * r);
712
+ const s = this.U(nt, e, n, 1 * r);
709
713
  s && (t = function(t, e, n, r) {
710
714
  for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
711
715
  return t;
@@ -715,7 +719,7 @@
715
719
 
716
720
  case "STEP":
717
721
  {
718
- const s = this.U(tt, e, n, 1 * r);
722
+ const s = this.U(nt, e, n, 1 * r);
719
723
  s && (t = function(t, e) {
720
724
  for (let n = 0; n < t.length; n++) t[n] = e[n];
721
725
  return t;
@@ -725,7 +729,7 @@
725
729
 
726
730
  case "CUBICSPLINE":
727
731
  {
728
- const s = this.U(tt, e, n, 3 * r);
732
+ const s = this.U(nt, e, n, 3 * r);
729
733
  s && (t = this.C(t, s, e.input.array, 3 * r));
730
734
  break;
731
735
  }
@@ -736,21 +740,21 @@
736
740
  switch (e.interpolation) {
737
741
  case "LINEAR":
738
742
  {
739
- const r = this.U(tt, e, n, 1);
743
+ const r = this.U(nt, e, n, 1);
740
744
  r && T(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
741
745
  break;
742
746
  }
743
747
 
744
748
  case "STEP":
745
749
  {
746
- const r = this.U(tt, e, n, 1);
750
+ const r = this.U(nt, e, n, 1);
747
751
  r && (t = _(t, ...r.PREVIOUS));
748
752
  break;
749
753
  }
750
754
 
751
755
  case "CUBICSPLINE":
752
756
  {
753
- const r = this.U(tt, e, n, 3);
757
+ const r = this.U(nt, e, n, 3);
754
758
  if (r) {
755
759
  for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
756
760
  r.NEXT[t] = Math.acos(r.NEXT[t]);
@@ -801,7 +805,8 @@
801
805
  },
802
806
  getAnimationClip(t, e, n, r) {
803
807
  const s = t.nodes[e] && t.nodes[e].weights;
804
- return c(W, ...Q.TRANSLATION), _(Z, ...Q.ROTATION), c(Y, ...Q.SCALE), this.P(r, t, e, n, W, Z, Y, s);
808
+ c(Y, ...et.TRANSLATION), _(Q, ...et.ROTATION), c(tt, ...et.SCALE);
809
+ return this.P(r, t, e, n, Y, Q, tt, s);
805
810
  },
806
811
  getTimeSpan(t) {
807
812
  if (!t.animations) return null;
@@ -826,20 +831,20 @@
826
831
  return n ? S(e) ? n[e] : n[Object.keys(n)[0]] : null;
827
832
  }
828
833
  };
829
- let nt = !1;
834
+ let st = !1;
830
835
  if ("undefined" != typeof OffscreenCanvas) {
831
836
  let t;
832
837
  try {
833
838
  t = new OffscreenCanvas(2, 2).getContext("2d");
834
- } catch (Wt) {}
835
- t && "undefined" != typeof createImageBitmap && (nt = !0);
839
+ } catch (t) {}
840
+ t && "undefined" != typeof createImageBitmap && (st = !0);
836
841
  }
837
- const rt = "undefined" == typeof document ? null : document.createElement("canvas");
838
- class st {
842
+ const it = "undefined" == typeof document ? null : document.createElement("canvas");
843
+ class ot {
839
844
  constructor(t, e, n) {
840
845
  if (this.options = n || {}, this.options.decoders || (this.options.decoders = {}),
841
846
  e.buffer instanceof ArrayBuffer) {
842
- const {json: n, glbBuffer: r} = J.read(e.buffer, e.byteOffset, e.byteLength);
847
+ const {json: n, glbBuffer: r} = X.read(e.buffer, e.byteOffset, e.byteLength);
843
848
  this.F(t, n, r);
844
849
  } else this.F(t, e);
845
850
  this.D = new G(this.rootPath, this.gltf, this.glbBuffer), this.k();
@@ -890,10 +895,10 @@
890
895
  return t;
891
896
  }
892
897
  static getAnimationClip(t, e, n, r) {
893
- return et.getAnimationClip(t, e, n, r);
898
+ return rt.getAnimationClip(t, e, n, r);
894
899
  }
895
900
  static getAnimationTimeSpan(t, e) {
896
- return et.getTimeSpanByName(t, e);
901
+ return rt.getTimeSpanByName(t, e);
897
902
  }
898
903
  static getTypedArrayCtor(t) {
899
904
  return I(t);
@@ -903,7 +908,7 @@
903
908
  }
904
909
  F(t, e, n) {
905
910
  this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
906
- this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = nt ? ct : this.options.requestImage || it,
911
+ this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = st ? ut : this.options.requestImage || at,
907
912
  this.options.transferable && (this.transferables = []), 2 === this.version ? (this.adapter = new q(t, e, n, this.options.requestImage, this.options.decoders || {}, this.options.supportedFormats || {}),
908
913
  this.adapter.iterate((t, e, n) => {
909
914
  e.id = "buffer_" + n;
@@ -920,7 +925,7 @@
920
925
  }
921
926
  q(t, e) {
922
927
  if (t.children && t.children.length > 0) {
923
- if (!("number" == typeof (n = t.children[0]) && isFinite(n) || function(t) {
928
+ if (!(n = t.children[0], "number" == typeof n && isFinite(n) || function(t) {
924
929
  return !M(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
925
930
  }(t.children[0]))) return t;
926
931
  const r = t.children.map(t => {
@@ -1065,11 +1070,13 @@
1065
1070
  attributes: e.reduce((t, e) => {
1066
1071
  if ("indices" === e.name) n = e; else if (e.name.indexOf("morphTargets_") > -1) r = r || {},
1067
1072
  r[e.name.slice(13)] = e; else {
1068
- if (!("POSITION" !== e.name || e.min && e.max)) {
1069
- const t = [ 1 / 0, 1 / 0, 1 / 0 ], n = [ -1 / 0, -1 / 0, -1 / 0 ], {itemSize: r, array: s} = e, i = s.length / r;
1070
- for (let e = 0; e < i; e++) for (let i = 0; i < r; i++) {
1071
- const o = e * r + i;
1072
- s[o] < t[i] && (t[i] = s[o]), s[o] > n[i] && (n[i] = s[o]);
1073
+ if ("POSITION" === e.name) {
1074
+ const t = [ 1 / 0, 1 / 0, 1 / 0 ], n = [ -1 / 0, -1 / 0, -1 / 0 ], {itemSize: r, array: s} = e;
1075
+ s.length, c(t, s[0], s[1], s[2]), c(n, s[0], s[1], s[2]);
1076
+ for (let e = 3; e < s.length; ) {
1077
+ const r = s[e++], i = s[e++], o = s[e++];
1078
+ r < t[0] && (t[0] = r), i < t[1] && (t[1] = i), o < t[2] && (t[2] = o), r > n[0] && (n[0] = r),
1079
+ i > n[1] && (n[1] = i), o > n[2] && (n[2] = o);
1073
1080
  }
1074
1081
  e.min = t, e.max = n;
1075
1082
  }
@@ -1085,12 +1092,12 @@
1085
1092
  });
1086
1093
  }
1087
1094
  }
1088
- function it(t, e) {
1095
+ function at(t, e) {
1089
1096
  const n = new Image;
1090
1097
  n.crossOrigin = "", n.onload = () => {
1091
- if (!rt) return void e(new Error("There is no canvas to draw image!"));
1092
- rt.width = n.width, rt.height = n.height;
1093
- const t = rt.getContext("2d");
1098
+ if (!it) return void e(new Error("There is no canvas to draw image!"));
1099
+ it.width = n.width, it.height = n.height;
1100
+ const t = it.getContext("2d");
1094
1101
  t.drawImage(n, 0, 0, n.width, n.height);
1095
1102
  const r = t.getImageData(0, 0, n.width, n.height), s = {
1096
1103
  width: n.width,
@@ -1102,12 +1109,12 @@
1102
1109
  e(t);
1103
1110
  }, n.src = t;
1104
1111
  }
1105
- let ot, at;
1106
- function ct(t, e) {
1107
- ot || (ot = new OffscreenCanvas(2, 2), at = ot.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
1112
+ let ct, ht;
1113
+ function ut(t, e) {
1114
+ ct || (ct = new OffscreenCanvas(2, 2), ht = ct.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
1108
1115
  const {width: n, height: r} = t;
1109
- ot.width = n, ot.height = r, at.drawImage(t, 0, 0), t.close();
1110
- const s = at.getImageData(0, 0, n, r);
1116
+ ct.width = n, ct.height = r, ht.drawImage(t, 0, 0), t.close();
1117
+ const s = ht.getImageData(0, 0, n, r);
1111
1118
  e(null, {
1112
1119
  width: n,
1113
1120
  height: r,
@@ -1117,20 +1124,20 @@
1117
1124
  console.warn(t), e(t);
1118
1125
  });
1119
1126
  }
1120
- function ht(t) {
1127
+ function ft(t) {
1121
1128
  return t / Math.PI * 180;
1122
1129
  }
1123
- function ut(t) {
1130
+ function lt(t) {
1124
1131
  return Math.sign ? Math.sign(t) : 0 === (t = +t) || isNaN(t) ? Number(t) : t > 0 ? 1 : -1;
1125
1132
  }
1126
- const ft = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
1127
- function lt(t) {
1133
+ const dt = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
1134
+ function mt(t) {
1128
1135
  const e = t.length;
1129
1136
  let n = "";
1130
1137
  for (let r = 0; r < e; ) {
1131
1138
  let s = t[r++];
1132
1139
  if (128 & s) {
1133
- let n = ft[s >> 3 & 7];
1140
+ let n = dt[s >> 3 & 7];
1134
1141
  if (!(64 & s) || !n || r + n > e) return null;
1135
1142
  for (s &= 63 >> n; n > 0; n -= 1) {
1136
1143
  const e = t[r++];
@@ -1143,14 +1150,14 @@
1143
1150
  return n;
1144
1151
  }
1145
1152
  new Array(3), new Array(3);
1146
- const dt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], mt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], yt = new Array(3), bt = new Array(3), pt = new Array(3);
1147
- function wt(t, e) {
1148
- const n = mt, r = function(t, e, n, r, s) {
1149
- const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], l = i * i * c * c, d = o * o * h * h, m = a * a * u * u, y = l + d + m, b = Math.sqrt(1 / y), p = f(_t, e, b);
1153
+ const yt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], bt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], pt = new Array(3), wt = new Array(3), _t = new Array(3);
1154
+ function gt(t, e) {
1155
+ const n = bt, r = function(t, e, n, r, s) {
1156
+ const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], l = i * i * c * c, d = o * o * h * h, m = a * a * u * u, y = l + d + m, b = Math.sqrt(1 / y), p = f(Tt, e, b);
1150
1157
  if (y < s) return isFinite(b) ? p : void 0;
1151
- const w = r[0], _ = r[1], g = r[2], T = gt;
1158
+ const w = r[0], _ = r[1], g = r[2], T = At;
1152
1159
  T[0] = p[0] * w * 2, T[1] = p[1] * _ * 2, T[2] = p[2] * g * 2;
1153
- let A, O, v, M, S, x, I, N, E, P, L, B = (1 - b) * Tt(e) / (.5 * Tt(T)), U = 0;
1160
+ let A, O, v, M, S, x, I, N, E, P, L, B = (1 - b) * Ot(e) / (.5 * Ot(T)), U = 0;
1154
1161
  do {
1155
1162
  B -= U, v = 1 / (1 + B * w), M = 1 / (1 + B * _), S = 1 / (1 + B * g), x = v * v,
1156
1163
  I = M * M, N = S * S, E = x * v, P = I * M, L = N * S, A = l * x + d * I + m * N - 1,
@@ -1158,22 +1165,22 @@
1158
1165
  U = A / (-2 * O);
1159
1166
  } while (Math.abs(A) > 1e-12);
1160
1167
  return t[0] = i * v, t[1] = o * M, t[2] = a * S, t;
1161
- }(yt, e, dt, n, .1);
1162
- let s = p(bt, r, n);
1168
+ }(pt, e, yt, n, .1);
1169
+ let s = p(wt, r, n);
1163
1170
  s = function(t, e) {
1164
1171
  const n = e[0], r = e[1], s = e[2];
1165
1172
  let i = n * n + r * r + s * s;
1166
1173
  i > 0 && (i = Math.sqrt(i), t[0] = e[0] / i, t[1] = e[1] / i, t[2] = e[2] / i);
1167
1174
  return t;
1168
1175
  }(s, s);
1169
- const i = b(pt, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = ut(d(i, e)) * Tt(i);
1170
- return t[0] = ht(o), t[1] = ht(a), t[2] = c, t;
1176
+ const i = b(_t, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = lt(d(i, e)) * Ot(i);
1177
+ return t[0] = ft(o), t[1] = ft(a), t[2] = c, t;
1171
1178
  }
1172
- const _t = new Array(3), gt = new Array(3);
1173
- function Tt(t) {
1179
+ const Tt = new Array(3), At = new Array(3);
1180
+ function Ot(t) {
1174
1181
  return i(t);
1175
1182
  }
1176
- function At(t, e) {
1183
+ function vt(t, e) {
1177
1184
  let n = "";
1178
1185
  for (let r = 0; r < 4; r++) {
1179
1186
  const s = t.getUint8(e + r);
@@ -1181,27 +1188,27 @@
1181
1188
  }
1182
1189
  return n;
1183
1190
  }
1184
- const Ot = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
1185
- function vt(t, e, n) {
1191
+ const Mt = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
1192
+ function St(t, e, n) {
1186
1193
  const r = new Uint8Array(t, e, n);
1187
- return Ot ? JSON.parse(Ot.decode(r)) : JSON.parse(lt(r));
1194
+ return Mt ? JSON.parse(Mt.decode(r)) : JSON.parse(mt(r));
1188
1195
  }
1189
- function Mt(t, e, n) {
1196
+ function xt(t, e, n) {
1190
1197
  const r = new Uint8Array(t, e, n);
1191
- return Ot ? JSON.parse(Ot.decode(r)) : JSON.parse(lt(r));
1198
+ return Mt ? JSON.parse(Mt.decode(r)) : JSON.parse(mt(r));
1192
1199
  }
1193
- function St(t, e, n) {
1200
+ function It(t, e, n) {
1194
1201
  return {
1195
1202
  offset: e,
1196
1203
  byteLength: n
1197
1204
  };
1198
1205
  }
1199
- function xt(t, e, n, r) {
1206
+ function Nt(t, e, n, r) {
1200
1207
  const {byteOffset: s, componentType: i, type: o} = t, {ctor: a, type: c} = function(t) {
1201
- return Et[t];
1208
+ return Lt[t];
1202
1209
  }(i), h = function(t) {
1203
1210
  if (!t) return 1;
1204
- return Nt[t];
1211
+ return Pt[t];
1205
1212
  }(o);
1206
1213
  return {
1207
1214
  byteStride: 0,
@@ -1212,19 +1219,19 @@
1212
1219
  array: new a(e, n + s, r * h)
1213
1220
  };
1214
1221
  }
1215
- function It(t, e, n, r) {
1222
+ function Et(t, e, n, r) {
1216
1223
  t.componentType || (t.componentType = "UNSIGNED_SHORT");
1217
- const s = xt(t, e, n, r);
1224
+ const s = Nt(t, e, n, r);
1218
1225
  return s.array.buffer.byteLength !== e.byteLength && (s.array = s.array.slice()),
1219
1226
  s;
1220
1227
  }
1221
- const Nt = {
1228
+ const Pt = {
1222
1229
  "SCALAR": 1,
1223
1230
  "VEC2": 2,
1224
1231
  "VEC3": 3,
1225
1232
  "VEC4": 4
1226
1233
  };
1227
- const Et = {
1234
+ const Lt = {
1228
1235
  "BYTE": {
1229
1236
  ctor: Int8Array,
1230
1237
  type: 5120,
@@ -1266,27 +1273,27 @@
1266
1273
  name: "Float64Array"
1267
1274
  }
1268
1275
  };
1269
- function Pt(t) {
1270
- for (let e in Et) if (t === Et[e].ctor) return Et[e].type;
1276
+ function Bt(t) {
1277
+ for (let e in Lt) if (t === Lt[e].ctor) return Lt[e].type;
1271
1278
  throw new Error("unrecognized ctor:" + t);
1272
1279
  }
1273
- function Lt(t, e, n, r) {
1280
+ function Ut(t, e, n, r) {
1274
1281
  const s = t, i = e.length / 3;
1275
1282
  for (let t = 0; t < i; t++) s[3 * t] = e[3 * t] / 65535 * r[0] + n[0], s[3 * t + 1] = e[3 * t + 1] / 65535 * r[1] + n[1],
1276
1283
  s[3 * t + 2] = e[3 * t + 2] / 65535 * r[2] + n[2];
1277
1284
  return s;
1278
1285
  }
1279
- function Bt(t, e, n) {
1286
+ function Ct(t, e, n) {
1280
1287
  let r = t.getUint32(12, !0), s = t.getUint32(16, !0), i = t.getUint32(20, !0), o = t.getUint32(24, !0);
1281
1288
  const a = t.buffer;
1282
1289
  let c, h, u = {}, f = {};
1283
- r > 0 && (u = vt(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
1290
+ r > 0 && (u = St(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
1284
1291
  return {
1285
1292
  offset: e,
1286
1293
  byteLength: n
1287
1294
  };
1288
- }(0, e, s), e += s), i > 0 && (f = Mt(a, e, i), e += i);
1289
- const l = St(0, e, o);
1295
+ }(0, e, s), e += s), i > 0 && (f = xt(a, e, i), e += i);
1296
+ const l = It(0, e, o);
1290
1297
  return h = a.slice(l.offset, l.offset + l.byteLength), n.push(h), {
1291
1298
  featureTable: u,
1292
1299
  featureTableBin: c,
@@ -1294,28 +1301,28 @@
1294
1301
  batchTableBin: h
1295
1302
  };
1296
1303
  }
1297
- var Ut = {
1304
+ var Rt = {
1298
1305
  north: [ -1, 0, 0 ],
1299
1306
  east: [ 0, 1, 0 ],
1300
1307
  up: [ 0, 0, 1 ],
1301
1308
  south: [ 1, 0, 0 ],
1302
1309
  west: [ 0, -1, 0 ],
1303
1310
  down: [ 0, 0, -1 ]
1304
- }, Ct = {}, Rt = {
1311
+ }, Ft = {}, Dt = {
1305
1312
  east: [],
1306
1313
  north: [],
1307
1314
  up: [],
1308
1315
  west: [],
1309
1316
  south: [],
1310
1317
  down: []
1311
- }, Ft = [], Dt = [], kt = [];
1312
- const zt = [ 0, 0, 0 ];
1313
- function jt(t, e, n, r) {
1318
+ }, kt = [], zt = [], jt = [];
1319
+ const Vt = [ 0, 0, 0 ];
1320
+ function Gt(t, e, n, r) {
1314
1321
  n = n || 0, r = r || n;
1315
1322
  var s = Math.abs(t - e);
1316
1323
  return s <= r || s <= n * Math.max(Math.abs(t), Math.abs(e));
1317
1324
  }
1318
- const Vt = ($t = {
1325
+ const Ht = (Kt = {
1319
1326
  up: {
1320
1327
  south: "east",
1321
1328
  north: "west",
@@ -1352,54 +1359,53 @@
1352
1359
  north: "up",
1353
1360
  south: "down"
1354
1361
  }
1355
- }[Gt = "east"][Ht = "north"], Ct[Jt = Gt + Ht] ? qt = Ct[Jt] : (qt = function(t, e, n) {
1356
- if (function(t, e) {
1357
- var n = t[0], r = t[1], s = t[2], i = e[0], o = e[1], a = e[2];
1358
- return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(r - o) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(o)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a));
1359
- }(t, zt)) a(Ft, Ut[Gt]), a(Dt, Ut[Ht]), a(kt, Ut[$t]); else if (jt(t[0], 0, 1e-14) && jt(t[1], 0, 1e-14)) {
1360
- var r = ut(t[2]);
1361
- a(Ft, Ut[Gt]), "east" !== Gt && "west" !== Gt && f(Ft, Ft, r), a(Dt, Ut[Ht]), "east" !== Ht && "west" !== Ht && f(Dt, Dt, r),
1362
- a(kt, Ut[$t]), "east" !== $t && "west" !== $t && f(kt, kt, r);
1362
+ }[qt = "east"][$t = "north"], Ft[Xt = qt + $t] ? Jt = Ft[Xt] : (Jt = function(t, e, n) {
1363
+ if (c = Vt, h = (o = t)[0], d = o[1], y = o[2], b = c[0], p = c[1], w = c[2], Math.abs(h - b) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(d - p) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(p)) && Math.abs(y - w) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(w))) a(kt, Rt[qt]),
1364
+ a(zt, Rt[$t]), a(jt, Rt[Kt]); else if (Gt(t[0], 0, 1e-14) && Gt(t[1], 0, 1e-14)) {
1365
+ var r = lt(t[2]);
1366
+ a(kt, Rt[qt]), "east" !== qt && "west" !== qt && f(kt, kt, r), a(zt, Rt[$t]), "east" !== $t && "west" !== $t && f(zt, zt, r),
1367
+ a(jt, Rt[Kt]), "east" !== Kt && "west" !== Kt && f(jt, jt, r);
1363
1368
  } else {
1364
1369
  !function(t, e) {
1365
- u(e, t, mt), l(e, e);
1366
- }(t, Rt.up);
1367
- var s = Rt.up, i = Rt.east;
1368
- i[0] = -t[1], i[1] = t[0], i[2] = 0, l(Rt.east, i), m(Rt.north, s, i), f(Rt.down, Rt.up, -1),
1369
- f(Rt.west, Rt.east, -1), f(Rt.south, Rt.north, -1), Ft = Rt[Gt], Dt = Rt[Ht], kt = Rt[$t];
1370
- }
1371
- return n[0] = Ft[0], n[1] = Ft[1], n[2] = Ft[2], n[3] = 0, n[4] = Dt[0], n[5] = Dt[1],
1372
- n[6] = Dt[2], n[7] = 0, n[8] = kt[0], n[9] = kt[1], n[10] = kt[2], n[11] = 0, n[12] = t[0],
1370
+ u(e, t, bt), l(e, e);
1371
+ }(t, Dt.up);
1372
+ var s = Dt.up, i = Dt.east;
1373
+ i[0] = -t[1], i[1] = t[0], i[2] = 0, l(Dt.east, i), m(Dt.north, s, i), f(Dt.down, Dt.up, -1),
1374
+ f(Dt.west, Dt.east, -1), f(Dt.south, Dt.north, -1), kt = Dt[qt], zt = Dt[$t], jt = Dt[Kt];
1375
+ }
1376
+ var o, c, h, d, y, b, p, w;
1377
+ return n[0] = kt[0], n[1] = kt[1], n[2] = kt[2], n[3] = 0, n[4] = zt[0], n[5] = zt[1],
1378
+ n[6] = zt[2], n[7] = 0, n[8] = jt[0], n[9] = jt[1], n[10] = jt[2], n[11] = 0, n[12] = t[0],
1373
1379
  n[13] = t[1], n[14] = t[2], n[15] = 1, n;
1374
- }, Ct[Jt] = qt), qt);
1380
+ }, Ft[Xt] = Jt), Jt);
1375
1381
  /*!
1376
1382
  * @maptalks/gl v0.65.0
1377
1383
  * LICENSE : UNLICENSED
1378
1384
  * (c) 2016-2022 maptalks.com
1379
- */ var Gt, Ht, qt, $t, Jt;
1380
- const Kt = function() {
1385
+ */ var qt, $t, Jt, Kt, Xt;
1386
+ const Wt = function() {
1381
1387
  if ("undefined" != typeof self) return self;
1382
1388
  if ("undefined" != typeof window) return window;
1383
1389
  if ("undefined" != typeof global) return global;
1384
1390
  throw new Error("unable to locate global object");
1385
- }, Xt = Kt(), Wt = Xt.gl_trans__coders = Xt.gl_trans__coders || {};
1386
- Wt.inject = function(t) {
1387
- const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = Xt.gl_trans__coders = Xt.gl_trans__coders || {};
1388
- let i = `${r}\n const _____getGlobal = ${Kt.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
1391
+ }, Zt = Wt(), Yt = Zt.gl_trans__coders = Zt.gl_trans__coders || {};
1392
+ Yt.inject = function(t) {
1393
+ const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = Zt.gl_trans__coders = Zt.gl_trans__coders || {};
1394
+ let i = `${r}\n const _____getGlobal = ${Wt.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
1389
1395
  for (const t in s) "inject" !== t && "getTranscoder" !== t && "registerTranscoder" !== t && (i += 'tran_____scoders["' + t + '"] =' + s[t].toString() + "\n;");
1390
1396
  return i += "\n" + e.substring(r.length), i;
1391
- }, Wt.registerTranscoder = function(t, e) {
1392
- Wt[t] = e;
1393
- }, Wt.getTranscoder = function(t) {
1394
- return Wt[t];
1397
+ }, Yt.registerTranscoder = function(t, e) {
1398
+ Yt[t] = e;
1399
+ }, Yt.getTranscoder = function(t) {
1400
+ return Yt[t];
1395
1401
  };
1396
- class Zt {
1402
+ class Qt {
1397
1403
  constructor(t, e, n) {
1398
- this.i = t, this.Y = e || st, this.o = n, this.tt = {
1399
- "image/crn": Wt.crn && Wt.crn(),
1400
- "image/ktx2": Wt.ktx2 && Wt.ktx2(),
1401
- "image/cttf": Wt.ktx2 && Wt.ktx2(),
1402
- "draco": Wt.draco && Wt.draco()
1404
+ this.i = t, this.Y = e || ot, this.o = n, this.tt = {
1405
+ "image/crn": Yt.crn && Yt.crn(),
1406
+ "image/ktx2": Yt.ktx2 && Yt.ktx2(),
1407
+ "image/cttf": Yt.ktx2 && Yt.ktx2(),
1408
+ "draco": Yt.draco && Yt.draco()
1403
1409
  };
1404
1410
  }
1405
1411
  static createEmptyB3DM() {
@@ -1458,15 +1464,15 @@
1458
1464
  o = h, h = a, u = c, a = 0, c = 0);
1459
1465
  const l = [ t ];
1460
1466
  let d, m, y;
1461
- if (a > 0 ? (d = vt(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
1467
+ if (a > 0 ? (d = St(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
1462
1468
  "BATCH_LENGTH": o
1463
- }, c > 0 && (f += c), h > 0 && (m = Mt(t, f, h), f += h, u > 0)) {
1464
- const e = St(0, f, u);
1469
+ }, c > 0 && (f += c), h > 0 && (m = xt(t, f, h), f += h, u > 0)) {
1470
+ const e = It(0, f, u);
1465
1471
  y = t.slice(e.offset, e.offset + e.byteLength), f += u, l.push(y);
1466
1472
  }
1467
1473
  const b = d.BATCH_LENGTH, p = {};
1468
1474
  if (d && d.BATCH_ID) {
1469
- p.BATCH_ID = It(d.BATCH_ID, t, (void 0).offset, b);
1475
+ p.BATCH_ID = Et(d.BATCH_ID, t, (void 0).offset, b);
1470
1476
  const e = p.BATCH_ID.array && p.BATCH_ID.array.buffer;
1471
1477
  e && l.indexOf(e) < 0 && l.push(e);
1472
1478
  }
@@ -1488,13 +1494,13 @@
1488
1494
  return null;
1489
1495
  }
1490
1496
  }
1491
- class Yt {
1497
+ class te {
1492
1498
  constructor(t, e, n) {
1493
- this.i = t, this.Y = e || st, this.o = n, this.tt = {
1494
- "image/crn": Wt.crn && Wt.crn(),
1495
- "image/ktx2": Wt.ktx2 && Wt.ktx2(),
1496
- "image/cttf": Wt.ktx2 && Wt.ktx2(),
1497
- "draco": Wt.draco && Wt.draco()
1499
+ this.i = t, this.Y = e || ot, this.o = n, this.tt = {
1500
+ "image/crn": Yt.crn && Yt.crn(),
1501
+ "image/ktx2": Yt.ktx2 && Yt.ktx2(),
1502
+ "image/cttf": Yt.ktx2 && Yt.ktx2(),
1503
+ "draco": Yt.draco && Yt.draco()
1498
1504
  };
1499
1505
  }
1500
1506
  load(t, e, n = 0, r = 0) {
@@ -1528,7 +1534,7 @@
1528
1534
  supportedFormats: this.o
1529
1535
  }, i = new DataView(e, n, r), o = 32 + i.getUint32(12, !0) + i.getUint32(16, !0) + i.getUint32(20, !0) + i.getUint32(24, !0);
1530
1536
  if (0 === i.getUint32(28, !0)) {
1531
- let r = lt(new Uint8Array(e, o + n, i.byteLength - o));
1537
+ let r = mt(new Uint8Array(e, o + n, i.byteLength - o));
1532
1538
  -1 == r.indexOf("://") && (r = t.substring(0, t.lastIndexOf("/")) + "/" + r);
1533
1539
  return r.indexOf(".glb") > 0 ? z.getArrayBuffer(r, {}).then(t => this.ot(r, {
1534
1540
  buffer: t.data,
@@ -1571,7 +1577,7 @@
1571
1577
  error: t
1572
1578
  };
1573
1579
  }
1574
- const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Bt(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
1580
+ const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Ct(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
1575
1581
  if (a.POSITION) {
1576
1582
  const {byteOffset: e} = a.POSITION;
1577
1583
  f.POSITION = {
@@ -1594,7 +1600,7 @@
1594
1600
  }, o.push(f.POSITION.array.buffer);
1595
1601
  }
1596
1602
  if (a.BATCH_ID) {
1597
- f.BATCH_ID = It(a.BATCH_ID, t, c.offset, l);
1603
+ f.BATCH_ID = Et(a.BATCH_ID, t, c.offset, l);
1598
1604
  const e = f.BATCH_ID.array && f.BATCH_ID.array.buffer;
1599
1605
  e && o.indexOf(e) < 0 && o.push(e);
1600
1606
  }
@@ -1665,26 +1671,26 @@
1665
1671
  }
1666
1672
  ct(t) {
1667
1673
  const e = t.length / 2, n = new Float32Array(3 * e), r = [];
1668
- for (let s = 0; s < e; s++) Qt(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
1674
+ for (let s = 0; s < e; s++) ee(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
1669
1675
  n[3 * s + 1] = r[1], n[3 * s + 2] = r[2];
1670
1676
  return n;
1671
1677
  }
1672
1678
  at(t, e, n) {
1673
- return Lt(new Float32Array(t.length), t, e, n);
1679
+ return Ut(new Float32Array(t.length), t, e, n);
1674
1680
  }
1675
1681
  rt() {
1676
1682
  return null;
1677
1683
  }
1678
1684
  }
1679
- function Qt(t, e, n, r) {
1680
- if (t[0] = te(e, r), t[1] = te(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
1685
+ function ee(t, e, n, r) {
1686
+ if (t[0] = ne(e, r), t[1] = ne(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
1681
1687
  t[2] < 0) {
1682
1688
  const e = t[0];
1683
- t[0] = (1 - Math.abs(t[1])) * ee(e), t[1] = (1 - Math.abs(e)) * ee(t[1]);
1689
+ t[0] = (1 - Math.abs(t[1])) * re(e), t[1] = (1 - Math.abs(e)) * re(t[1]);
1684
1690
  }
1685
1691
  return l(t, t);
1686
1692
  }
1687
- function te(t, e) {
1693
+ function ne(t, e) {
1688
1694
  return function(t, e, n) {
1689
1695
  return t < e ? e : t > n ? n : t;
1690
1696
  }(t, 0, e = function(t, e) {
@@ -1692,10 +1698,10 @@
1692
1698
  return e;
1693
1699
  }(e, 255)) / e * 2 - 1;
1694
1700
  }
1695
- function ee(t) {
1701
+ function re(t) {
1696
1702
  return t < 0 ? -1 : 1;
1697
1703
  }
1698
- class ne {
1704
+ class se {
1699
1705
  constructor() {}
1700
1706
  load(t, e, n = 0, r = 0) {
1701
1707
  return e ? (r || (r = e.byteLength), this.et(t, e, n, r)) : z.getArrayBuffer(t, {}).then(e => {
@@ -1728,7 +1734,7 @@
1728
1734
  error: t
1729
1735
  };
1730
1736
  }
1731
- const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Bt(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
1737
+ const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Ct(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
1732
1738
  let m, y = {};
1733
1739
  if (a.extensions && a.extensions["3DTILES_draco_point_compression"]) {
1734
1740
  y = a.extensions["3DTILES_draco_point_compression"], m = new DataView(t, y.byteOffset + c.offset, y.byteLength);
@@ -1736,7 +1742,7 @@
1736
1742
  attributes: y.properties,
1737
1743
  useUniqueIDs: !1
1738
1744
  };
1739
- return this.ut || (this.ut = Wt.draco()), this.ut(m, e).then(e => {
1745
+ return this.ut || (this.ut = Yt.draco()), this.ut(m, e).then(e => {
1740
1746
  const n = e.attributes;
1741
1747
  !a.POSITION && !a.POSITION_QUANTIZED || n.POSITION || n.POSITION_QUANTIZED || (n.POSITION = a.POSITION,
1742
1748
  n.POSITION_QUANTIZED = a.POSITION_QUANTIZED), !(a.RGB || a.RGBA || a.RGB565) || n.RGB || n.RGBA || n.RGB565 || (n.RGB = a.RGB,
@@ -1750,11 +1756,11 @@
1750
1756
  byteOffset: 0,
1751
1757
  itemSize: 1,
1752
1758
  count: t.length,
1753
- componentType: Pt(t.constructor),
1759
+ componentType: Bt(t.constructor),
1754
1760
  array: t
1755
1761
  }, o.push(t.buffer);
1756
1762
  } else if (a.BATCH_ID || Object.keys(h).length) {
1757
- a.BATCH_ID ? r.BATCH_ID = It(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = re(d);
1763
+ a.BATCH_ID ? r.BATCH_ID = Et(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = ie(d);
1758
1764
  const e = r.BATCH_ID.array && r.BATCH_ID.array.buffer;
1759
1765
  e && o.indexOf(e) < 0 && o.push(e);
1760
1766
  }
@@ -1770,7 +1776,7 @@
1770
1776
  }
1771
1777
  const b = this.ft(t, a, c.offset, d, o, f, l);
1772
1778
  if (a.BATCH_ID || Object.keys(h).length) {
1773
- a.BATCH_ID ? b.BATCH_ID = It(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = re(d);
1779
+ a.BATCH_ID ? b.BATCH_ID = Et(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = ie(d);
1774
1780
  const e = b.BATCH_ID.array && b.BATCH_ID.array.buffer;
1775
1781
  e && o.indexOf(e) < 0 && o.push(e);
1776
1782
  }
@@ -1899,13 +1905,13 @@
1899
1905
  return a;
1900
1906
  }
1901
1907
  at(t, e, n) {
1902
- return Lt(new Float32Array(t.length), t, e, n);
1908
+ return Ut(new Float32Array(t.length), t, e, n);
1903
1909
  }
1904
1910
  rt() {
1905
1911
  return null;
1906
1912
  }
1907
1913
  }
1908
- function re(t) {
1914
+ function ie(t) {
1909
1915
  const e = (n = t) < 256 ? Uint8Array : n < 65536 ? Uint16Array : Uint32Array;
1910
1916
  var n;
1911
1917
  const r = new e(t);
@@ -1915,13 +1921,13 @@
1915
1921
  byteOffset: 0,
1916
1922
  itemSize: 1,
1917
1923
  count: t,
1918
- componentType: Pt(e),
1924
+ componentType: Bt(e),
1919
1925
  array: r
1920
1926
  };
1921
1927
  }
1922
- class se {
1928
+ class oe {
1923
1929
  constructor(t, e) {
1924
- this.i = t, this.Y = e || st;
1930
+ this.i = t, this.Y = e || ot;
1925
1931
  }
1926
1932
  load(t, e, n = 0, r = 0) {
1927
1933
  return e ? this.et(t, e, n, r) : z.getArrayBuffer(t, {}).then(e => {
@@ -1934,12 +1940,12 @@
1934
1940
  const s = this.lt(e, t, n, r), i = [];
1935
1941
  for (let n = 0; n < s.length; n++) {
1936
1942
  let r;
1937
- if ("b3dm" === s[n].magic) r = new Zt(this.i, this.Y); else if ("i3dm" === s[n].magic) r = new Yt(this.i, this.Y); else if ("pnts" === s[n].magic) r = new ne; else {
1943
+ if ("b3dm" === s[n].magic) r = new Qt(this.i, this.Y); else if ("i3dm" === s[n].magic) r = new te(this.i, this.Y); else if ("pnts" === s[n].magic) r = new se; else {
1938
1944
  if ("cmpt" !== s[n].magic) {
1939
1945
  console.warn("Unsupported magic in CMPT tile:", s[n].magic);
1940
1946
  continue;
1941
1947
  }
1942
- r = new se(this.i, this.Y);
1948
+ r = new oe(this.i, this.Y);
1943
1949
  }
1944
1950
  i.push(r.load(t, e, s[n].offset, s[n].byteLength).then(t => t));
1945
1951
  }
@@ -1960,7 +1966,7 @@
1960
1966
  const o = [], a = s.getUint32(12, !0);
1961
1967
  let c = 16;
1962
1968
  for (let e = 0; e < a; e++) {
1963
- const e = At(s, c), r = s.getUint32(c + 8, !0);
1969
+ const e = vt(s, c), r = s.getUint32(c + 8, !0);
1964
1970
  o.push({
1965
1971
  magic: e,
1966
1972
  buffer: t,
@@ -1971,17 +1977,17 @@
1971
1977
  return o;
1972
1978
  }
1973
1979
  }
1974
- function ie(t, e) {
1980
+ function ae(t, e) {
1975
1981
  if (t.scenes && t.scenes.length) for (let n = 0, r = t.scenes.length; n < r; n++) {
1976
1982
  const r = t.scenes[n].nodes;
1977
1983
  for (let n = 0, s = r.length; n < s; n++) {
1978
1984
  const s = [];
1979
- oe(r[n], s, t, e);
1985
+ ce(r[n], s, t, e);
1980
1986
  }
1981
1987
  }
1982
1988
  }
1983
- function oe(t, e, n, r) {
1984
- if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) oe(t.children[s], e, n, r);
1989
+ function ce(t, e, n, r) {
1990
+ if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) ce(t.children[s], e, n, r);
1985
1991
  if (void 0 !== t.mesh) {
1986
1992
  const s = t.mesh, i = n.meshes[s];
1987
1993
  if (i) {
@@ -1993,9 +1999,9 @@
1993
1999
  }
1994
2000
  }
1995
2001
  }
1996
- function ae(t, e) {
2002
+ function he(t, e) {
1997
2003
  let {componentType: n, byteOffset: r, byteStride: s, count: i, itemSize: o} = t;
1998
- const a = t.array.buffer, c = n ? st.getTypedArrayCtor(n) : t.array.constructor;
2004
+ const a = t.array.buffer, c = n ? ot.getTypedArrayCtor(n) : t.array.constructor;
1999
2005
  if (r = void 0 === r ? t.array.byteOffset : r, s = s || 0, i = i || t.array.length / o,
2000
2006
  (!s || s === o * c.BYTES_PER_ELEMENT) && r % c.BYTES_PER_ELEMENT == 0) {
2001
2007
  const t = new c(a, r, i * o);
@@ -2012,27 +2018,27 @@
2012
2018
  e(new c(h.buffer), t), n.set(h);
2013
2019
  }
2014
2020
  }
2015
- const ce = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], he = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], ue = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
2016
- let fe, le = !1;
2021
+ const ue = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], fe = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], le = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
2022
+ let de, me = !1;
2017
2023
  if ("undefined" != typeof OffscreenCanvas) {
2018
2024
  try {
2019
- fe = new OffscreenCanvas(2, 2).getContext("2d");
2025
+ de = new OffscreenCanvas(2, 2).getContext("2d");
2020
2026
  } catch (t) {}
2021
- fe && "undefined" != typeof createImageBitmap && (le = !0);
2027
+ de && "undefined" != typeof createImageBitmap && (me = !0);
2022
2028
  }
2023
- const de = n([]), me = [ 0, 0, 0 ], ye = [], be = [];
2024
- class pe {
2029
+ const ye = n([]), be = [ 0, 0, 0 ], pe = [], we = [];
2030
+ class _e {
2025
2031
  constructor(t, e, n, r) {
2026
2032
  this.id = t, this.options = e, this.dt = this.requestImage.bind(this), this.yt = n,
2027
2033
  this.bt = {}, r(null, {}, []);
2028
2034
  }
2029
2035
  pt(t) {
2030
- this.wt || (this._t = new ne, this.wt = new Zt(this.dt, st, t), this.gt = new Yt(this.dt, st, t));
2036
+ this.wt || (this._t = new se, this.wt = new Qt(this.dt, ot, t), this.gt = new te(this.dt, ot, t));
2031
2037
  }
2032
2038
  requestImage(t, e) {
2033
- le ? fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
2034
- (void 0).width = t.width, (void 0).height = t.height, fe.drawImage(t, 0, 0);
2035
- const n = fe.getImageData(0, 0, (void 0).width, (void 0).height);
2039
+ me ? fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
2040
+ (void 0).width = t.width, (void 0).height = t.height, de.drawImage(t, 0, 0);
2041
+ const n = de.getImageData(0, 0, (void 0).width, (void 0).height);
2036
2042
  e(null, {
2037
2043
  width: t.width,
2038
2044
  height: t.height,
@@ -2047,14 +2053,14 @@
2047
2053
  const n = t.url, r = t.arraybuffer;
2048
2054
  if (r) {
2049
2055
  delete this.bt[n];
2050
- const s = At(new DataView(r), 0);
2056
+ const s = vt(new DataView(r), 0);
2051
2057
  if ("{" === s[0] || " " === s[0]) {
2052
2058
  const t = function(t, e, n) {
2053
- if (ue) {
2059
+ if (le) {
2054
2060
  const r = new Uint8Array(t, e, n);
2055
- return ue.decode(r);
2061
+ return le.decode(r);
2056
2062
  }
2057
- return lt(new Uint8Array(t, e, n));
2063
+ return mt(new Uint8Array(t, e, n));
2058
2064
  }(r, 0, r.byteLength), n = JSON.parse(t);
2059
2065
  e(null, n);
2060
2066
  } else if ("b3dm" === s) {
@@ -2078,7 +2084,7 @@
2078
2084
  e(null, r, i);
2079
2085
  });
2080
2086
  } else if ("cmpt" === s) {
2081
- new se(this.dt, st).load(n, r).then(n => {
2087
+ new oe(this.dt, ot).load(n, r).then(n => {
2082
2088
  const {content: r, transferables: s} = this.Ot(n, t);
2083
2089
  e(null, r, s);
2084
2090
  }).catch(t => {
@@ -2107,13 +2113,13 @@
2107
2113
  const {magic: i} = n[t];
2108
2114
  if ("b3dm" === i) {
2109
2115
  const {content: i, transferables: o} = this.Tt(n[t], e);
2110
- ge(s, o), r.content.push(i);
2116
+ Ae(s, o), r.content.push(i);
2111
2117
  } else if ("i3dm" === i || "pnts" === i) {
2112
2118
  const {transform: i, rootIdx: o} = e, {content: a, transferables: c} = this.At(n[t], i, o);
2113
- ge(s, c), r.content.push(a);
2119
+ Ae(s, c), r.content.push(a);
2114
2120
  } else if ("cmpt" === i) {
2115
2121
  const {content: i, transferables: o} = this.Ot(n[t], e);
2116
- ge(s, o), r.content.push(i);
2122
+ Ae(s, o), r.content.push(i);
2117
2123
  }
2118
2124
  }
2119
2125
  return {
@@ -2134,8 +2140,8 @@
2134
2140
  let i = r && r.RTC_CENTER || [ 0, 0, 0 ];
2135
2141
  if (r.EAST_NORTH_UP && !s.NORMAL_UP && !s.NORMAL_UP_OCT32P) {
2136
2142
  const e = new Float32Array(3 * s.POSITION.array.length), n = [], r = [], o = [];
2137
- ae(s.POSITION, (t, s) => {
2138
- h(o, t, i), Vt(o, null, n), function(t, e) {
2143
+ he(s.POSITION, (t, s) => {
2144
+ h(o, t, i), Ht(o, null, n), function(t, e) {
2139
2145
  t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[4], t[4] = e[5], t[5] = e[6], t[6] = e[8],
2140
2146
  t[7] = e[9], t[8] = e[10];
2141
2147
  }(r, n);
@@ -2159,17 +2165,19 @@
2159
2165
  hmin: 1 / 0,
2160
2166
  hmax: -1 / 0
2161
2167
  };
2162
- we(s.POSITION.array, 3, i, de, o);
2163
- const c = _e(o), u = a([], c);
2164
- ae(s.POSITION, t => {
2165
- t[0] = t[0] + i[0] - u[0], t[1] = t[1] + i[1] - u[1], t[2] = t[2] + i[2] - u[2];
2166
- }), e && y(c, c, e);
2167
- const f = this.Mt(c);
2168
- t.rtcCenter = u, t.rtcCoord = f, t.rootIdx = n;
2169
- const l = t.transferables;
2168
+ ge(s.POSITION.array, 3, i, ye, o);
2169
+ const c = Te(o), u = a([], c), f = [ 1 / 0, 1 / 0, 1 / 0 ], l = [ -1 / 0, -1 / 0, -1 / 0 ];
2170
+ he(s.POSITION, t => {
2171
+ t[0] = t[0] + i[0] - u[0], t[1] = t[1] + i[1] - u[1], t[2] = t[2] + i[2] - u[2],
2172
+ t[0] < f[0] && (f[0] = t[0]), t[1] < f[1] && (f[1] = t[1]), t[2] < f[2] && (f[2] = t[2]),
2173
+ t[0] > l[0] && (l[0] = t[0]), t[1] > l[1] && (l[1] = t[1]), t[2] > l[2] && (l[2] = t[2]);
2174
+ }), s.POSITION.min = f, s.POSITION.max = l, e && y(c, c, e);
2175
+ const d = this.Mt(c);
2176
+ t.rtcCenter = u, t.rtcCoord = d, t.rootIdx = n;
2177
+ const m = t.transferables;
2170
2178
  return delete t.transferables, {
2171
2179
  content: t,
2172
- transferables: l
2180
+ transferables: m
2173
2181
  };
2174
2182
  }
2175
2183
  vt(t) {
@@ -2193,8 +2201,8 @@
2193
2201
  n && n.abort(), delete this.bt[t.url], e(null);
2194
2202
  }
2195
2203
  convertCoordinates(t, e, s, i) {
2196
- let o = e && e.RTC_CENTER || t.extensions && t.extensions.CESIUM_RTC && t.extensions.CESIUM_RTC.center, c = ce;
2197
- "X" === (s = s && s.toUpperCase()) ? c = he : "Z" === s && (c = de), t.extensions = t.extensions || {},
2204
+ let o = e && e.RTC_CENTER || t.extensions && t.extensions.CESIUM_RTC && t.extensions.CESIUM_RTC.center, c = ue;
2205
+ "X" === (s = s && s.toUpperCase()) ? c = fe : "Z" === s && (c = ye), t.extensions = t.extensions || {},
2198
2206
  t.extensions.CESIUM_RTC || (t.extensions.CESIUM_RTC = {}), o && (t.extensions.CESIUM_RTC.center = o);
2199
2207
  const h = {
2200
2208
  xmin: 1 / 0,
@@ -2204,19 +2212,19 @@
2204
2212
  hmin: 1 / 0,
2205
2213
  hmax: -1 / 0
2206
2214
  };
2207
- ie(t, t => {
2215
+ ae(t, t => {
2208
2216
  if (!(t.attributes && t.attributes.POSITION)) return;
2209
- const e = n(ye);
2217
+ const e = n(pe);
2210
2218
  if (t.matrices) for (let n = t.matrices.length - 1; n >= 0; n--) r(e, e, t.matrices[n]);
2211
2219
  const s = t.attributes.POSITION.array, i = t.attributes.POSITION.itemSize;
2212
- r(e, c, e), we(s, i, o || me, e, h);
2220
+ r(e, c, e), ge(s, i, o || be, e, h);
2213
2221
  });
2214
- const u = _e(h), f = a([], u);
2215
- i && y(u, u, i), t.extensions.CESIUM_RTC.coord = this.Mt(u), o || (ie(t, t => {
2222
+ const u = Te(h), f = a([], u);
2223
+ i && y(u, u, i), t.extensions.CESIUM_RTC.coord = this.Mt(u), o || (ae(t, t => {
2216
2224
  if (t.attributes && t.attributes.POSITION) {
2217
2225
  const e = t.attributes.POSITION;
2218
2226
  if (e.array.buffer.projected && e.array.buffer.projected[e.byteOffset]) return;
2219
- const s = n(ye);
2227
+ const s = n(pe);
2220
2228
  if (t.matrices) for (let e = t.matrices.length - 1; e >= 0; e--) r(s, s, t.matrices[e]);
2221
2229
  r(s, c, s);
2222
2230
  const i = function(t, e) {
@@ -2227,19 +2235,22 @@
2227
2235
  t[8] = (o * I - a * S + h * v) * E, t[9] = (r * S - n * I - i * v) * E, t[10] = (m * A - y * g + p * w) * E,
2228
2236
  t[11] = (f * g - u * A - d * w) * E, t[12] = (a * M - o * x - c * v) * E, t[13] = (n * x - r * M + s * v) * E,
2229
2237
  t[14] = (y * _ - m * T - b * w) * E, t[15] = (u * T - f * _ + l * w) * E, t) : null;
2230
- }(be, s);
2231
- ae(e, t => {
2232
- y(t, t, s), t[0] = t[0] - f[0], t[1] = t[1] - f[1], t[2] = t[2] - f[2], y(t, t, i);
2233
- }), e.array.buffer.projected || (e.array.buffer.projected = {}), e.array.buffer.projected[e.byteOffset] = 1;
2238
+ }(we, s), o = [ 1 / 0, 1 / 0, 1 / 0 ], a = [ -1 / 0, -1 / 0, -1 / 0 ];
2239
+ he(e, t => {
2240
+ y(t, t, s), t[0] = t[0] - f[0], t[1] = t[1] - f[1], t[2] = t[2] - f[2], y(t, t, i),
2241
+ t[0] < o[0] && (o[0] = t[0]), t[1] < o[1] && (o[1] = t[1]), t[2] < o[2] && (o[2] = t[2]),
2242
+ t[0] > a[0] && (a[0] = t[0]), t[1] > a[1] && (a[1] = t[1]), t[2] > a[2] && (a[2] = t[2]);
2243
+ }), e.min = o, e.max = a, e.array.buffer.projected || (e.array.buffer.projected = {}),
2244
+ e.array.buffer.projected[e.byteOffset] = 1;
2234
2245
  }
2235
2246
  }), t.extensions.CESIUM_RTC.center = f);
2236
2247
  }
2237
2248
  Mt(t) {
2238
- return 0 === w(t) ? c([], 0, 0, -6378137) : wt([], t);
2249
+ return 0 === w(t) ? c([], 0, 0, -6378137) : gt([], t);
2239
2250
  }
2240
2251
  onRemove() {}
2241
2252
  }
2242
- function we(t, e, n, r, s) {
2253
+ function ge(t, e, n, r, s) {
2243
2254
  const i = [];
2244
2255
  for (let o = 0, a = t.length; o < a; o += e) {
2245
2256
  const {xmin: a, ymin: u, xmax: f, ymax: l, hmin: d, hmax: m} = s;
@@ -2249,23 +2260,23 @@
2249
2260
  b[1] > l && (s.ymax = b[1]), e > 2 && (b[2] < d && (s.hmin = b[2]), b[2] > m && (s.hmax = b[2]));
2250
2261
  }
2251
2262
  }
2252
- function _e(t) {
2263
+ function Te(t) {
2253
2264
  const {xmax: e, ymax: n, xmin: r, ymin: s, hmin: i, hmax: o} = t, a = [ (r + e) / 2, (s + n) / 2, (i + o) / 2 ];
2254
2265
  return e === -1 / 0 && (a[0] = 0), n === -1 / 0 && (a[1] = 0), o === -1 / 0 && (a[2] = 0),
2255
2266
  isNaN(a[2]) && (a[2] = 0), a;
2256
2267
  }
2257
- function ge(t, e) {
2268
+ function Ae(t, e) {
2258
2269
  for (let n = 0; n < e.length; n++) t.indexOf(e[n]) < 0 && t.push(e[n]);
2259
2270
  }
2260
- let Te = 0;
2261
- class Ae {
2271
+ let Oe = 0;
2272
+ class ve {
2262
2273
  constructor(t) {
2263
2274
  this.workerId = t, this.workers = {}, this.St = {};
2264
2275
  }
2265
2276
  addLayer({actorId: t, mapId: e, layerId: n, params: r}, s) {
2266
2277
  if (this.xt(e, n)) return;
2267
2278
  const i = this.It(e, n), o = r.options, a = this.send.bind(this, t);
2268
- this.workers[i] = new pe(n, o, a, s);
2279
+ this.workers[i] = new _e(n, o, a, s);
2269
2280
  }
2270
2281
  removeLayer({mapId: t, layerId: e}, n) {
2271
2282
  const r = this.xt(t, e), s = this.It(t, e);
@@ -2284,7 +2295,7 @@
2284
2295
  delete this.St[e], n && t.error ? n(new Error(t.error)) : n && n(null, t.data);
2285
2296
  }
2286
2297
  send(t, e, n, r, s) {
2287
- const i = s ? `${t}-${Te++}` : null;
2298
+ const i = s ? `${t}-${Oe++}` : null;
2288
2299
  s && (this.St[i] = s), postMessage({
2289
2300
  type: "<request>",
2290
2301
  workerId: this.workerId,
@@ -2304,7 +2315,7 @@
2304
2315
  }
2305
2316
  t.initialize = function() {}, t.onmessage = function(t, e) {
2306
2317
  const n = t.data;
2307
- this.dispatcher || (this.dispatcher = new Ae(t.workerId)), "<response>" === t.type ? this.dispatcher.workerId === t.workerId && this.dispatcher.receive(t) : this.dispatcher[n.command]({
2318
+ this.dispatcher || (this.dispatcher = new ve(t.workerId)), "<response>" === t.type ? this.dispatcher.workerId === t.workerId && this.dispatcher.receive(t) : this.dispatcher[n.command]({
2308
2319
  actorId: n.actorId,
2309
2320
  mapId: n.mapId,
2310
2321
  layerId: n.layerId,
@@ -2625,19 +2636,19 @@
2625
2636
  getArrayBuffer: (t, e = {}) => (e || (e = {}), e.responseType = "arraybuffer", ft.get(t, e)),
2626
2637
  getJSON: function(t, e = {}) {
2627
2638
  return e && e.jsonp ? ft.jsonp(t) : ((e = e || {}).responseType = "json", ft.get(t, e));
2628
- },
2629
- jsonp: function(t) {
2630
- const e = "_maptalks_jsonp_" + X++;
2631
- t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
2632
- let n = document.createElement("script");
2633
- return n.type = "text/javascript", n.src = t, new Promise(t => {
2634
- window[e] = function(r) {
2635
- document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
2636
- t(r);
2637
- }, document.getElementsByTagName("head")[0].appendChild(n);
2638
- });
2639
2639
  }
2640
2640
  };
2641
+ ft.jsonp = function(t) {
2642
+ const e = "_maptalks_jsonp_" + X++;
2643
+ t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
2644
+ let n = document.createElement("script");
2645
+ return n.type = "text/javascript", n.src = t, new Promise(t => {
2646
+ window[e] = function(r) {
2647
+ document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
2648
+ t(r);
2649
+ }, document.getElementsByTagName("head")[0].appendChild(n);
2650
+ });
2651
+ };
2641
2652
  class lt {
2642
2653
  constructor(t, e, n) {
2643
2654
  this.i = t, this.decoders = e, this.o = n, this.images = {}, this.h = {};
@@ -2678,7 +2689,8 @@
2678
2689
  requestExternalImage(t) {
2679
2690
  if (this.images[t.id]) return Promise.resolve(this.images[t.id]);
2680
2691
  const e = 0 === t.uri.indexOf("data:image/") ? t.uri : this.rootPath + "/" + t.uri;
2681
- return this.h[t.id] ? this.h[t.id].then(() => this.images[t.id]) : this.h[t.id] = this.l(t.id, e);
2692
+ if (this.h[t.id]) return this.h[t.id].then(() => this.images[t.id]);
2693
+ return this.h[t.id] = this.l(t.id, e);
2682
2694
  }
2683
2695
  l(t, e) {
2684
2696
  return new Promise((n, r) => {
@@ -2741,7 +2753,8 @@
2741
2753
  });
2742
2754
  }
2743
2755
  g(t, e, n, r = 0) {
2744
- const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.A(i.type), h = Q(i.componentType), u = o.byteStride || 0, f = {
2756
+ const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.A(i.type), h = Q(i.componentType), u = o.byteStride || 0;
2757
+ const f = {
2745
2758
  array: void 0,
2746
2759
  name: t,
2747
2760
  accessorName: e,
@@ -2855,7 +2868,7 @@
2855
2868
  r.instanceTechnique && r.instanceTechnique.values ? (s = r.instanceTechnique, i = s.values.diffuse) : (s = r,
2856
2869
  i = s.values.tex || s.values.diffuseTex || s.values.diffuse);
2857
2870
  const o = {
2858
- baseColorTexture: {
2871
+ "baseColorTexture": {
2859
2872
  index: i
2860
2873
  }
2861
2874
  };
@@ -2976,7 +2989,8 @@
2976
2989
  N(t, e) {
2977
2990
  const n = new Array(t.byteLength);
2978
2991
  for (let e = 0; e < t.byteLength; e++) n[e] = String.fromCharCode(t[e]);
2979
- return n.join(""), "data:" + (e = e || "image/png") + ";base64," + function(t) {
2992
+ n.join("");
2993
+ return "data:" + (e = e || "image/png") + ";base64," + function(t) {
2980
2994
  return "undefined" != typeof self ? self.btoa(t) : window.btoa(t);
2981
2995
  }(unescape(encodeURIComponent(n)));
2982
2996
  }
@@ -3000,19 +3014,19 @@
3000
3014
  });
3001
3015
  }
3002
3016
  }
3003
- const pt = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
3004
- class wt {
3017
+ const pt = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null, wt = 1313821514, _t = 5130562;
3018
+ class gt {
3005
3019
  static read(t, e = 0, n = 0) {
3006
3020
  n || (n = t.byteLength);
3007
3021
  const r = new DataView(t, e, n), s = r.getUint32(4, !0);
3008
- if (1 === s) return wt.readV1(r, e);
3009
- if (2 === s) return wt.readV2(t, e);
3022
+ if (1 === s) return gt.readV1(r, e);
3023
+ if (2 === s) return gt.readV2(t, e);
3010
3024
  throw new Error("Unsupported glb version : " + s);
3011
3025
  }
3012
3026
  static readV1(t, e) {
3013
3027
  const n = t.getUint32(8, !0), r = t.getUint32(12, !0);
3014
3028
  if (n !== t.byteLength) throw new Error("Length in GLB header is inconsistent with glb's byte length.");
3015
- const s = _t(t.buffer, 20 + e, r);
3029
+ const s = Tt(t.buffer, 20 + e, r);
3016
3030
  return {
3017
3031
  json: JSON.parse(s),
3018
3032
  glbBuffer: {
@@ -3030,7 +3044,7 @@
3030
3044
  const a = i.getUint32(o, !0);
3031
3045
  o += 4;
3032
3046
  const c = i.getUint32(o, !0);
3033
- if (o += 4, 1313821514 === c) n = _t(t, e + 12 + o, a); else if (5130562 === c) {
3047
+ if (o += 4, c === wt) n = Tt(t, e + 12 + o, a); else if (c === _t) {
3034
3048
  s = e + 12 + o, r = a;
3035
3049
  break;
3036
3050
  }
@@ -3046,7 +3060,7 @@
3046
3060
  };
3047
3061
  }
3048
3062
  }
3049
- function _t(t, e, n) {
3063
+ function Tt(t, e, n) {
3050
3064
  if (pt) {
3051
3065
  const r = new Uint8Array(t, e, n);
3052
3066
  return pt.decode(r);
@@ -3057,7 +3071,7 @@
3057
3071
  for (let r = 0; r < e; ) {
3058
3072
  let s = t[r++];
3059
3073
  if (128 & s) {
3060
- let n = gt[s >> 3 & 7];
3074
+ let n = At[s >> 3 & 7];
3061
3075
  if (!(64 & s) || !n || r + n > e) return null;
3062
3076
  for (s &= 63 >> n; n > 0; n -= 1) {
3063
3077
  const e = t[r++];
@@ -3070,17 +3084,18 @@
3070
3084
  return n;
3071
3085
  }(new Uint8Array(t, e, n));
3072
3086
  }
3073
- const gt = [ 1, 1, 1, 1, 2, 2, 3, 0 ], Tt = [ 0, 0, 0 ], At = [ 0, 0, 0, 1 ], Ot = [ 1, 1, 1 ], vt = {
3087
+ const At = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
3088
+ const Ot = [ 0, 0, 0 ], vt = [ 0, 0, 0, 1 ], Mt = [ 1, 1, 1 ], St = {
3074
3089
  TRANSLATION: [ 0, 0, 0 ],
3075
3090
  ROTATION: [ 0, 0, 0, 1 ],
3076
3091
  SCALE: [ 1, 1, 1 ]
3077
- }, Mt = {
3092
+ }, xt = {
3078
3093
  PREVIOUS: null,
3079
3094
  NEXT: null,
3080
3095
  PREINDEX: null,
3081
3096
  NEXTINDEX: null,
3082
3097
  INTERPOLATION: null
3083
- }, St = {
3098
+ }, It = {
3084
3099
  P(t, e, n, r, s, i, o, a) {
3085
3100
  const c = Z(t) ? e.animations : [ e.animations[0] ], h = {};
3086
3101
  for (let e = 0; e < c.length; e++) {
@@ -3089,9 +3104,9 @@
3089
3104
  const f = u.channelsMap[n];
3090
3105
  if (f) for (let t = 0; t < f.length; t++) {
3091
3106
  const e = f[t];
3092
- "translation" === e.target.path ? (this.L(s, u.samplers[e.sampler], r, 1), h.translation = B(Tt, s)) : "rotation" === e.target.path ? (this.B(i, u.samplers[e.sampler], r, 1),
3093
- h.rotation = K(At, i)) : "scale" === e.target.path ? (this.L(o, u.samplers[e.sampler], r, 1),
3094
- h.scale = B(Ot, o)) : "weights" === e.target.path && a && (this.L(a, u.samplers[e.sampler], r, a.length),
3107
+ "translation" === e.target.path ? (this.L(s, u.samplers[e.sampler], r, 1), h.translation = B(Ot, s)) : "rotation" === e.target.path ? (this.B(i, u.samplers[e.sampler], r, 1),
3108
+ h.rotation = K(vt, i)) : "scale" === e.target.path ? (this.L(o, u.samplers[e.sampler], r, 1),
3109
+ h.scale = B(Mt, o)) : "weights" === e.target.path && a && (this.L(a, u.samplers[e.sampler], r, a.length),
3095
3110
  h.weights = a);
3096
3111
  }
3097
3112
  }
@@ -3101,7 +3116,7 @@
3101
3116
  switch (e.interpolation) {
3102
3117
  case "LINEAR":
3103
3118
  {
3104
- const s = this.U(Mt, e, n, 1 * r);
3119
+ const s = this.U(xt, e, n, 1 * r);
3105
3120
  s && (t = function(t, e, n, r) {
3106
3121
  for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
3107
3122
  return t;
@@ -3111,7 +3126,7 @@
3111
3126
 
3112
3127
  case "STEP":
3113
3128
  {
3114
- const s = this.U(Mt, e, n, 1 * r);
3129
+ const s = this.U(xt, e, n, 1 * r);
3115
3130
  s && (t = function(t, e) {
3116
3131
  for (let n = 0; n < t.length; n++) t[n] = e[n];
3117
3132
  return t;
@@ -3121,7 +3136,7 @@
3121
3136
 
3122
3137
  case "CUBICSPLINE":
3123
3138
  {
3124
- const s = this.U(Mt, e, n, 3 * r);
3139
+ const s = this.U(xt, e, n, 3 * r);
3125
3140
  s && (t = this.C(t, s, e.input.array, 3 * r));
3126
3141
  break;
3127
3142
  }
@@ -3132,21 +3147,21 @@
3132
3147
  switch (e.interpolation) {
3133
3148
  case "LINEAR":
3134
3149
  {
3135
- const r = this.U(Mt, e, n, 1);
3150
+ const r = this.U(xt, e, n, 1);
3136
3151
  r && $(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
3137
3152
  break;
3138
3153
  }
3139
3154
 
3140
3155
  case "STEP":
3141
3156
  {
3142
- const r = this.U(Mt, e, n, 1);
3157
+ const r = this.U(xt, e, n, 1);
3143
3158
  r && (t = H(t, ...r.PREVIOUS));
3144
3159
  break;
3145
3160
  }
3146
3161
 
3147
3162
  case "CUBICSPLINE":
3148
3163
  {
3149
- const r = this.U(Mt, e, n, 3);
3164
+ const r = this.U(xt, e, n, 3);
3150
3165
  if (r) {
3151
3166
  for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
3152
3167
  r.NEXT[t] = Math.acos(r.NEXT[t]);
@@ -3197,7 +3212,8 @@
3197
3212
  },
3198
3213
  getAnimationClip(t, e, n, r) {
3199
3214
  const s = t.nodes[e] && t.nodes[e].weights;
3200
- return U(Tt, ...vt.TRANSLATION), H(At, ...vt.ROTATION), U(Ot, ...vt.SCALE), this.P(r, t, e, n, Tt, At, Ot, s);
3215
+ U(Ot, ...St.TRANSLATION), H(vt, ...St.ROTATION), U(Mt, ...St.SCALE);
3216
+ return this.P(r, t, e, n, Ot, vt, Mt, s);
3201
3217
  },
3202
3218
  getTimeSpan(t) {
3203
3219
  if (!t.animations) return null;
@@ -3222,20 +3238,20 @@
3222
3238
  return n ? Z(e) ? n[e] : n[Object.keys(n)[0]] : null;
3223
3239
  }
3224
3240
  };
3225
- let xt = !1;
3241
+ let Nt = !1;
3226
3242
  if ("undefined" != typeof OffscreenCanvas) {
3227
3243
  let t;
3228
3244
  try {
3229
3245
  t = new OffscreenCanvas(2, 2).getContext("2d");
3230
- } catch (zn) {}
3231
- t && "undefined" != typeof createImageBitmap && (xt = !0);
3246
+ } catch (t) {}
3247
+ t && "undefined" != typeof createImageBitmap && (Nt = !0);
3232
3248
  }
3233
- const It = "undefined" == typeof document ? null : document.createElement("canvas");
3234
- class Nt {
3249
+ const Et = "undefined" == typeof document ? null : document.createElement("canvas");
3250
+ class Pt {
3235
3251
  constructor(t, e, n) {
3236
3252
  if (this.options = n || {}, this.options.decoders || (this.options.decoders = {}),
3237
3253
  e.buffer instanceof ArrayBuffer) {
3238
- const {json: n, glbBuffer: r} = wt.read(e.buffer, e.byteOffset, e.byteLength);
3254
+ const {json: n, glbBuffer: r} = gt.read(e.buffer, e.byteOffset, e.byteLength);
3239
3255
  this.F(t, n, r);
3240
3256
  } else this.F(t, e);
3241
3257
  this.D = new mt(this.rootPath, this.gltf, this.glbBuffer), this.k();
@@ -3286,10 +3302,10 @@
3286
3302
  return t;
3287
3303
  }
3288
3304
  static getAnimationClip(t, e, n, r) {
3289
- return St.getAnimationClip(t, e, n, r);
3305
+ return It.getAnimationClip(t, e, n, r);
3290
3306
  }
3291
3307
  static getAnimationTimeSpan(t, e) {
3292
- return St.getTimeSpanByName(t, e);
3308
+ return It.getTimeSpanByName(t, e);
3293
3309
  }
3294
3310
  static getTypedArrayCtor(t) {
3295
3311
  return Q(t);
@@ -3299,7 +3315,7 @@
3299
3315
  }
3300
3316
  F(t, e, n) {
3301
3317
  this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
3302
- this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = xt ? Bt : this.options.requestImage || Et,
3318
+ this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = Nt ? Ct : this.options.requestImage || Lt,
3303
3319
  this.options.transferable && (this.transferables = []), 2 === this.version ? (this.adapter = new bt(t, e, n, this.options.requestImage, this.options.decoders || {}, this.options.supportedFormats || {}),
3304
3320
  this.adapter.iterate((t, e, n) => {
3305
3321
  e.id = "buffer_" + n;
@@ -3316,7 +3332,7 @@
3316
3332
  }
3317
3333
  q(t, e) {
3318
3334
  if (t.children && t.children.length > 0) {
3319
- if (!("number" == typeof (n = t.children[0]) && isFinite(n) || function(t) {
3335
+ if (!(n = t.children[0], "number" == typeof n && isFinite(n) || function(t) {
3320
3336
  return !W(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
3321
3337
  }(t.children[0]))) return t;
3322
3338
  const r = t.children.map(t => {
@@ -3461,11 +3477,13 @@
3461
3477
  attributes: e.reduce((t, e) => {
3462
3478
  if ("indices" === e.name) n = e; else if (e.name.indexOf("morphTargets_") > -1) r = r || {},
3463
3479
  r[e.name.slice(13)] = e; else {
3464
- if (!("POSITION" !== e.name || e.min && e.max)) {
3465
- const t = [ 1 / 0, 1 / 0, 1 / 0 ], n = [ -1 / 0, -1 / 0, -1 / 0 ], {itemSize: r, array: s} = e, i = s.length / r;
3466
- for (let e = 0; e < i; e++) for (let i = 0; i < r; i++) {
3467
- const o = e * r + i;
3468
- s[o] < t[i] && (t[i] = s[o]), s[o] > n[i] && (n[i] = s[o]);
3480
+ if ("POSITION" === e.name) {
3481
+ const t = [ 1 / 0, 1 / 0, 1 / 0 ], n = [ -1 / 0, -1 / 0, -1 / 0 ], {itemSize: r, array: s} = e;
3482
+ s.length, U(t, s[0], s[1], s[2]), U(n, s[0], s[1], s[2]);
3483
+ for (let e = 3; e < s.length; ) {
3484
+ const r = s[e++], i = s[e++], o = s[e++];
3485
+ r < t[0] && (t[0] = r), i < t[1] && (t[1] = i), o < t[2] && (t[2] = o), r > n[0] && (n[0] = r),
3486
+ i > n[1] && (n[1] = i), o > n[2] && (n[2] = o);
3469
3487
  }
3470
3488
  e.min = t, e.max = n;
3471
3489
  }
@@ -3481,12 +3499,12 @@
3481
3499
  });
3482
3500
  }
3483
3501
  }
3484
- function Et(t, e) {
3502
+ function Lt(t, e) {
3485
3503
  const n = new Image;
3486
3504
  n.crossOrigin = "", n.onload = () => {
3487
- if (!It) return void e(new Error("There is no canvas to draw image!"));
3488
- It.width = n.width, It.height = n.height;
3489
- const t = It.getContext("2d");
3505
+ if (!Et) return void e(new Error("There is no canvas to draw image!"));
3506
+ Et.width = n.width, Et.height = n.height;
3507
+ const t = Et.getContext("2d");
3490
3508
  t.drawImage(n, 0, 0, n.width, n.height);
3491
3509
  const r = t.getImageData(0, 0, n.width, n.height), s = {
3492
3510
  width: n.width,
@@ -3498,12 +3516,12 @@
3498
3516
  e(t);
3499
3517
  }, n.src = t;
3500
3518
  }
3501
- let Pt, Lt;
3502
- function Bt(t, e) {
3503
- Pt || (Pt = new OffscreenCanvas(2, 2), Lt = Pt.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
3519
+ let Bt, Ut;
3520
+ function Ct(t, e) {
3521
+ Bt || (Bt = new OffscreenCanvas(2, 2), Ut = Bt.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
3504
3522
  const {width: n, height: r} = t;
3505
- Pt.width = n, Pt.height = r, Lt.drawImage(t, 0, 0), t.close();
3506
- const s = Lt.getImageData(0, 0, n, r);
3523
+ Bt.width = n, Bt.height = r, Ut.drawImage(t, 0, 0), t.close();
3524
+ const s = Ut.getImageData(0, 0, n, r);
3507
3525
  e(null, {
3508
3526
  width: n,
3509
3527
  height: r,
@@ -3513,8 +3531,8 @@
3513
3531
  console.warn(t), e(t);
3514
3532
  });
3515
3533
  }
3516
- const Ut = "undefined" == typeof document ? null : document.createElement("canvas");
3517
- class Ct extends s.worker.Actor {
3534
+ const Rt = "undefined" == typeof document ? null : document.createElement("canvas");
3535
+ class Ft extends s.worker.Actor {
3518
3536
  constructor(t, e) {
3519
3537
  super(t), this.mapId = e;
3520
3538
  }
@@ -3567,20 +3585,20 @@
3567
3585
  const n = new Image;
3568
3586
  n.onload = () => {
3569
3587
  if (!this.isActive()) return;
3570
- if (!Ut) return void e(new Error("There is no canvas to draw image!"));
3588
+ if (!Rt) return void e(new Error("There is no canvas to draw image!"));
3571
3589
  const t = function(t) {
3572
- if (Rt(t.width) && Rt(t.height)) return t;
3590
+ if (Dt(t.width) && Dt(t.height)) return t;
3573
3591
  let e = t.width, n = t.height;
3574
- Rt(e) || (e = Ft(e));
3575
- Rt(n) || (n = Ft(n));
3592
+ Dt(e) || (e = kt(e));
3593
+ Dt(n) || (n = kt(n));
3576
3594
  const r = document.createElement("canvas");
3577
3595
  r.width = e, r.height = n, r.getContext("2d").drawImage(t, 0, 0, e, n);
3578
3596
  const s = t.src, i = s.lastIndexOf("/") + 1, o = s.substring(i);
3579
3597
  return console.warn(`Texture(${o})'s size is not power of two, resize from (${t.width}, ${t.height}) to (${e}, ${n})`),
3580
3598
  r;
3581
3599
  }(n);
3582
- Ut.width = t.width, Ut.height = t.height;
3583
- const r = Ut.getContext("2d");
3600
+ Rt.width = t.width, Rt.height = t.height;
3601
+ const r = Rt.getContext("2d");
3584
3602
  r.drawImage(t, 0, 0, t.width, t.height);
3585
3603
  const s = r.getImageData(0, 0, t.width, t.height), i = {
3586
3604
  width: t.width,
@@ -3593,13 +3611,13 @@
3593
3611
  }, n.src = t;
3594
3612
  }
3595
3613
  }
3596
- function Rt(t) {
3614
+ function Dt(t) {
3597
3615
  return 0 == (t & t - 1) && 0 !== t;
3598
3616
  }
3599
- function Ft(t) {
3617
+ function kt(t) {
3600
3618
  return Math.pow(2, Math.floor(Math.log(t) / Math.LN2));
3601
3619
  }
3602
- class Dt {
3620
+ class zt {
3603
3621
  constructor(t, e) {
3604
3622
  this.max = t, this.currentSize = 0, this.onRemove = e, this.reset();
3605
3623
  }
@@ -3679,17 +3697,17 @@
3679
3697
  for (const n of e) n.current = t;
3680
3698
  }
3681
3699
  }
3682
- function kt(t, e) {
3700
+ function jt(t, e) {
3683
3701
  if (t.scenes && t.scenes.length) for (let n = 0, r = t.scenes.length; n < r; n++) {
3684
3702
  const r = t.scenes[n].nodes;
3685
3703
  for (let n = 0, s = r.length; n < s; n++) {
3686
3704
  const s = [];
3687
- zt(r[n], s, t, e);
3705
+ Vt(r[n], s, t, e);
3688
3706
  }
3689
3707
  }
3690
3708
  }
3691
- function zt(t, e, n, r) {
3692
- if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) zt(t.children[s], e, n, r);
3709
+ function Vt(t, e, n, r) {
3710
+ if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) Vt(t.children[s], e, n, r);
3693
3711
  if (void 0 !== t.mesh) {
3694
3712
  const s = t.mesh, i = n.meshes[s];
3695
3713
  if (i) {
@@ -3701,9 +3719,9 @@
3701
3719
  }
3702
3720
  }
3703
3721
  }
3704
- function jt(t, e, n) {
3722
+ function Gt(t, e, n) {
3705
3723
  let {componentType: r, byteOffset: s, byteStride: i, itemSize: o} = e;
3706
- const a = e.array.buffer, c = r ? Nt.getTypedArrayCtor(r) : e.array.constructor;
3724
+ const a = e.array.buffer, c = r ? Pt.getTypedArrayCtor(r) : e.array.constructor;
3707
3725
  if (s = void 0 === s ? e.array.byteOffset : s, i = i || 0, !i || i === o * c.BYTES_PER_ELEMENT && s % c.BYTES_PER_ELEMENT == 0) {
3708
3726
  const e = new c(a, s + n * o * c.BYTES_PER_ELEMENT, o);
3709
3727
  return t.set(e), t;
@@ -3712,29 +3730,29 @@
3712
3730
  const h = new Uint8Array(a, i * n + s, o * c.BYTES_PER_ELEMENT);
3713
3731
  return new Uint8Array(t.buffer).set(h), t;
3714
3732
  }
3715
- function Vt(t, e, n, r) {
3733
+ function Ht(t, e, n, r) {
3716
3734
  t[4 * e] = n[r], t[4 * e + 1] = n[r + 4], t[4 * e + 2] = n[r + 8], t[4 * e + 3] = n[r + 12];
3717
3735
  }
3718
- const Gt = new Array(3), Ht = new Array(3), qt = [ 40680631590769, 40680631590769, 40408299984661.445 ];
3719
- function $t(t, e, n, r) {
3720
- const s = qt, i = Math.cos(n);
3721
- Gt[0] = i * Math.cos(e), Gt[1] = i * Math.sin(e), Gt[2] = Math.sin(n), ne(Gt, Gt),
3722
- R(Ht, s, Gt);
3723
- const o = Math.sqrt(k(Gt, Ht));
3736
+ const qt = new Array(3), $t = new Array(3), Jt = [ 40680631590769, 40680631590769, 40408299984661.445 ];
3737
+ function Kt(t, e, n, r) {
3738
+ const s = Jt, i = Math.cos(n);
3739
+ qt[0] = i * Math.cos(e), qt[1] = i * Math.sin(e), qt[2] = Math.sin(n), se(qt, qt),
3740
+ R($t, s, qt);
3741
+ const o = Math.sqrt(k(qt, $t));
3724
3742
  var a, c, h;
3725
- return c = Ht, h = o, (a = Ht)[0] = c[0] / h, a[1] = c[1] / h, a[2] = c[2] / h,
3726
- F(Gt, Gt, r), function(t, e, n) {
3743
+ return c = $t, h = o, (a = $t)[0] = c[0] / h, a[1] = c[1] / h, a[2] = c[2] / h,
3744
+ F(qt, qt, r), function(t, e, n) {
3727
3745
  return t[0] = e[0] + n[0], t[1] = e[1] + n[1], t[2] = e[2] + n[2], t;
3728
- }(t, Ht, Gt);
3746
+ }(t, $t, qt);
3729
3747
  }
3730
- const Jt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], Kt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], Xt = new Array(3), Wt = new Array(3), Zt = new Array(3);
3731
- function Yt(t, e) {
3732
- const n = Kt, r = function(t, e, n, r, s) {
3733
- const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], f = i * i * c * c, l = o * o * h * h, d = a * a * u * u, m = f + l + d, y = Math.sqrt(1 / m), b = F(Qt, e, y);
3748
+ const Xt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], Wt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], Zt = new Array(3), Yt = new Array(3), Qt = new Array(3);
3749
+ function te(t, e) {
3750
+ const n = Wt, r = function(t, e, n, r, s) {
3751
+ const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], f = i * i * c * c, l = o * o * h * h, d = a * a * u * u, m = f + l + d, y = Math.sqrt(1 / m), b = F(ee, e, y);
3734
3752
  if (m < s) return isFinite(y) ? b : void 0;
3735
- const p = r[0], w = r[1], _ = r[2], g = te;
3753
+ const p = r[0], w = r[1], _ = r[2], g = ne;
3736
3754
  g[0] = b[0] * p * 2, g[1] = b[1] * w * 2, g[2] = b[2] * _ * 2;
3737
- let T, A, O, v, M, S, x, I, N, E, P, L = (1 - y) * ee(e) / (.5 * ee(g)), B = 0;
3755
+ let T, A, O, v, M, S, x, I, N, E, P, L = (1 - y) * re(e) / (.5 * re(g)), B = 0;
3738
3756
  do {
3739
3757
  L -= B, O = 1 / (1 + L * p), v = 1 / (1 + L * w), M = 1 / (1 + L * _), S = O * O,
3740
3758
  x = v * v, I = M * M, N = S * O, E = x * v, P = I * M, T = f * S + l * x + d * I - 1,
@@ -3742,33 +3760,33 @@
3742
3760
  B = T / (-2 * A);
3743
3761
  } while (Math.abs(T) > 1e-12);
3744
3762
  return t[0] = i * O, t[1] = o * v, t[2] = a * M, t;
3745
- }(Xt, e, Jt, n, .1);
3746
- let s = V(Wt, r, n);
3747
- s = ne(s, s);
3748
- const i = j(Zt, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = _(k(i, e)) * ee(i);
3763
+ }(Zt, e, Xt, n, .1);
3764
+ let s = V(Yt, r, n);
3765
+ s = se(s, s);
3766
+ const i = j(Qt, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = _(k(i, e)) * re(i);
3749
3767
  return t[0] = p(o), t[1] = p(a), t[2] = c, t;
3750
3768
  }
3751
- const Qt = new Array(3), te = new Array(3);
3752
- function ee(t) {
3769
+ const ee = new Array(3), ne = new Array(3);
3770
+ function re(t) {
3753
3771
  return P(t);
3754
3772
  }
3755
- function ne(t, e) {
3773
+ function se(t, e) {
3756
3774
  const n = e[0], r = e[1], s = e[2];
3757
3775
  let i = n * n + r * r + s * s;
3758
3776
  return i > 0 && (i = Math.sqrt(i), t[0] = e[0] / i, t[1] = e[1] / i, t[2] = e[2] / i),
3759
3777
  t;
3760
3778
  }
3761
- function re(t, e) {
3762
- return R(e, t, Kt), D(e, e);
3779
+ function ie(t, e) {
3780
+ return R(e, t, Wt), D(e, e);
3763
3781
  }
3764
- var se = Object.freeze({
3782
+ var oe = Object.freeze({
3765
3783
  __proto__: null,
3766
- radianToCartesian3: $t,
3767
- cartesian3ToDegree: Yt,
3768
- normalizeCartesian: ne,
3769
- geodeticSurfaceNormal: re
3784
+ radianToCartesian3: Kt,
3785
+ cartesian3ToDegree: te,
3786
+ normalizeCartesian: se,
3787
+ geodeticSurfaceNormal: ie
3770
3788
  });
3771
- function ie(t, e) {
3789
+ function ae(t, e) {
3772
3790
  let n = "";
3773
3791
  for (let r = 0; r < 4; r++) {
3774
3792
  const s = t.getUint8(e + r);
@@ -3776,27 +3794,27 @@
3776
3794
  }
3777
3795
  return n;
3778
3796
  }
3779
- const oe = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
3780
- function ae(t, e, n) {
3797
+ const ce = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
3798
+ function he(t, e, n) {
3781
3799
  const r = new Uint8Array(t, e, n);
3782
- return oe ? JSON.parse(oe.decode(r)) : JSON.parse(T(r));
3800
+ return ce ? JSON.parse(ce.decode(r)) : JSON.parse(T(r));
3783
3801
  }
3784
- function ce(t, e, n) {
3802
+ function ue(t, e, n) {
3785
3803
  const r = new Uint8Array(t, e, n);
3786
- return oe ? JSON.parse(oe.decode(r)) : JSON.parse(T(r));
3804
+ return ce ? JSON.parse(ce.decode(r)) : JSON.parse(T(r));
3787
3805
  }
3788
- function he(t, e, n) {
3806
+ function fe(t, e, n) {
3789
3807
  return {
3790
3808
  offset: e,
3791
3809
  byteLength: n
3792
3810
  };
3793
3811
  }
3794
- function ue(t, e, n, r) {
3812
+ function le(t, e, n, r) {
3795
3813
  const {byteOffset: s, componentType: i, type: o} = t, {ctor: a, type: c} = function(t) {
3796
- return de[t];
3814
+ return ye[t];
3797
3815
  }(i), h = function(t) {
3798
3816
  if (!t) return 1;
3799
- return le[t];
3817
+ return me[t];
3800
3818
  }(o);
3801
3819
  return {
3802
3820
  byteStride: 0,
@@ -3807,19 +3825,19 @@
3807
3825
  array: new a(e, n + s, r * h)
3808
3826
  };
3809
3827
  }
3810
- function fe(t, e, n, r) {
3828
+ function de(t, e, n, r) {
3811
3829
  t.componentType || (t.componentType = "UNSIGNED_SHORT");
3812
- const s = ue(t, e, n, r);
3830
+ const s = le(t, e, n, r);
3813
3831
  return s.array.buffer.byteLength !== e.byteLength && (s.array = s.array.slice()),
3814
3832
  s;
3815
3833
  }
3816
- const le = {
3834
+ const me = {
3817
3835
  "SCALAR": 1,
3818
3836
  "VEC2": 2,
3819
3837
  "VEC3": 3,
3820
3838
  "VEC4": 4
3821
3839
  };
3822
- const de = {
3840
+ const ye = {
3823
3841
  "BYTE": {
3824
3842
  ctor: Int8Array,
3825
3843
  type: 5120,
@@ -3861,27 +3879,27 @@
3861
3879
  name: "Float64Array"
3862
3880
  }
3863
3881
  };
3864
- function me(t) {
3865
- for (let e in de) if (t === de[e].ctor) return de[e].type;
3882
+ function be(t) {
3883
+ for (let e in ye) if (t === ye[e].ctor) return ye[e].type;
3866
3884
  throw new Error("unrecognized ctor:" + t);
3867
3885
  }
3868
- function ye(t, e, n, r) {
3886
+ function pe(t, e, n, r) {
3869
3887
  const s = t, i = e.length / 3;
3870
3888
  for (let t = 0; t < i; t++) s[3 * t] = e[3 * t] / 65535 * r[0] + n[0], s[3 * t + 1] = e[3 * t + 1] / 65535 * r[1] + n[1],
3871
3889
  s[3 * t + 2] = e[3 * t + 2] / 65535 * r[2] + n[2];
3872
3890
  return s;
3873
3891
  }
3874
- function be(t, e, n) {
3892
+ function we(t, e, n) {
3875
3893
  let r = t.getUint32(12, !0), s = t.getUint32(16, !0), i = t.getUint32(20, !0), o = t.getUint32(24, !0);
3876
3894
  const a = t.buffer;
3877
3895
  let c, h, u = {}, f = {};
3878
- r > 0 && (u = ae(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
3896
+ r > 0 && (u = he(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
3879
3897
  return {
3880
3898
  offset: e,
3881
3899
  byteLength: n
3882
3900
  };
3883
- }(0, e, s), e += s), i > 0 && (f = ce(a, e, i), e += i);
3884
- const l = he(0, e, o);
3901
+ }(0, e, s), e += s), i > 0 && (f = ue(a, e, i), e += i);
3902
+ const l = fe(0, e, o);
3885
3903
  return h = a.slice(l.offset, l.offset + l.byteLength), n.push(h), {
3886
3904
  featureTable: u,
3887
3905
  featureTableBin: c,
@@ -3889,33 +3907,33 @@
3889
3907
  batchTableBin: h
3890
3908
  };
3891
3909
  }
3892
- var pe = {
3910
+ var _e = {
3893
3911
  north: [ -1, 0, 0 ],
3894
3912
  east: [ 0, 1, 0 ],
3895
3913
  up: [ 0, 0, 1 ],
3896
3914
  south: [ 1, 0, 0 ],
3897
3915
  west: [ 0, -1, 0 ],
3898
3916
  down: [ 0, 0, -1 ]
3899
- }, we = {}, _e = {
3917
+ }, ge = {}, Te = {
3900
3918
  east: [],
3901
3919
  north: [],
3902
3920
  up: [],
3903
3921
  west: [],
3904
3922
  south: [],
3905
3923
  down: []
3906
- }, ge = [], Te = [], Ae = [];
3907
- const Oe = [ 0, 0, 0 ];
3908
- function ve(t, e, n, r) {
3924
+ }, Ae = [], Oe = [], ve = [];
3925
+ const Me = [ 0, 0, 0 ];
3926
+ function Se(t, e, n, r) {
3909
3927
  n = n || 0, r = r || n;
3910
3928
  var s = Math.abs(t - e);
3911
3929
  return s <= r || s <= n * Math.max(Math.abs(t), Math.abs(e));
3912
3930
  }
3913
- function Me(t, e, n) {
3931
+ function xe(t, e, n) {
3914
3932
  return n[0] = t[0], n[1] = t[1], n[2] = t[2], n[3] = t[3], n[4] = t[4], n[5] = t[5],
3915
3933
  n[6] = t[6], n[7] = t[7], n[8] = t[8], n[9] = t[9], n[10] = t[10], n[11] = t[11],
3916
3934
  n[12] = e[0], n[13] = e[1], n[14] = e[2], n[15] = t[15], n;
3917
3935
  }
3918
- const Se = (Ee = {
3936
+ const Ie = (Le = {
3919
3937
  up: {
3920
3938
  south: "east",
3921
3939
  north: "west",
@@ -3952,39 +3970,38 @@
3952
3970
  north: "up",
3953
3971
  south: "down"
3954
3972
  }
3955
- }[xe = "east"][Ie = "north"], we[Pe = xe + Ie] ? Ne = we[Pe] : (Ne = function(t, e, n) {
3956
- if (function(t, e) {
3957
- var n = t[0], r = t[1], s = t[2], i = e[0], o = e[1], a = e[2];
3958
- return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(r - o) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(o)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a));
3959
- }(t, Oe)) B(ge, pe[xe]), B(Te, pe[Ie]), B(Ae, pe[Ee]); else if (ve(t[0], 0, 1e-14) && ve(t[1], 0, 1e-14)) {
3973
+ }[Ne = "east"][Ee = "north"], ge[Be = Ne + Ee] ? Pe = ge[Be] : (Pe = function(t, e, n) {
3974
+ if (a = Me, c = (o = t)[0], h = o[1], u = o[2], f = a[0], l = a[1], d = a[2], Math.abs(c - f) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(f)) && Math.abs(h - l) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(l)) && Math.abs(u - d) <= 1e-6 * Math.max(1, Math.abs(u), Math.abs(d))) B(Ae, _e[Ne]),
3975
+ B(Oe, _e[Ee]), B(ve, _e[Le]); else if (Se(t[0], 0, 1e-14) && Se(t[1], 0, 1e-14)) {
3960
3976
  var r = _(t[2]);
3961
- B(ge, pe[xe]), "east" !== xe && "west" !== xe && F(ge, ge, r), B(Te, pe[Ie]), "east" !== Ie && "west" !== Ie && F(Te, Te, r),
3962
- B(Ae, pe[Ee]), "east" !== Ee && "west" !== Ee && F(Ae, Ae, r);
3977
+ B(Ae, _e[Ne]), "east" !== Ne && "west" !== Ne && F(Ae, Ae, r), B(Oe, _e[Ee]), "east" !== Ee && "west" !== Ee && F(Oe, Oe, r),
3978
+ B(ve, _e[Le]), "east" !== Le && "west" !== Le && F(ve, ve, r);
3963
3979
  } else {
3964
- re(t, _e.up);
3965
- var s = _e.up, i = _e.east;
3966
- i[0] = -t[1], i[1] = t[0], i[2] = 0, D(_e.east, i), z(_e.north, s, i), F(_e.down, _e.up, -1),
3967
- F(_e.west, _e.east, -1), F(_e.south, _e.north, -1), ge = _e[xe], Te = _e[Ie], Ae = _e[Ee];
3968
- }
3969
- return n[0] = ge[0], n[1] = ge[1], n[2] = ge[2], n[3] = 0, n[4] = Te[0], n[5] = Te[1],
3970
- n[6] = Te[2], n[7] = 0, n[8] = Ae[0], n[9] = Ae[1], n[10] = Ae[2], n[11] = 0, n[12] = t[0],
3980
+ ie(t, Te.up);
3981
+ var s = Te.up, i = Te.east;
3982
+ i[0] = -t[1], i[1] = t[0], i[2] = 0, D(Te.east, i), z(Te.north, s, i), F(Te.down, Te.up, -1),
3983
+ F(Te.west, Te.east, -1), F(Te.south, Te.north, -1), Ae = Te[Ne], Oe = Te[Ee], ve = Te[Le];
3984
+ }
3985
+ var o, a, c, h, u, f, l, d;
3986
+ return n[0] = Ae[0], n[1] = Ae[1], n[2] = Ae[2], n[3] = 0, n[4] = Oe[0], n[5] = Oe[1],
3987
+ n[6] = Oe[2], n[7] = 0, n[8] = ve[0], n[9] = ve[1], n[10] = ve[2], n[11] = 0, n[12] = t[0],
3971
3988
  n[13] = t[1], n[14] = t[2], n[15] = 1, n;
3972
- }, we[Pe] = Ne), Ne);
3973
- var xe, Ie, Ne, Ee, Pe;
3974
- const Le = [], Be = [], Ue = [], Ce = [], Re = [], Fe = [], De = [], ke = {
3989
+ }, ge[Be] = Pe), Pe);
3990
+ var Ne, Ee, Pe, Le, Be;
3991
+ const Ue = [], Ce = [], Re = [], Fe = [], De = [], ke = [], ze = [], je = {
3975
3992
  x: 0,
3976
3993
  y: 0
3977
- }, ze = {
3994
+ }, Ve = {
3978
3995
  x: 0,
3979
3996
  y: 0
3980
- }, je = Math.PI / 180;
3981
- const {getTextureMagFilter: Ve, getTextureMinFilter: Ge, getTextureWrap: He, getMaterialType: qe, getMaterialFormat: $e, getPrimitive: Je, getUniqueREGLBuffer: Ke} = n.reshader.REGLHelper, Xe = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], We = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], {loginIBLResOnCanvas: Ze, logoutIBLResOnCanvas: Ye, getIBLResOnCanvas: Qe, getPBRUniforms: tn} = n.reshader.pbr.PBRUtils, en = {
3997
+ }, Ge = Math.PI / 180;
3998
+ const {getTextureMagFilter: He, getTextureMinFilter: qe, getTextureWrap: $e, getMaterialType: Je, getMaterialFormat: Ke, getPrimitive: Xe, getUniqueREGLBuffer: We} = n.reshader.REGLHelper, Ze = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], Ye = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], {loginIBLResOnCanvas: Qe, logoutIBLResOnCanvas: tn, getIBLResOnCanvas: en, getPBRUniforms: nn} = n.reshader.pbr.PBRUtils, rn = {
3982
3999
  factor: 0,
3983
4000
  units: 0
3984
- }, nn = {
4001
+ }, sn = {
3985
4002
  specularStrength: 0,
3986
4003
  materialShininess: 1
3987
- }, rn = [ 1, 1, 1 ], sn = n.mat4.identity([]), on = t => t.material instanceof n.reshader.PhongMaterial, an = t => t.material instanceof n.reshader.pbr.StandardMaterial, cn = [ !0, !0, !0, !0 ], hn = [], un = new s.Coordinate(0, 0), fn = [], ln = [], dn = {
4004
+ }, on = [ 1, 1, 1 ], an = n.mat4.identity([]), cn = t => t.material instanceof n.reshader.PhongMaterial, hn = t => t.material instanceof n.reshader.pbr.StandardMaterial, un = [ !0, !0, !0, !0 ], fn = [], ln = new s.Coordinate(0, 0), dn = [], mn = [], yn = {
3988
4005
  "POSITION": "POSITION",
3989
4006
  "NORMAL": "NORMAL",
3990
4007
  "TEXCOORD_0": "TEXCOORD_0",
@@ -3992,7 +4009,7 @@
3992
4009
  "COLOR_0": "COLOR_0",
3993
4010
  "TANGENT": "TANGENT"
3994
4011
  };
3995
- class mn {
4012
+ class bn {
3996
4013
  constructor(t, e) {
3997
4014
  this.Nt = e, this.Et = e.getRenderer().canvas, this.Pt = new s.SpatialReference,
3998
4015
  this.Lt = t, this.Bt = new n.reshader.Renderer(t), this.Ut = {}, this.Ct = {}, this.Rt = {},
@@ -4027,7 +4044,7 @@
4027
4044
  r = O(r);
4028
4045
  }
4029
4046
  const s = t[n].node;
4030
- let f = a[s.te].polygonOffset || en;
4047
+ let f = a[s.te].polygonOffset || rn;
4031
4048
  y(f) && (f = f());
4032
4049
  const l = a[s.te].ambientLight;
4033
4050
  for (let a = 0, d = r.length; a < d; a++) "b3dm" === r[a].properties.magic && (r[a].getBoundingBox && !c(o, r[a].getBoundingBox()) || (r[a].properties.level = t[n].selectionDepth,
@@ -4040,7 +4057,7 @@
4040
4057
  }
4041
4058
  let f = 0;
4042
4059
  const l = this.Wt.getExcludeFilter();
4043
- f += this.ne(this.re, i, [ n, on, l ], r, h, u), f += this.ne(this.se, i, [ n, an, l ], r, h, u),
4060
+ f += this.ne(this.re, i, [ n, cn, l ], r, h, u), f += this.ne(this.se, i, [ n, hn, l ], r, h, u),
4044
4061
  this.Wt.forEachShader((t, e, s) => {
4045
4062
  const i = this.Yt(s);
4046
4063
  f += this.ne(t, i, [ n, e ], r, h, u);
@@ -4053,7 +4070,7 @@
4053
4070
  }
4054
4071
  ne(t, e, n, r, s, i) {
4055
4072
  t.filter = n.filter(t => !!t), e.debug = !1, this.jt.setMeshes(s), e.stencilEnable = !1,
4056
- e.debug = !1, e.cullFace = "back", e.colorMask = cn;
4073
+ e.debug = !1, e.cullFace = "back", e.colorMask = un;
4057
4074
  let o = 0;
4058
4075
  this.jt.setMeshes(i), o += this.Bt.render(t, e, this.jt, r && r.fbo), e.stencilEnable = !1;
4059
4076
  const a = [];
@@ -4108,7 +4125,7 @@
4108
4125
  }
4109
4126
  remove() {
4110
4127
  const t = this.Nt;
4111
- Ye(t.getRenderer().canvas, t.getMap());
4128
+ tn(t.getRenderer().canvas, t.getMap());
4112
4129
  for (const t in this.kt) this.de(t);
4113
4130
  this.kt = {};
4114
4131
  for (const t in this.Rt) this.le(t);
@@ -4206,7 +4223,7 @@
4206
4223
  }, M = new Float32Array(3), S = new Float32Array(3), x = [], I = new Float32Array(1), N = new Float32Array(3), E = [], P = [], L = [], B = [], U = new Float32Array(9);
4207
4224
  !function(t, e) {
4208
4225
  let {componentType: n, byteOffset: r, byteStride: s, count: i, itemSize: o} = t;
4209
- const a = t.array.buffer, c = n ? Nt.getTypedArrayCtor(n) : t.array.constructor;
4226
+ const a = t.array.buffer, c = n ? Pt.getTypedArrayCtor(n) : t.array.constructor;
4210
4227
  if (r = void 0 === r ? t.array.byteOffset : r, s = s || 0, i = i || t.array.length / o,
4211
4228
  (!s || s === o * c.BYTES_PER_ELEMENT) && r % c.BYTES_PER_ELEMENT == 0) {
4212
4229
  const t = new c(a, r, i * o);
@@ -4223,11 +4240,11 @@
4223
4240
  e(new c(h.buffer), t), n.set(h);
4224
4241
  }
4225
4242
  }(p, (t, e) => {
4226
- w ? (jt(S, _, e), jt(M, w, e), n.vec3.cross(x, S, M), n.vec3.normalize(x, x), A(E, S, 0),
4227
- A(E, M, 1), A(E, x, 2), n.quat.fromMat3(P, E)) : O ? (jt(U, O, e), n.quat.fromMat3(P, U)) : n.quat.identity(P),
4228
- g ? (jt(I, g, e), n.vec3.set(L, I[0], I[0], I[0])) : T ? (jt(N, T, e), n.vec3.set(L, ...N)) : n.vec3.set(L, 1, 1, 1),
4229
- n.mat4.fromRotationTranslationScale(B, P, t, L), Vt(v.instance_vectorA, e, B, 0),
4230
- Vt(v.instance_vectorB, e, B, 1), Vt(v.instance_vectorC, e, B, 2);
4243
+ w ? (Gt(S, _, e), Gt(M, w, e), n.vec3.cross(x, S, M), n.vec3.normalize(x, x), A(E, S, 0),
4244
+ A(E, M, 1), A(E, x, 2), n.quat.fromMat3(P, E)) : O ? (Gt(U, O, e), n.quat.fromMat3(P, U)) : n.quat.identity(P),
4245
+ g ? (Gt(I, g, e), n.vec3.set(L, I[0], I[0], I[0])) : T ? (Gt(N, T, e), n.vec3.set(L, ...N)) : n.vec3.set(L, 1, 1, 1),
4246
+ n.mat4.fromRotationTranslationScale(B, P, t, L), Ht(v.instance_vectorA, e, B, 0),
4247
+ Ht(v.instance_vectorB, e, B, 1), Ht(v.instance_vectorC, e, B, 2);
4231
4248
  });
4232
4249
  const C = {};
4233
4250
  for (const t in v) C[t] = {
@@ -4240,7 +4257,7 @@
4240
4257
  const R = this.Nt.options.services[r.te].shader || "phong";
4241
4258
  let F = 0, D = !0;
4242
4259
  const k = [];
4243
- return kt(c, (t, s, o, a) => {
4260
+ return jt(c, (t, s, o, a) => {
4244
4261
  let {geometry: c, material: d} = this.Ae(t, s, o, a, r, !0, R);
4245
4262
  d && !d.isReady() && (D = !1, F++);
4246
4263
  const m = new n.reshader.InstancedMesh(C, l, c, d);
@@ -4278,7 +4295,7 @@
4278
4295
  f && (u[2] += f);
4279
4296
  const l = this.we(u, r.te), d = this.Nt.options.services[r.te].shader || "phong", m = [];
4280
4297
  let y = 0, b = !0;
4281
- return kt(c, (s, i, c, f) => {
4298
+ return jt(c, (s, i, c, f) => {
4282
4299
  let {geometry: p, material: w} = this.Ae(s, i, c, f, r, !1, d);
4283
4300
  w && !w.isReady() && (b = !1, y++);
4284
4301
  const _ = new n.reshader.Mesh(p, w);
@@ -4303,18 +4320,18 @@
4303
4320
  const i = this.getMap(), o = this.Nt.options.services[t.te].heightOffset || 0, a = new s.Coordinate(r), c = i.distanceToPointAtRes(100, 0, i.getGLRes(), a).x / 100;
4304
4321
  let h = t.matrix ? n.mat4.copy([], t.matrix) : n.mat4.identity([]);
4305
4322
  if (e) {
4306
- Me(h, n.vec3.transformMat4(hn, e, h), h);
4323
+ xe(h, n.vec3.transformMat4(fn, e, h), h);
4307
4324
  }
4308
4325
  const u = function(t, e, n, r, s, i, o) {
4309
- e = B(Le, e);
4310
- const a = $t(Le, e[0] * je, e[1] * je, e[2]), c = function(t, e) {
4326
+ e = B(Ue, e);
4327
+ const a = Kt(Ue, e[0] * Ge, e[1] * Ge, e[2]), c = function(t, e) {
4311
4328
  return t[0] = e[12], t[1] = e[13], t[2] = e[14], t;
4312
- }(Be, n), h = r.ellipsoid;
4329
+ }(Ce, n), h = r.ellipsoid;
4313
4330
  var u;
4314
- u = 0 === G(c) ? U(Ue, 0, 0, -6378137) : Yt(Ue, c), ke.x = u[0], ke.y = u[1];
4315
- const f = r.project(ke, ze);
4316
- Ce[0] = f.x / s, Ce[1] = f.y / s, Ce[2] = (u[2] + o) * i;
4317
- const l = Se(a, h, Re), d = function(t, e, n) {
4331
+ u = 0 === G(c) ? U(Re, 0, 0, -6378137) : te(Re, c), je.x = u[0], je.y = u[1];
4332
+ const f = r.project(je, Ve);
4333
+ Fe[0] = f.x / s, Fe[1] = f.y / s, Fe[2] = (u[2] + o) * i;
4334
+ const l = Ie(a, h, De), d = function(t, e, n) {
4318
4335
  var r = t[0], s = t[1], i = t[2], o = t[4], a = t[5], c = t[6], h = t[8], u = t[9], f = t[10], l = e[0], d = e[1], m = e[2], y = e[3], b = e[4], p = e[5], w = e[6], _ = e[7], g = e[8], T = r * l + o * d + h * m, A = s * l + a * d + u * m, O = i * l + c * d + f * m, v = r * y + o * b + h * p, M = s * y + a * b + u * p, S = i * y + c * b + f * p, x = r * w + o * _ + h * g, I = s * w + a * _ + u * g, N = i * w + c * _ + f * g;
4319
4336
  return n[0] = T, n[1] = A, n[2] = O, n[3] = 0, n[4] = v, n[5] = M, n[6] = S, n[7] = 0,
4320
4337
  n[8] = x, n[9] = I, n[10] = N, n[11] = 0, n[12] = t[12], n[13] = t[13], n[14] = t[14],
@@ -4327,19 +4344,19 @@
4327
4344
  t[8] = (o * I - a * S + h * v) * E, t[9] = (r * S - n * I - i * v) * E, t[10] = (m * A - y * g + p * w) * E,
4328
4345
  t[11] = (f * g - u * A - d * w) * E, t[12] = (a * M - o * x - c * v) * E, t[13] = (n * x - r * M + s * v) * E,
4329
4346
  t[14] = (y * _ - m * T - b * w) * E, t[15] = (u * T - f * _ + l * w) * E, t) : null;
4330
- }(Fe, l), function(t, e) {
4347
+ }(ke, l), function(t, e) {
4331
4348
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[4], t[4] = e[5], t[5] = e[6],
4332
4349
  t[6] = e[8], t[7] = e[9], t[8] = e[10], t;
4333
- }(De, n), t);
4334
- return Me(t, Ce, d), t;
4350
+ }(ze, n), t);
4351
+ return xe(t, Fe, d), t;
4335
4352
  }(h, r, h, i.getProjection(), i.getGLRes(), c, o), f = function(t, e) {
4336
4353
  return U(t, e[12], e[13], e[14]), t;
4337
- }(ln, u);
4354
+ }(mn, u);
4338
4355
  let l = this.Nt.options.offset;
4339
4356
  if (y(l)) {
4340
4357
  l = l(this.Nt.Me(t.id).center);
4341
4358
  }
4342
- return n.vec3.set(fn, l[0], l[1], 0), n.vec3.sub(f, f, fn), Me(u, f, u), u;
4359
+ return n.vec3.set(dn, l[0], l[1], 0), n.vec3.sub(f, f, dn), xe(u, f, u), u;
4343
4360
  }
4344
4361
  createCMPTMesh(t, e, n, r) {
4345
4362
  if (this.kt[e]) {
@@ -4379,9 +4396,9 @@
4379
4396
  const e = this.Se(t, r, i);
4380
4397
  c = e.material, h = e.geometry;
4381
4398
  } else {
4382
- h = this.xe(t, i, dn);
4399
+ h = this.xe(t, i, yn);
4383
4400
  const e = this.Nt.options.services[s.te].material;
4384
- c = this.Ie(t.material, r, o, e || nn);
4401
+ c = this.Ie(t.material, r, o, e || sn);
4385
4402
  }
4386
4403
  c && !c.isReady() ? c.Ne = s.id : c || (c = this.Kt);
4387
4404
  const f = {
@@ -4407,7 +4424,7 @@
4407
4424
  }
4408
4425
  const o = {};
4409
4426
  for (const t in s) {
4410
- const e = Ke(this.Lt, s[t], {
4427
+ const e = We(this.Lt, s[t], {
4411
4428
  dimension: s[t].itemSize
4412
4429
  }), n = r[t] || t;
4413
4430
  o[n] = {
@@ -4422,7 +4439,7 @@
4422
4439
  uv1Attribute: r.TEXCOORD_1,
4423
4440
  color0Attribute: r.COLOR_0,
4424
4441
  tangentAttribute: r.TANGENT,
4425
- primitive: void 0 === t.mode ? "triangles" : Je(t.mode)
4442
+ primitive: void 0 === t.mode ? "triangles" : Xe(t.mode)
4426
4443
  });
4427
4444
  return a.generateBuffers(this.Lt, {
4428
4445
  excludeElementsInVAO: e
@@ -4430,8 +4447,8 @@
4430
4447
  }
4431
4448
  we(t) {
4432
4449
  const e = n.mat4.identity([]), r = this.getMap(), s = this.Ee();
4433
- un.x = t[0], un.y = t[1];
4434
- const i = r.distanceToPointAtRes(100, 100, r.getGLRes(), un);
4450
+ ln.x = t[0], ln.y = t[1];
4451
+ const i = r.distanceToPointAtRes(100, 100, r.getGLRes(), ln);
4435
4452
  return n.vec3.set(s, i.x / 100 * 1.01, i.y / 100 * 1.01, i.y / 100), n.mat4.scale(e, e, s),
4436
4453
  e;
4437
4454
  }
@@ -4491,7 +4508,7 @@
4491
4508
  extraCommandProps: s
4492
4509
  });
4493
4510
  const i = this.Nt;
4494
- Ze(i.getRenderer().canvas, this.Lt, i.getMap());
4511
+ Qe(i.getRenderer().canvas, this.Lt, i.getMap());
4495
4512
  }
4496
4513
  Zt() {
4497
4514
  return {
@@ -4501,7 +4518,7 @@
4501
4518
  width: () => this.Et ? this.Et.width : 1,
4502
4519
  height: () => this.Et ? this.Et.height : 1
4503
4520
  },
4504
- colorMask: (t, e) => e.colorMask || cn,
4521
+ colorMask: (t, e) => e.colorMask || un,
4505
4522
  cull: {
4506
4523
  enable: !0,
4507
4524
  face: (t, e) => e.cullFace
@@ -4552,7 +4569,7 @@
4552
4569
  };
4553
4570
  }
4554
4571
  Yt() {
4555
- const t = this.getMap(), e = this.Nt.getRenderer().canvas, {iblTexes: n, dfgLUT: r} = Qe(e), s = tn(t, n, r);
4572
+ const t = this.getMap(), e = this.Nt.getRenderer().canvas, {iblTexes: n, dfgLUT: r} = en(e), s = nn(t, n, r);
4556
4573
  return m(s, {
4557
4574
  lightSpecular: [ 1, 1, 1 ],
4558
4575
  viewMatrix: t.viewMatrix,
@@ -4605,15 +4622,15 @@
4605
4622
  }
4606
4623
  S(t) {
4607
4624
  const e = {
4608
- type: t.type ? qe(t.type) : "uint8",
4609
- format: t.format ? $e(t.format) : "rgba",
4625
+ type: t.type ? Je(t.type) : "uint8",
4626
+ format: t.format ? Ke(t.format) : "rgba",
4610
4627
  flipY: !1
4611
4628
  }, r = t.image;
4612
4629
  r.array ? e.data = r.array : r.mipmap && (e.mipmap = r.mipmap), e.width = r.width,
4613
4630
  e.height = r.height;
4614
4631
  const s = t.sampler || t.texture.sampler;
4615
- return s && (s.magFilter && (e.mag = Ve(s.magFilter)), s.minFilter && (e.min = Ge(s.minFilter)),
4616
- s.wrapS && (e.wrapS = He(s.wrapS)), s.wrapT && (e.wrapT = He(s.wrapT))), new n.reshader.Texture2D(e, this.qt);
4632
+ return s && (s.magFilter && (e.mag = He(s.magFilter)), s.minFilter && (e.min = qe(s.minFilter)),
4633
+ s.wrapS && (e.wrapS = $e(s.wrapS)), s.wrapT && (e.wrapT = $e(s.wrapT))), new n.reshader.Texture2D(e, this.qt);
4617
4634
  }
4618
4635
  Pe(t) {
4619
4636
  const e = t.image, n = window.URL || window.webkitURL, r = new Blob([ e.array ], {
@@ -4634,7 +4651,7 @@
4634
4651
  }
4635
4652
  }
4636
4653
  Ee() {
4637
- return rn;
4654
+ return on;
4638
4655
  }
4639
4656
  ye(t) {
4640
4657
  return this.Nt.ye(t);
@@ -4652,12 +4669,12 @@
4652
4669
  return e.getGLZoom ? e._prjToPoint(t, e.getGLZoom()) : e._prjToPointAtRes(t, e.getGLRes());
4653
4670
  }
4654
4671
  ge(t) {
4655
- return "Y" === t ? Xe : "X" === t ? We : sn;
4672
+ return "Y" === t ? Ze : "X" === t ? Ye : an;
4656
4673
  }
4657
4674
  }
4658
- class yn extends s.renderer.CanvasRenderer {
4675
+ class pn extends s.renderer.CanvasRenderer {
4659
4676
  constructor(t) {
4660
- super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new Dt(1024 * t.options.maxGPUMemory * 1024, this.deleteTile.bind(this)),
4677
+ super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new zt(1024 * t.options.maxGPUMemory * 1024, this.deleteTile.bind(this)),
4661
4678
  this.bt = {};
4662
4679
  }
4663
4680
  needToRedraw() {
@@ -4694,7 +4711,7 @@
4694
4711
  }
4695
4712
  }
4696
4713
  let c = [], h = {};
4697
- if (o && ({selectedTiles: c, leaves: h} = this.je(t)), n.length > 1 && (n.sort(pn),
4714
+ if (o && ({selectedTiles: c, leaves: h} = this.je(t)), n.length > 1 && (n.sort(_n),
4698
4715
  s)) {
4699
4716
  const t = s - r;
4700
4717
  n = t > 0 ? n.slice(0, t) : [];
@@ -4727,7 +4744,7 @@
4727
4744
  }
4728
4745
  i.push(t), t.Ve = s.length;
4729
4746
  }
4730
- o.length > 1 && o.sort(bn);
4747
+ o.length > 1 && o.sort(wn);
4731
4748
  for (let t = 0; t < o.length; t++) s.push(o[t]);
4732
4749
  }
4733
4750
  return {
@@ -4908,11 +4925,11 @@
4908
4925
  attributes: e,
4909
4926
  extensions: [ "OES_element_index_uint", "WEBGL_compressed_texture_s3tc" ],
4910
4927
  optionalExtensions: t.options.optionalExtensions || []
4911
- }), this.painter = new mn(this.regl, t);
4928
+ }), this.painter = new bn(this.regl, t);
4912
4929
  }
4913
4930
  prepareWorker() {
4914
4931
  const t = this.getMap();
4915
- this.workerConn || (this.workerConn = new Ct("@maptalks/3dtiles", t.id));
4932
+ this.workerConn || (this.workerConn = new Ft("@maptalks/3dtiles", t.id));
4916
4933
  const e = this.workerConn;
4917
4934
  if (!e.isActive()) return;
4918
4935
  let n = this.layer.options || {};
@@ -4984,23 +5001,23 @@
4984
5001
  return this.painter.getB3DMMeshes();
4985
5002
  }
4986
5003
  readBatchData(t, e, n) {
4987
- return ue(t, e, 0, n);
5004
+ return le(t, e, 0, n);
4988
5005
  }
4989
5006
  }
4990
- function bn(t, e) {
5007
+ function wn(t, e) {
4991
5008
  return 0 === t.node.ce && 0 === e.node.ce ? e.node.Ye - t.node.Ye : e.node.ce - t.node.ce;
4992
5009
  }
4993
- function pn(t, e) {
5010
+ function _n(t, e) {
4994
5011
  return 0 === t.ce && 0 === e.ce ? t.Ye - e.Ye : t.ce - e.ce;
4995
5012
  }
4996
- function wn(t, e, n) {
5013
+ function gn(t, e, n) {
4997
5014
  return t[0] = e[n], t[1] = e[n + 3], t[2] = e[n + 6], t;
4998
5015
  }
4999
- function _n(t, e, n) {
5016
+ function Tn(t, e, n) {
5000
5017
  return Math.sqrt(function(t, e, n) {
5001
- var r = C(gn, n, t), s = wn(Tn, e, 0), i = wn(An, e, 1), o = wn(On, e, 2), a = G(s), c = G(i), h = G(o);
5018
+ var r = C(An, n, t), s = gn(On, e, 0), i = gn(vn, e, 1), o = gn(Mn, e, 2), a = G(s), c = G(i), h = G(o);
5002
5019
  D(s, s), D(i, i), D(o, o);
5003
- var u = vn;
5020
+ var u = Sn;
5004
5021
  u.x = k(r, s), u.y = k(r, i), u.z = k(r, o);
5005
5022
  var f, l = 0;
5006
5023
  u.x < -a ? (f = u.x + a, l += f * f) : u.x > a && (f = u.x - a, l += f * f);
@@ -5009,9 +5026,9 @@
5009
5026
  return l;
5010
5027
  }(t, e, n));
5011
5028
  }
5012
- const gn = [], Tn = [], An = [], On = [], vn = [];
5013
- const Mn = s.projection.EPSG3857, Sn = new s.Extent(0, 0, 0, 0), xn = [], In = [], Nn = [], En = new s.Coordinate(0, 0), Pn = n.mat4.identity([]);
5014
- class Ln extends s.Layer {
5029
+ const An = [], On = [], vn = [], Mn = [], Sn = [];
5030
+ const xn = s.projection.EPSG3857, In = new s.Extent(0, 0, 0, 0), Nn = [], En = [], Pn = [], Ln = new s.Coordinate(0, 0), Bn = n.mat4.identity([]);
5031
+ class Un extends s.Layer {
5015
5032
  constructor(t, e) {
5016
5033
  super(t, e), this.Qe(), this.bt = {}, this.tn = {};
5017
5034
  }
@@ -5045,17 +5062,17 @@
5045
5062
  return this.en[t] && this.en[t].boundingVolume ? this.boundingVolumeToExtent(this.en[t]) : null;
5046
5063
  }
5047
5064
  boundingVolumeToExtent(t) {
5048
- const e = t.boundingVolume.nn ? Pn : t.matrix, r = this.getMap();
5065
+ const e = t.boundingVolume.nn ? Bn : t.matrix, r = this.getMap();
5049
5066
  if (t.boundingVolume.region) {
5050
5067
  const e = t.boundingVolume.region;
5051
5068
  return new s.Extent(p(e[0]), p(e[1]), p(e[2]), p(e[3]));
5052
5069
  }
5053
5070
  if (t.boundingVolume.sphere) {
5054
- const i = t.boundingVolume.sphere, o = Yt([], n.vec3.transformMat4([], i, e)), a = i[3], c = r.locate(o, -a, a), h = r.locate(o, a, -a);
5071
+ const i = t.boundingVolume.sphere, o = te([], n.vec3.transformMat4([], i, e)), a = i[3], c = r.locate(o, -a, a), h = r.locate(o, a, -a);
5055
5072
  return new s.Extent(c, h);
5056
5073
  }
5057
5074
  if (t.boundingVolume.box) {
5058
- const i = t.boundingVolume.box, o = n.vec3.transformMat4([], i, e), a = new s.Coordinate(Yt([], o)), c = i.slice(3);
5075
+ const i = t.boundingVolume.box, o = n.vec3.transformMat4([], i, e), a = new s.Coordinate(te([], o)), c = i.slice(3);
5059
5076
  n.mat3.multiply(c, n.mat3.fromMat4([], t.matrix), c);
5060
5077
  const h = n.vec3.length(c.slice(0, 3)), u = n.vec3.length(c.slice(3, 6)), f = n.vec3.length(c.slice(6, 9)), l = Math.max(h, u, f), d = r.locate(a, -l, l), m = r.locate(a, l, -l);
5061
5078
  return new s.Extent(d, m);
@@ -5073,13 +5090,13 @@
5073
5090
  rn() {
5074
5091
  const t = this.getMap(), e = t.cameraPosition;
5075
5092
  let r, s;
5076
- if (t.getGLZoom) s = t.pointToDistance(e[2], 0, t.getGLZoom()), En.set(e[0], e[1]),
5077
- r = t.pointToCoord(En, t.getGLZoom()); else {
5093
+ if (t.getGLZoom) s = t.pointToDistance(e[2], 0, t.getGLZoom()), Ln.set(e[0], e[1]),
5094
+ r = t.pointToCoord(Ln, t.getGLZoom()); else {
5078
5095
  const n = t.getGLRes();
5079
- s = t.pointAtResToDistance(e[2], 0, n), En.set(e[0], e[1]), r = t.pointAtResToCoord(En, n);
5096
+ s = t.pointAtResToDistance(e[2], 0, n), Ln.set(e[0], e[1]), r = t.pointAtResToCoord(Ln, n);
5080
5097
  }
5081
- this.in = this.in || [], n.vec3.set(this.in, b(r.x), b(r.y), s), this.an = $t(this.an || [], this.in[0], this.in[1], this.in[2]),
5082
- this.cn = 2 * Math.tan(.5 * b(t.getFov())), this.hn = Mn.project(r).toArray();
5098
+ this.in = this.in || [], n.vec3.set(this.in, b(r.x), b(r.y), s), this.an = Kt(this.an || [], this.in[0], this.in[1], this.in[2]),
5099
+ this.cn = 2 * Math.tan(.5 * b(t.getFov())), this.hn = xn.project(r).toArray();
5083
5100
  const i = t.projViewMatrix, o = {
5084
5101
  children: [],
5085
5102
  level: -1
@@ -5129,8 +5146,8 @@
5129
5146
  const e = n.region;
5130
5147
  if (t[0] >= e[0] && t[0] <= e[2] && t[1] >= e[1] && t[1] <= e[3]) return !0;
5131
5148
  } else {
5132
- if (n.sphere) return Bn(n, e);
5133
- if (n.box) return 0 === Un(n, e);
5149
+ if (n.sphere) return Cn(n, e);
5150
+ if (n.box) return 0 === Rn(n, e);
5134
5151
  }
5135
5152
  return !1;
5136
5153
  }
@@ -5161,7 +5178,7 @@
5161
5178
  const e = t.boundingVolume;
5162
5179
  if (!e || e.nn) return;
5163
5180
  const r = this.options.services[t.te].heightOffset || 0, s = this.options.offset, i = y(s) || s[0] || s[1];
5164
- if (!t.boundingVolume || !r && n.mat4.exactEquals(t.matrix, Pn) && !i) return;
5181
+ if (!t.boundingVolume || !r && n.mat4.exactEquals(t.matrix, Bn) && !i) return;
5165
5182
  const {region: o, box: a, sphere: c} = e;
5166
5183
  if (o) {
5167
5184
  const t = this.gn([ p(o[0]), p(o[1]) ]);
@@ -5169,8 +5186,8 @@
5169
5186
  const e = this.gn([ p(o[2]), p(o[3]) ]);
5170
5187
  o[2] = b(e.x), o[3] = b(e.y), o[4] += r, o[5] += r;
5171
5188
  } else if (a || c) {
5172
- const e = a || c, s = n.vec3.transformMat4(xn, e, t.matrix), i = Yt(In, s), o = this.gn([ i[0], i[1] ]);
5173
- i[0] = o.x, i[1] = o.y, i[2] += r, $t(e, b(i[0]), b(i[1]), i[2]);
5189
+ const e = a || c, s = n.vec3.transformMat4(Nn, e, t.matrix), i = te(En, s), o = this.gn([ i[0], i[1] ]);
5190
+ i[0] = o.x, i[1] = o.y, i[2] += r, Kt(e, b(i[0]), b(i[1]), i[2]);
5174
5191
  }
5175
5192
  e.nn = !0;
5176
5193
  }
@@ -5231,27 +5248,27 @@
5231
5248
  e = e.convertTo(t => this.ye(t)), i = n[4], r = n[5], a = this.tn[o] = [ [ e.xmin, e.ymin, i * h ], [ e.xmax, e.ymax, r * h ] ],
5232
5249
  a.center = c;
5233
5250
  } else if (t.boundingVolume.sphere) {
5234
- const e = t.boundingVolume.sphere, n = Yt([], e), r = new s.Coordinate(n), i = this.ye(r).toArray(), c = this.Mn(r);
5251
+ const e = t.boundingVolume.sphere, n = te([], e), r = new s.Coordinate(n), i = this.ye(r).toArray(), c = this.Mn(r);
5235
5252
  i.push(n[2] * c[2]), a = this.tn[o] = [ i, e[3] * c ], a.center = new s.Coordinate(n);
5236
5253
  } else if (t.boundingVolume.box) {
5237
- const e = t.boundingVolume.box, r = Yt([], e), i = new s.Coordinate(r), c = this.ye(i).toArray(), h = this.Mn(i);
5254
+ const e = t.boundingVolume.box, r = te([], e), i = new s.Coordinate(r), c = this.ye(i).toArray(), h = this.Mn(i);
5238
5255
  c.push(r[2] * h[2]);
5239
5256
  const u = e.slice(3);
5240
- n.mat4.exactEquals(t.matrix, Pn) || n.mat3.multiply(u, n.mat3.fromMat4([], t.matrix), u);
5257
+ n.mat4.exactEquals(t.matrix, Bn) || n.mat3.multiply(u, n.mat3.fromMat4([], t.matrix), u);
5241
5258
  for (let t = 0; t < u.length; t++) u[t] *= h[t % 3], e[3 + t] = u[t];
5242
5259
  a = this.tn[o] = [ ...c, ...u ], a.center = new s.Coordinate(r);
5243
5260
  }
5244
5261
  }
5245
5262
  if (e) {
5246
- if (t.boundingVolume.region) Sn.xmin = a[0][0], Sn.ymin = a[0][1], Sn.xmax = a[1][0],
5247
- Sn.ymax = a[1][1]; else if (t.boundingVolume.sphere) {
5263
+ if (t.boundingVolume.region) In.xmin = a[0][0], In.ymin = a[0][1], In.xmax = a[1][0],
5264
+ In.ymax = a[1][1]; else if (t.boundingVolume.sphere) {
5248
5265
  const t = a[2];
5249
- Sn.xmin = a[0][0] - t, Sn.ymin = a[0][1] - t, Sn.xmax = a[0][0] + t, Sn.ymax = a[0][1] + t;
5266
+ In.xmin = a[0][0] - t, In.ymin = a[0][1] - t, In.xmax = a[0][0] + t, In.ymax = a[0][1] + t;
5250
5267
  } else if (t.boundingVolume.box) {
5251
5268
  const t = a[1], e = a[2];
5252
- Sn.xmin = a[0][0] - t, Sn.ymin = a[0][1] - e, Sn.xmax = a[0][0] + t, Sn.ymax = a[0][1] + e;
5269
+ In.xmin = a[0][0] - t, In.ymin = a[0][1] - e, In.xmax = a[0][0] + t, In.ymax = a[0][1] + e;
5253
5270
  }
5254
- if (!e.intersects(Sn)) return !1;
5271
+ if (!e.intersects(In)) return !1;
5255
5272
  }
5256
5273
  return t.boundingVolume.region ? c(r, a) : t.boundingVolume.sphere ? function(t, e, n) {
5257
5274
  u(t);
@@ -5269,7 +5286,7 @@
5269
5286
  }
5270
5287
  Mn(t) {
5271
5288
  const e = this.getMap(), r = e.distanceToPointAtRes(100, 100, e.getGLRes(), t);
5272
- return n.vec3.set(Nn, r.x / 100 * 1.01, r.y / 100 * 1.01, r.y / 100), Nn;
5289
+ return n.vec3.set(Pn, r.x / 100 * 1.01, r.y / 100 * 1.01, r.y / 100), Pn;
5273
5290
  }
5274
5291
  gn(t) {
5275
5292
  Array.isArray(t) && (t = new s.Coordinate(t));
@@ -5297,7 +5314,7 @@
5297
5314
  i = function(t, e, n, r) {
5298
5315
  const s = t.boundingVolume.region;
5299
5316
  let i = t.Sn;
5300
- i || (i = t.Sn = [ Fn(s[0], s[1]), Fn(s[0], s[3]), Fn(s[2], s[1]), Fn(s[2], s[3]), Fn(s[0], s[1]), Fn(s[0], s[3]), Fn(s[2], s[1]), Fn(s[2], s[3]) ],
5317
+ i || (i = t.Sn = [ kn(s[0], s[1]), kn(s[0], s[3]), kn(s[2], s[1]), kn(s[2], s[3]), kn(s[0], s[1]), kn(s[0], s[3]), kn(s[2], s[1]), kn(s[2], s[3]) ],
5301
5318
  t.xn = [ Math.min.apply(Math, i.map(t => t[0])), Math.min.apply(Math, i.map(t => t[1])) ],
5302
5319
  t.In = [ Math.max.apply(Math, i.map(t => t[0])), Math.max.apply(Math, i.map(t => t[1])) ]);
5303
5320
  if (n[0] >= s[0] && n[0] <= s[2] && n[1] >= s[1] && n[1] <= s[3]) return n[2] <= s[5] ? 0 : n[2] - s[5];
@@ -5308,13 +5325,13 @@
5308
5325
  n[2] > s[5] && (l = n[2] - s[5]);
5309
5326
  return Math.sqrt(o * o + l * l);
5310
5327
  }(t, this.hn, this.in, r), o = function(t, e) {
5311
- const r = t.boundingVolume.region, s = $t(Cn, r[0], r[1], r[4]), i = $t(Rn, r[2], r[3], r[5]), o = n.vec3.scale(s, n.vec3.add(s, s, i), .5);
5328
+ const r = t.boundingVolume.region, s = Kt(Fn, r[0], r[1], r[4]), i = Kt(Dn, r[2], r[3], r[5]), o = n.vec3.scale(s, n.vec3.add(s, s, i), .5);
5312
5329
  return n.vec3.dist(o, e);
5313
5330
  }(t, this.an);
5314
- } else t.boundingVolume.sphere ? (i = Bn(t.boundingVolume, this.an), o = function(t, e) {
5331
+ } else t.boundingVolume.sphere ? (i = Cn(t.boundingVolume, this.an), o = function(t, e) {
5315
5332
  const r = t.boundingVolume.sphere;
5316
5333
  return n.vec3.dist(r, e);
5317
- }(t, this.an)) : t.boundingVolume.box && (i = Un(t.boundingVolume, this.an), o = function(t, e) {
5334
+ }(t, this.an)) : t.boundingVolume.box && (i = Rn(t.boundingVolume, this.an), o = function(t, e) {
5318
5335
  const r = t.boundingVolume.box;
5319
5336
  return n.vec3.dist(r, e);
5320
5337
  }(t, this.an));
@@ -5329,15 +5346,15 @@
5329
5346
  return this.tn[t];
5330
5347
  }
5331
5348
  }
5332
- function Bn(t, e) {
5349
+ function Cn(t, e) {
5333
5350
  const r = t.sphere, s = n.vec3.dist(r, e), i = t.sphere[3];
5334
5351
  return s < i ? 0 : s - i;
5335
5352
  }
5336
- function Un(t, e) {
5353
+ function Rn(t, e) {
5337
5354
  const n = t.box;
5338
- return _n(n.slice(0, 3), n.slice(3), e);
5355
+ return Tn(n.slice(0, 3), n.slice(3), e);
5339
5356
  }
5340
- Ln.mergeOptions({
5357
+ Un.mergeOptions({
5341
5358
  "maxGPUMemory": 512,
5342
5359
  "retireInterval": 2e3,
5343
5360
  "loadingLimitOnInteracting": 5,
@@ -5352,35 +5369,35 @@
5352
5369
  "sRGBTolinear": !1,
5353
5370
  "optionalExtensions": [ "ANGLE_instanced_arrays", "OES_element_index_uint", "OES_standard_derivatives", "OES_vertex_array_object", "OES_texture_half_float", "OES_texture_half_float_linear", "OES_texture_float", "OES_texture_float_linear", "WEBGL_depth_texture", "EXT_shader_texture_lod", "WEBGL_compressed_texture_astc", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_etc1", "WEBGL_compressed_texture_pvrtc", "WEBGL_compressed_texture_s3tc", "WEBGL_compressed_texture_s3tc_srgb" ],
5354
5371
  "offset": [ 0, 0 ]
5355
- }), Ln.registerRenderer("gl", yn);
5356
- const Cn = [], Rn = [];
5357
- function Fn(t, e) {
5372
+ }), Un.registerRenderer("gl", pn);
5373
+ const Fn = [], Dn = [];
5374
+ function kn(t, e) {
5358
5375
  const n = new s.Coordinate(p(t), p(e));
5359
- return Mn.project(n).toArray();
5376
+ return xn.project(n).toArray();
5360
5377
  }
5361
- const Dn = function() {
5378
+ const zn = function() {
5362
5379
  if ("undefined" != typeof self) return self;
5363
5380
  if ("undefined" != typeof window) return window;
5364
5381
  if ("undefined" != typeof global) return global;
5365
5382
  throw new Error("unable to locate global object");
5366
- }, kn = Dn(), zn = kn.gl_trans__coders = kn.gl_trans__coders || {};
5367
- zn.inject = function(t) {
5368
- const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = kn.gl_trans__coders = kn.gl_trans__coders || {};
5369
- let i = `${r}\n const _____getGlobal = ${Dn.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
5383
+ }, jn = zn(), Vn = jn.gl_trans__coders = jn.gl_trans__coders || {};
5384
+ Vn.inject = function(t) {
5385
+ const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = jn.gl_trans__coders = jn.gl_trans__coders || {};
5386
+ let i = `${r}\n const _____getGlobal = ${zn.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
5370
5387
  for (const t in s) "inject" !== t && "getTranscoder" !== t && "registerTranscoder" !== t && (i += 'tran_____scoders["' + t + '"] =' + s[t].toString() + "\n;");
5371
5388
  return i += "\n" + e.substring(r.length), i;
5372
- }, zn.registerTranscoder = function(t, e) {
5373
- zn[t] = e;
5374
- }, zn.getTranscoder = function(t) {
5375
- return zn[t];
5389
+ }, Vn.registerTranscoder = function(t, e) {
5390
+ Vn[t] = e;
5391
+ }, Vn.getTranscoder = function(t) {
5392
+ return Vn[t];
5376
5393
  };
5377
- class jn {
5394
+ class Gn {
5378
5395
  constructor(t, e, n) {
5379
- this.i = t, this.Y = e || Nt, this.o = n, this.tt = {
5380
- "image/crn": zn.crn && zn.crn(),
5381
- "image/ktx2": zn.ktx2 && zn.ktx2(),
5382
- "image/cttf": zn.ktx2 && zn.ktx2(),
5383
- "draco": zn.draco && zn.draco()
5396
+ this.i = t, this.Y = e || Pt, this.o = n, this.tt = {
5397
+ "image/crn": Vn.crn && Vn.crn(),
5398
+ "image/ktx2": Vn.ktx2 && Vn.ktx2(),
5399
+ "image/cttf": Vn.ktx2 && Vn.ktx2(),
5400
+ "draco": Vn.draco && Vn.draco()
5384
5401
  };
5385
5402
  }
5386
5403
  static createEmptyB3DM() {
@@ -5439,15 +5456,15 @@
5439
5456
  o = h, h = a, u = c, a = 0, c = 0);
5440
5457
  const l = [ t ];
5441
5458
  let d, m, y;
5442
- if (a > 0 ? (d = ae(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
5459
+ if (a > 0 ? (d = he(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
5443
5460
  "BATCH_LENGTH": o
5444
- }, c > 0 && (f += c), h > 0 && (m = ce(t, f, h), f += h, u > 0)) {
5445
- const e = he(0, f, u);
5461
+ }, c > 0 && (f += c), h > 0 && (m = ue(t, f, h), f += h, u > 0)) {
5462
+ const e = fe(0, f, u);
5446
5463
  y = t.slice(e.offset, e.offset + e.byteLength), f += u, l.push(y);
5447
5464
  }
5448
5465
  const b = d.BATCH_LENGTH, p = {};
5449
5466
  if (d && d.BATCH_ID) {
5450
- p.BATCH_ID = fe(d.BATCH_ID, t, (void 0).offset, b);
5467
+ p.BATCH_ID = de(d.BATCH_ID, t, (void 0).offset, b);
5451
5468
  const e = p.BATCH_ID.array && p.BATCH_ID.array.buffer;
5452
5469
  e && l.indexOf(e) < 0 && l.push(e);
5453
5470
  }
@@ -5469,13 +5486,13 @@
5469
5486
  return null;
5470
5487
  }
5471
5488
  }
5472
- class Vn {
5489
+ class Hn {
5473
5490
  constructor(t, e, n) {
5474
- this.i = t, this.Y = e || Nt, this.o = n, this.tt = {
5475
- "image/crn": zn.crn && zn.crn(),
5476
- "image/ktx2": zn.ktx2 && zn.ktx2(),
5477
- "image/cttf": zn.ktx2 && zn.ktx2(),
5478
- "draco": zn.draco && zn.draco()
5491
+ this.i = t, this.Y = e || Pt, this.o = n, this.tt = {
5492
+ "image/crn": Vn.crn && Vn.crn(),
5493
+ "image/ktx2": Vn.ktx2 && Vn.ktx2(),
5494
+ "image/cttf": Vn.ktx2 && Vn.ktx2(),
5495
+ "draco": Vn.draco && Vn.draco()
5479
5496
  };
5480
5497
  }
5481
5498
  load(t, e, n = 0, r = 0) {
@@ -5552,7 +5569,7 @@
5552
5569
  error: t
5553
5570
  };
5554
5571
  }
5555
- const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = be(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
5572
+ const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = we(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
5556
5573
  if (a.POSITION) {
5557
5574
  const {byteOffset: e} = a.POSITION;
5558
5575
  f.POSITION = {
@@ -5575,7 +5592,7 @@
5575
5592
  }, o.push(f.POSITION.array.buffer);
5576
5593
  }
5577
5594
  if (a.BATCH_ID) {
5578
- f.BATCH_ID = fe(a.BATCH_ID, t, c.offset, l);
5595
+ f.BATCH_ID = de(a.BATCH_ID, t, c.offset, l);
5579
5596
  const e = f.BATCH_ID.array && f.BATCH_ID.array.buffer;
5580
5597
  e && o.indexOf(e) < 0 && o.push(e);
5581
5598
  }
@@ -5646,26 +5663,26 @@
5646
5663
  }
5647
5664
  ct(t) {
5648
5665
  const e = t.length / 2, n = new Float32Array(3 * e), r = [];
5649
- for (let s = 0; s < e; s++) Gn(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
5666
+ for (let s = 0; s < e; s++) qn(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
5650
5667
  n[3 * s + 1] = r[1], n[3 * s + 2] = r[2];
5651
5668
  return n;
5652
5669
  }
5653
5670
  at(t, e, n) {
5654
- return ye(new Float32Array(t.length), t, e, n);
5671
+ return pe(new Float32Array(t.length), t, e, n);
5655
5672
  }
5656
5673
  rt() {
5657
5674
  return null;
5658
5675
  }
5659
5676
  }
5660
- function Gn(t, e, n, r) {
5661
- if (t[0] = Hn(e, r), t[1] = Hn(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
5677
+ function qn(t, e, n, r) {
5678
+ if (t[0] = $n(e, r), t[1] = $n(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
5662
5679
  t[2] < 0) {
5663
5680
  const e = t[0];
5664
- t[0] = (1 - Math.abs(t[1])) * qn(e), t[1] = (1 - Math.abs(e)) * qn(t[1]);
5681
+ t[0] = (1 - Math.abs(t[1])) * Jn(e), t[1] = (1 - Math.abs(e)) * Jn(t[1]);
5665
5682
  }
5666
5683
  return D(t, t);
5667
5684
  }
5668
- function Hn(t, e) {
5685
+ function $n(t, e) {
5669
5686
  return function(t, e, n) {
5670
5687
  return t < e ? e : t > n ? n : t;
5671
5688
  }(t, 0, e = function(t, e) {
@@ -5673,10 +5690,10 @@
5673
5690
  return e;
5674
5691
  }(e, 255)) / e * 2 - 1;
5675
5692
  }
5676
- function qn(t) {
5693
+ function Jn(t) {
5677
5694
  return t < 0 ? -1 : 1;
5678
5695
  }
5679
- class $n {
5696
+ class Kn {
5680
5697
  constructor() {}
5681
5698
  load(t, e, n = 0, r = 0) {
5682
5699
  return e ? (r || (r = e.byteLength), this.et(t, e, n, r)) : ft.getArrayBuffer(t, {}).then(e => {
@@ -5709,7 +5726,7 @@
5709
5726
  error: t
5710
5727
  };
5711
5728
  }
5712
- const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = be(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
5729
+ const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = we(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
5713
5730
  let m, y = {};
5714
5731
  if (a.extensions && a.extensions["3DTILES_draco_point_compression"]) {
5715
5732
  y = a.extensions["3DTILES_draco_point_compression"], m = new DataView(t, y.byteOffset + c.offset, y.byteLength);
@@ -5717,7 +5734,7 @@
5717
5734
  attributes: y.properties,
5718
5735
  useUniqueIDs: !1
5719
5736
  };
5720
- return this.ut || (this.ut = zn.draco()), this.ut(m, e).then(e => {
5737
+ return this.ut || (this.ut = Vn.draco()), this.ut(m, e).then(e => {
5721
5738
  const n = e.attributes;
5722
5739
  !a.POSITION && !a.POSITION_QUANTIZED || n.POSITION || n.POSITION_QUANTIZED || (n.POSITION = a.POSITION,
5723
5740
  n.POSITION_QUANTIZED = a.POSITION_QUANTIZED), !(a.RGB || a.RGBA || a.RGB565) || n.RGB || n.RGBA || n.RGB565 || (n.RGB = a.RGB,
@@ -5731,11 +5748,11 @@
5731
5748
  byteOffset: 0,
5732
5749
  itemSize: 1,
5733
5750
  count: t.length,
5734
- componentType: me(t.constructor),
5751
+ componentType: be(t.constructor),
5735
5752
  array: t
5736
5753
  }, o.push(t.buffer);
5737
5754
  } else if (a.BATCH_ID || Object.keys(h).length) {
5738
- a.BATCH_ID ? r.BATCH_ID = fe(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = Jn(d);
5755
+ a.BATCH_ID ? r.BATCH_ID = de(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = Xn(d);
5739
5756
  const e = r.BATCH_ID.array && r.BATCH_ID.array.buffer;
5740
5757
  e && o.indexOf(e) < 0 && o.push(e);
5741
5758
  }
@@ -5751,7 +5768,7 @@
5751
5768
  }
5752
5769
  const b = this.ft(t, a, c.offset, d, o, f, l);
5753
5770
  if (a.BATCH_ID || Object.keys(h).length) {
5754
- a.BATCH_ID ? b.BATCH_ID = fe(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = Jn(d);
5771
+ a.BATCH_ID ? b.BATCH_ID = de(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = Xn(d);
5755
5772
  const e = b.BATCH_ID.array && b.BATCH_ID.array.buffer;
5756
5773
  e && o.indexOf(e) < 0 && o.push(e);
5757
5774
  }
@@ -5880,13 +5897,13 @@
5880
5897
  return a;
5881
5898
  }
5882
5899
  at(t, e, n) {
5883
- return ye(new Float32Array(t.length), t, e, n);
5900
+ return pe(new Float32Array(t.length), t, e, n);
5884
5901
  }
5885
5902
  rt() {
5886
5903
  return null;
5887
5904
  }
5888
5905
  }
5889
- function Jn(t) {
5906
+ function Xn(t) {
5890
5907
  const e = v(t), n = new e(t);
5891
5908
  for (let e = 0; e < t; e++) n[e] = e;
5892
5909
  return {
@@ -5894,13 +5911,13 @@
5894
5911
  byteOffset: 0,
5895
5912
  itemSize: 1,
5896
5913
  count: t,
5897
- componentType: me(e),
5914
+ componentType: be(e),
5898
5915
  array: n
5899
5916
  };
5900
5917
  }
5901
- class Kn {
5918
+ class Wn {
5902
5919
  constructor(t, e) {
5903
- this.i = t, this.Y = e || Nt;
5920
+ this.i = t, this.Y = e || Pt;
5904
5921
  }
5905
5922
  load(t, e, n = 0, r = 0) {
5906
5923
  return e ? this.et(t, e, n, r) : ft.getArrayBuffer(t, {}).then(e => {
@@ -5913,12 +5930,12 @@
5913
5930
  const s = this.lt(e, t, n, r), i = [];
5914
5931
  for (let n = 0; n < s.length; n++) {
5915
5932
  let r;
5916
- if ("b3dm" === s[n].magic) r = new jn(this.i, this.Y); else if ("i3dm" === s[n].magic) r = new Vn(this.i, this.Y); else if ("pnts" === s[n].magic) r = new $n; else {
5933
+ if ("b3dm" === s[n].magic) r = new Gn(this.i, this.Y); else if ("i3dm" === s[n].magic) r = new Hn(this.i, this.Y); else if ("pnts" === s[n].magic) r = new Kn; else {
5917
5934
  if ("cmpt" !== s[n].magic) {
5918
5935
  console.warn("Unsupported magic in CMPT tile:", s[n].magic);
5919
5936
  continue;
5920
5937
  }
5921
- r = new Kn(this.i, this.Y);
5938
+ r = new Wn(this.i, this.Y);
5922
5939
  }
5923
5940
  i.push(r.load(t, e, s[n].offset, s[n].byteLength).then(t => t));
5924
5941
  }
@@ -5939,7 +5956,7 @@
5939
5956
  const o = [], a = s.getUint32(12, !0);
5940
5957
  let c = 16;
5941
5958
  for (let e = 0; e < a; e++) {
5942
- const e = ie(s, c), r = s.getUint32(c + 8, !0);
5959
+ const e = ae(s, c), r = s.getUint32(c + 8, !0);
5943
5960
  o.push({
5944
5961
  magic: e,
5945
5962
  buffer: t,
@@ -5950,9 +5967,9 @@
5950
5967
  return o;
5951
5968
  }
5952
5969
  }
5953
- t.B3DMLoader = jn, t.CMPTLoader = Kn, t.Geo3DTilesLayer = Ln, t.Geo3DTilesUtil = x,
5954
- t.Geo3DTransform = se, Object.defineProperty(t, "t", {
5970
+ t.B3DMLoader = Gn, t.CMPTLoader = Wn, t.Geo3DTilesLayer = Un, t.Geo3DTilesUtil = x,
5971
+ t.Geo3DTransform = oe, Object.defineProperty(t, "t", {
5955
5972
  value: !0
5956
5973
  });
5957
- })), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.12.3");
5974
+ })), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.12.4");
5958
5975
  }));