@maptalks/vt 0.117.0 → 0.117.1

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/vt v0.117.0
2
+ * @maptalks/vt v0.117.1
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2025 maptalks.org
5
5
  */
@@ -17435,7 +17435,7 @@ const As = o.ShaderLib.get("mesh_picking_vert"), Ts = o.WgslShaderLib.get("mesh_
17435
17435
  if (!this._ready) return null;
17436
17436
  const h = this.getMap(), {geometry: c} = e, {positionSize: u, features: f} = c;
17437
17437
  if (!c.data.aPosition || 0 === c.data.aPosition.length) return null;
17438
- "native-line" === this.dataConfig.type && this._arrangeAlongLine(0, c, r);
17438
+ "native-line" === this.dataConfig.type && this._arrangeAlongLine(0, c, r, f);
17439
17439
  const {aPosition: d} = c.data;
17440
17440
  let p = d.length / u;
17441
17441
  const g = {
@@ -17531,43 +17531,46 @@ const As = o.ShaderLib.get("mesh_picking_vert"), Ts = o.WgslShaderLib.get("mesh_
17531
17531
  positionSize: u
17532
17532
  }, S;
17533
17533
  }
17534
- _arrangeAlongLine(e, t) {
17535
- const {tileExtent: n, z: r} = t.properties, {data: o, positionSize: a} = t;
17536
- let l = this._calGLTFScale(e);
17537
- const h = this._getMeterScale();
17538
- l = s.scale([], l, h);
17539
- const c = {
17534
+ _arrangeAlongLine(e, t, n) {
17535
+ const {tileExtent: r, z: o} = t.properties, {data: a, positionSize: l} = t;
17536
+ let h = this._calGLTFScale(e);
17537
+ const c = this._getMeterScale();
17538
+ h = s.scale([], h, c);
17539
+ const u = {
17540
17540
  gapLength: this.dataConfig.gapLength || 0,
17541
17541
  direction: this.dataConfig.direction || 0,
17542
17542
  scaleVertex: !0
17543
- }, u = this._gltfPack[0][0], {aPosition: f, aAltitude: d, aPickingId: p} = o, g = new i(0, 0, 0), m = new i(0, 0, 0), y = [], x = d ? [] : y, _ = [], v = [], A = [], T = [], S = [], b = [], P = this.layer.getTileSize().width / n * this.layer.getRenderer().getTileGLScale(r), w = this.layer.getRenderer().getZScale();
17544
- let I = p[0];
17545
- for (let e = 0; e < f.length - a; e += a) {
17546
- const t = p[e / a + 1];
17547
- if (t !== I) {
17548
- I = t;
17543
+ }, f = this._gltfPack[0][0], {aPosition: d, aAltitude: p, aPickingId: g} = a, m = new i(0, 0, 0), y = new i(0, 0, 0), x = [], _ = p ? [] : x, v = [], A = [], T = [], S = [], b = [], P = [], w = this.layer.getTileSize().width / r * this.layer.getRenderer().getTileGLScale(o), I = this.layer.getRenderer().getZScale();
17544
+ let M = g[0];
17545
+ const C = [];
17546
+ for (let e = 0; e < d.length - l; e += l) {
17547
+ const t = g[e / l + 1];
17548
+ if (t !== M) {
17549
+ M = t;
17549
17550
  continue;
17550
17551
  }
17551
- d ? s.set(S, f[e], f[e + 1], d[e / a]) : Ss.unpackPosition(S, f[e], f[e + 1], f[e + 2]);
17552
- const [n, i, r] = S;
17553
- let o = e + a;
17554
- d ? s.set(b, f[o], f[o + 1], d[o / a]) : Ss.unpackPosition(b, f[o], f[o + 1], f[o + 2]);
17555
- const [h, M, C] = b, O = p[e / a], k = g.set(n * P, i * P, r * w), R = m.set(h * P, M * P, C * w), F = k.distanceTo(R), E = u.arrangeAlongLine(k, R, F, l, 1, c);
17556
- for (let e = 0; e < E.length; e++) {
17557
- const t = E[e];
17558
- g.set(n, i, r), m.set(h, M, C);
17559
- const o = zs(g, m, t.t);
17560
- y.push(o.x, o.y), x.push(o.z), _.push(O), v.push(-t.rotationZ * Math.PI / 180),
17561
- A.push(t.rotationXY * Math.PI / 180), T.push(...t.scale);
17552
+ p ? s.set(b, d[e], d[e + 1], p[e / l]) : Ss.unpackPosition(b, d[e], d[e + 1], d[e + 2]);
17553
+ const [i, r, o] = b;
17554
+ let a = e + l;
17555
+ p ? s.set(P, d[a], d[a + 1], p[a / l]) : Ss.unpackPosition(P, d[a], d[a + 1], d[a + 2]);
17556
+ const [c, O, k] = P, R = g[e / l], F = m.set(i * w, r * w, o * I), E = y.set(c * w, O * w, k * I), D = F.distanceTo(E);
17557
+ this._getSymbolRotationScaleMatrix(C, n, g, e / l);
17558
+ const H = f.arrangeAlongLine(F, E, D, h, 1, C, u);
17559
+ for (let e = 0; e < H.length; e++) {
17560
+ const t = H[e];
17561
+ m.set(i, r, o), y.set(c, O, k);
17562
+ const n = zs(m, y, t.t);
17563
+ x.push(n.x, n.y), _.push(n.z), v.push(R), A.push(-t.rotationZ * Math.PI / 180),
17564
+ T.push(t.rotationXY * Math.PI / 180), S.push(...t.scale);
17562
17565
  }
17563
17566
  }
17564
17567
  t.data = {
17565
- aPosition: new f.constructor(y),
17566
- aPickingId: new p.constructor(_),
17567
- aZRotation: v,
17568
- aXYRotation: A,
17569
- aScaleXYZ: T
17570
- }, d && (t.data.aAltitude = new d.constructor(x));
17568
+ aPosition: new d.constructor(x),
17569
+ aPickingId: new g.constructor(v),
17570
+ aZRotation: A,
17571
+ aXYRotation: T,
17572
+ aScaleXYZ: S
17573
+ }, p && (t.data.aAltitude = new p.constructor(_));
17571
17574
  }
17572
17575
  _calGLTFScale(e) {
17573
17576
  const t = this.getSymbols()[e], n = [ 1, 1, 1 ], i = t.modelHeight;
@@ -17673,17 +17676,23 @@ const As = o.ShaderLib.get("mesh_picking_vert"), Ts = o.WgslShaderLib.get("mesh_
17673
17676
  }
17674
17677
  return this._meterScale;
17675
17678
  }
17676
- _getSymbolTRSMatrix(e, t, n, i) {
17677
- const r = this.getMap(), o = this.symbolDef[0], a = this._getMeterScale();
17678
- let l = o.translationX || 0, h = o.translationY || 0, c = o.translationZ || 0, u = o.rotationX || 0, f = o.rotationY || 0, d = o.rotationZ || 0, p = o.scaleX || 1, g = o.scaleY || 1, m = o.scaleZ || 1;
17679
- const y = n && n[i], x = t && t[y], _ = r.getZoom(), v = x && x.feature && x.feature.properties, A = this._getModelHeightScale(_, v);
17680
- this._txFn && (l = this._txFn(_, v)), this._tyFn && (h = this._tyFn(_, v)), this._tzFn && (c = this._tzFn(_, v));
17681
- const T = s.set(Ps, l * a, h * a, c * a);
17682
- this._rxFn && (u = this._rxFn(_, v)), this._ryFn && (f = this._ryFn(_, v)), this._rzFn && (d = this._rzFn(_, v));
17683
- const S = s.set(ws, u, f, d);
17684
- this._sxFn && (p = this._sxFn(_, v)), this._syFn && (g = this._syFn(_, v)), this._szFn && (m = this._szFn(_, v));
17685
- const b = s.set(Is, p * A, g * A, m * A);
17686
- return this._getGLTFMatrix(e, T, S, b);
17679
+ _getSymbolRotationScaleMatrix(e, t, n, i) {
17680
+ return this._getSymbolTRSMatrix(e, t, n, i, !0);
17681
+ }
17682
+ _getSymbolTRSMatrix(e, t, n, i, r) {
17683
+ const o = this.getMap(), a = this.symbolDef[0], l = this._getMeterScale();
17684
+ let h = a.translationX || 0, c = a.translationY || 0, u = a.translationZ || 0;
17685
+ r && (h = c = u = 0);
17686
+ let f = a.rotationX || 0, d = a.rotationY || 0, p = a.rotationZ || 0, g = a.scaleX || 1, m = a.scaleY || 1, y = a.scaleZ || 1;
17687
+ const x = n && n[i], _ = t && t[x], v = o.getZoom(), A = _ && _.feature && _.feature.properties, T = this._getModelHeightScale(v, A);
17688
+ r || (this._txFn && (h = this._txFn(v, A)), this._tyFn && (c = this._tyFn(v, A)),
17689
+ this._tzFn && (u = this._tzFn(v, A)));
17690
+ const S = s.set(Ps, h * l, c * l, u * l);
17691
+ this._rxFn && (f = this._rxFn(v, A)), this._ryFn && (d = this._ryFn(v, A)), this._rzFn && (p = this._rzFn(v, A));
17692
+ const b = s.set(ws, f, d, p);
17693
+ this._sxFn && (g = this._sxFn(v, A)), this._syFn && (m = this._syFn(v, A)), this._szFn && (y = this._szFn(v, A));
17694
+ const P = s.set(Is, g * T, m * T, y * T);
17695
+ return this._getGLTFMatrix(e, S, b, P);
17687
17696
  }
17688
17697
  _getModelHeightScale(e, t) {
17689
17698
  const n = this.symbolDef[0];
@@ -20910,5 +20919,5 @@ if (r.transcoders) {
20910
20919
 
20911
20920
  export { la as BillBoardPainter, wa as BillBoardPlugin, Th as ExtrudePolygonLayer, Bn as FillPainter, fa as FillPlugin, Mh as FilterUtil, Ta as GLTFPhongPlugin, Sa as GLTFStandardPlugin, Oa as GeoJSONVectorTileLayer, ba as HeatmapPlugin, Wr as IconPainter, ga as IconPlugin, pa as LineGradientPlugin, Yn as LinePainter, da as LinePlugin, ll as LineStringLayer, va as LitPlugin, Ma as MapboxVectorTileLayer, Yo as NativeLinePainter, ya as NativeLinePlugin, Wo as NativePointPainter, Ih as PackUtil, cs as PhongPainter, xa as PhongPlugin, ol as PointLayer, sl as PointLayerRenderer, fl as PolygonLayer, Oh as SYMBOLS_NEED_REBUILD_IN_VECTOR, Ch as SYMBOLS_NEED_REBUILD_IN_VT, ua as TerrainFlatMaskPainter, Ia as TerrainFlatMaskPlugin, zo as TextPainter, ma as TextPlugin, Aa as TubePlugin, vt as Vector3DLayer, ft as VectorTileLayer, Qe as VectorTileLayerRenderer, Pa as WaterPlugin, fs as WireframePainter, _a as WireframePlugin, L as getVectorPacker };
20912
20921
 
20913
- "undefined" != typeof console && console.log("@maptalks/vt v0.117.0");
20922
+ "undefined" != typeof console && console.log("@maptalks/vt v0.117.1");
20914
20923
  //# sourceMappingURL=maptalks.vt.es.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.117.0
2
+ * @maptalks/vt v0.117.1
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2025 maptalks.org
5
5
  */
@@ -18768,7 +18768,7 @@
18768
18768
  if (!this._ready) return null;
18769
18769
  const s = this.getMap(), {geometry: l} = e, {positionSize: h, features: c} = l;
18770
18770
  if (!l.data.aPosition || 0 === l.data.aPosition.length) return null;
18771
- "native-line" === this.dataConfig.type && this._arrangeAlongLine(0, l, o);
18771
+ "native-line" === this.dataConfig.type && this._arrangeAlongLine(0, l, o, c);
18772
18772
  const {aPosition: u} = l.data;
18773
18773
  let f = u.length / h;
18774
18774
  const d = {
@@ -18864,43 +18864,46 @@
18864
18864
  positionSize: h
18865
18865
  }, A;
18866
18866
  }
18867
- _arrangeAlongLine(e, i) {
18868
- const {tileExtent: r, z: o} = i.properties, {data: a, positionSize: s} = i;
18869
- let l = this._calGLTFScale(e);
18870
- const h = this._getMeterScale();
18871
- l = n.vec3.scale([], l, h);
18872
- const c = {
18867
+ _arrangeAlongLine(e, i, r) {
18868
+ const {tileExtent: o, z: a} = i.properties, {data: s, positionSize: l} = i;
18869
+ let h = this._calGLTFScale(e);
18870
+ const c = this._getMeterScale();
18871
+ h = n.vec3.scale([], h, c);
18872
+ const u = {
18873
18873
  gapLength: this.dataConfig.gapLength || 0,
18874
18874
  direction: this.dataConfig.direction || 0,
18875
18875
  scaleVertex: !0
18876
- }, u = this._gltfPack[0][0], {aPosition: f, aAltitude: d, aPickingId: p} = a, g = new t.Coordinate(0, 0, 0), m = new t.Coordinate(0, 0, 0), y = [], x = d ? [] : y, _ = [], v = [], A = [], T = [], b = [], S = [], w = this.layer.getTileSize().width / r * this.layer.getRenderer().getTileGLScale(o), M = this.layer.getRenderer().getZScale();
18877
- let P = p[0];
18878
- for (let e = 0; e < f.length - s; e += s) {
18879
- const t = p[e / s + 1];
18880
- if (t !== P) {
18881
- P = t;
18876
+ }, f = this._gltfPack[0][0], {aPosition: d, aAltitude: p, aPickingId: g} = s, m = new t.Coordinate(0, 0, 0), y = new t.Coordinate(0, 0, 0), x = [], _ = p ? [] : x, v = [], A = [], T = [], b = [], S = [], w = [], M = this.layer.getTileSize().width / o * this.layer.getRenderer().getTileGLScale(a), P = this.layer.getRenderer().getZScale();
18877
+ let I = g[0];
18878
+ const C = [];
18879
+ for (let e = 0; e < d.length - l; e += l) {
18880
+ const t = g[e / l + 1];
18881
+ if (t !== I) {
18882
+ I = t;
18882
18883
  continue;
18883
18884
  }
18884
- d ? n.vec3.set(b, f[e], f[e + 1], d[e / s]) : Vs.unpackPosition(b, f[e], f[e + 1], f[e + 2]);
18885
- const [i, r, o] = b;
18886
- let a = e + s;
18887
- d ? n.vec3.set(S, f[a], f[a + 1], d[a / s]) : Vs.unpackPosition(S, f[a], f[a + 1], f[a + 2]);
18888
- const [h, I, C] = S, O = p[e / s], k = g.set(i * w, r * w, o * M), R = m.set(h * w, I * w, C * M), F = k.distanceTo(R), E = u.arrangeAlongLine(k, R, F, l, 1, c);
18889
- for (let e = 0; e < E.length; e++) {
18890
- const t = E[e];
18891
- g.set(i, r, o), m.set(h, I, C);
18892
- const n = nl(g, m, t.t);
18893
- y.push(n.x, n.y), x.push(n.z), _.push(O), v.push(-t.rotationZ * Math.PI / 180),
18894
- A.push(t.rotationXY * Math.PI / 180), T.push(...t.scale);
18885
+ p ? n.vec3.set(S, d[e], d[e + 1], p[e / l]) : Vs.unpackPosition(S, d[e], d[e + 1], d[e + 2]);
18886
+ const [i, o, a] = S;
18887
+ let s = e + l;
18888
+ p ? n.vec3.set(w, d[s], d[s + 1], p[s / l]) : Vs.unpackPosition(w, d[s], d[s + 1], d[s + 2]);
18889
+ const [c, O, k] = w, R = g[e / l], F = m.set(i * M, o * M, a * P), E = y.set(c * M, O * M, k * P), D = F.distanceTo(E);
18890
+ this._getSymbolRotationScaleMatrix(C, r, g, e / l);
18891
+ const H = f.arrangeAlongLine(F, E, D, h, 1, C, u);
18892
+ for (let e = 0; e < H.length; e++) {
18893
+ const t = H[e];
18894
+ m.set(i, o, a), y.set(c, O, k);
18895
+ const n = nl(m, y, t.t);
18896
+ x.push(n.x, n.y), _.push(n.z), v.push(R), A.push(-t.rotationZ * Math.PI / 180),
18897
+ T.push(t.rotationXY * Math.PI / 180), b.push(...t.scale);
18895
18898
  }
18896
18899
  }
18897
18900
  i.data = {
18898
- aPosition: new f.constructor(y),
18899
- aPickingId: new p.constructor(_),
18900
- aZRotation: v,
18901
- aXYRotation: A,
18902
- aScaleXYZ: T
18903
- }, d && (i.data.aAltitude = new d.constructor(x));
18901
+ aPosition: new d.constructor(x),
18902
+ aPickingId: new g.constructor(v),
18903
+ aZRotation: A,
18904
+ aXYRotation: T,
18905
+ aScaleXYZ: b
18906
+ }, p && (i.data.aAltitude = new p.constructor(_));
18904
18907
  }
18905
18908
  _calGLTFScale(e) {
18906
18909
  const t = this.getSymbols()[e], i = [ 1, 1, 1 ], r = t.modelHeight;
@@ -19006,17 +19009,23 @@
19006
19009
  }
19007
19010
  return this._meterScale;
19008
19011
  }
19009
- _getSymbolTRSMatrix(e, t, i, r) {
19010
- const o = this.getMap(), a = this.symbolDef[0], s = this._getMeterScale();
19011
- let l = a.translationX || 0, h = a.translationY || 0, c = a.translationZ || 0, u = a.rotationX || 0, f = a.rotationY || 0, d = a.rotationZ || 0, p = a.scaleX || 1, g = a.scaleY || 1, m = a.scaleZ || 1;
19012
- const y = i && i[r], x = t && t[y], _ = o.getZoom(), v = x && x.feature && x.feature.properties, A = this._getModelHeightScale(_, v);
19013
- this._txFn && (l = this._txFn(_, v)), this._tyFn && (h = this._tyFn(_, v)), this._tzFn && (c = this._tzFn(_, v));
19014
- const T = n.vec3.set(Gs, l * s, h * s, c * s);
19015
- this._rxFn && (u = this._rxFn(_, v)), this._ryFn && (f = this._ryFn(_, v)), this._rzFn && (d = this._rzFn(_, v));
19016
- const b = n.vec3.set(Bs, u, f, d);
19017
- this._sxFn && (p = this._sxFn(_, v)), this._syFn && (g = this._syFn(_, v)), this._szFn && (m = this._szFn(_, v));
19018
- const S = n.vec3.set(Ws, p * A, g * A, m * A);
19019
- return this._getGLTFMatrix(e, T, b, S);
19012
+ _getSymbolRotationScaleMatrix(e, t, n, i) {
19013
+ return this._getSymbolTRSMatrix(e, t, n, i, !0);
19014
+ }
19015
+ _getSymbolTRSMatrix(e, t, i, r, o) {
19016
+ const a = this.getMap(), s = this.symbolDef[0], l = this._getMeterScale();
19017
+ let h = s.translationX || 0, c = s.translationY || 0, u = s.translationZ || 0;
19018
+ o && (h = c = u = 0);
19019
+ let f = s.rotationX || 0, d = s.rotationY || 0, p = s.rotationZ || 0, g = s.scaleX || 1, m = s.scaleY || 1, y = s.scaleZ || 1;
19020
+ const x = i && i[r], _ = t && t[x], v = a.getZoom(), A = _ && _.feature && _.feature.properties, T = this._getModelHeightScale(v, A);
19021
+ o || (this._txFn && (h = this._txFn(v, A)), this._tyFn && (c = this._tyFn(v, A)),
19022
+ this._tzFn && (u = this._tzFn(v, A)));
19023
+ const b = n.vec3.set(Gs, h * l, c * l, u * l);
19024
+ this._rxFn && (f = this._rxFn(v, A)), this._ryFn && (d = this._ryFn(v, A)), this._rzFn && (p = this._rzFn(v, A));
19025
+ const S = n.vec3.set(Bs, f, d, p);
19026
+ this._sxFn && (g = this._sxFn(v, A)), this._syFn && (m = this._syFn(v, A)), this._szFn && (y = this._szFn(v, A));
19027
+ const w = n.vec3.set(Ws, g * T, m * T, y * T);
19028
+ return this._getGLTFMatrix(e, b, S, w);
19020
19029
  }
19021
19030
  _getModelHeightScale(e, t) {
19022
19031
  const n = this.symbolDef[0];
@@ -22808,6 +22817,6 @@
22808
22817
  e.SYMBOLS_NEED_REBUILD_IN_VT = Tf, e.TerrainFlatMaskPainter = Il, e.TerrainFlatMaskPlugin = Wl,
22809
22818
  e.TextPainter = ns, e.TextPlugin = Fl, e.TubePlugin = Nl, e.Vector3DLayer = fn,
22810
22819
  e.VectorTileLayer = rn, e.VectorTileLayerRenderer = Wt, e.WaterPlugin = Gl, e.WireframePainter = Cs,
22811
- e.WireframePlugin = Hl, e.getVectorPacker = h, "undefined" != typeof console && console.log("@maptalks/vt v0.117.0");
22820
+ e.WireframePlugin = Hl, e.getVectorPacker = h, "undefined" != typeof console && console.log("@maptalks/vt v0.117.1");
22812
22821
  }));
22813
22822
  //# sourceMappingURL=maptalks.vt.js.map