@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
  */
@@ -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