@maptalks/transform-control 0.8.0 → 0.83.0

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/transform-control v0.8.0
2
+ * @maptalks/transform-control v0.83.0
3
3
  * LICENSE : UNLICENSED
4
4
  * (c) 2016-2023 maptalks.org
5
5
  */
@@ -757,29 +757,33 @@ const w = {
757
757
  nodes: [ 0 ]
758
758
  } ]
759
759
  }
760
- }, B = [];
760
+ }, f = [];
761
761
 
762
- function f(s, i, n, o, I, r) {
763
- const a = [], h = A.fromEuler([], n[0], n[1], n[2]), g = t.fromRotationTranslationScale([], h, i, o), B = function(A) {
764
- return new c.GLTFLoader("", w[A]).load().then((A => A));
765
- }(s);
766
- return B.then((A => {
762
+ function B(s, i, n, o, I, r) {
763
+ const a = [], h = A.fromEuler([], n[0], n[1], n[2]), g = t.fromRotationTranslationScale([], h, i, o);
764
+ return function(A) {
765
+ return new c.GLTFLoader("", w[A]).load().then(A => A);
766
+ }(s).then(A => {
767
767
  const s = e.GLTFHelper.exportGLTFPack(A).getMeshesInfo(), h = new e.Material({
768
768
  color: I
769
769
  });
770
- s.forEach((A => {
770
+ s.forEach(A => {
771
771
  const s = new e.Mesh(A.geometry, h);
772
772
  s.setUniform("uPickingId", r);
773
773
  const c = s.getDefines();
774
774
  c.HAS_PICKING_ID = 2, s.setDefines(c), s.translate = i, s.rotation = n, s.scaling = o,
775
775
  t.multiply(s.localTransform, g, A.nodeMatrix), s.originTransform = t.copy([], s.localTransform),
776
776
  s.originColor = I, a.push(s);
777
- }));
778
- })), a;
777
+ });
778
+ }), a;
779
+ }
780
+
781
+ function C(A, t) {
782
+ return Math.abs(A) * Math.sign(t);
779
783
  }
780
784
 
781
- function C(A, e) {
782
- const i = A.getCoordinates(), n = e.coordinateToPointAtRes(i, e.getGLRes()), I = [ n.x, n.y, 0 ], r = A.getTranslation();
785
+ function P(A, e) {
786
+ const i = A.getCoordinates(), n = e.coordinateToPointAtRes(i, e.getGLRes()), I = [ n.x, n.y, 0 ], r = m(e, A.getTranslation());
783
787
  s.add(I, I, r);
784
788
  const a = function(A, t, e, s) {
785
789
  return A._pointAtResToContainerPoint(t, e, s);
@@ -788,11 +792,11 @@ function C(A, e) {
788
792
  const h = function(A, e, i, n) {
789
793
  if (n) {
790
794
  const I = i / A._getResolution(), r = A.width / 2, a = A.height / 2;
791
- B[0] = (e.x - r) / r, B[1] = e.y / a - 1, B[3] = n * I;
795
+ f[0] = (e.x - r) / r, f[1] = e.y / a - 1, f[3] = n * I;
792
796
  const h = t.invert([], A.projViewMatrix);
793
- s.transformMat4(B, B, h);
797
+ s.transformMat4(f, f, h);
794
798
  const g = A.getGLScale();
795
- return s.set(B, B[0] / g, B[1] / g, B[2] / g), s.scale(B, B, 1 / I), new o.Point(B[0], B[1]);
799
+ return s.set(f, f[0] / g, f[1] / g, f[2] / g), s.scale(f, f, 1 / I), new o.Point(f[0], f[1]);
796
800
  }
797
801
  {
798
802
  const t = A.containerPointToCoordinate(e);
@@ -802,7 +806,13 @@ function C(A, e) {
802
806
  return Math.sqrt(Math.pow(h.x - I[0], 2) + Math.pow(h.y - I[1], 2)) / 5.272881136101205;
803
807
  }
804
808
 
805
- class P {
809
+ function m(A, t) {
810
+ if (!A) return t;
811
+ const e = A.distanceToPointAtRes(t[0], t[1], A.getGLRes()), i = A.altitudeToPoint(t[2], A.getGLRes());
812
+ return s.set([], C(e.x, t[0]), C(e.y, t[1]), C(i, t[2]));
813
+ }
814
+
815
+ class u {
806
816
  constructor(A) {
807
817
  this.A = A, this._meshes = this.t();
808
818
  }
@@ -810,7 +820,7 @@ class P {
810
820
  this.A = A;
811
821
  }
812
822
  t() {
813
- const A = [], t = 340 / 177, e = f("jiantou", [ 1.2 * t, 0, 0 ], [ 0, 0, 90 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 7), s = f("jiantou", [ 0, 1.2 * t, 0 ], [ 0, 0, 180 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 8), i = f("jiantou", [ -1.2 * t, 0, 0 ], [ 0, 0, 270 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 9), n = f("jiantou", [ 0, -1.2 * t, 0 ], [ 0, 0, 0 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 10);
823
+ const A = [], t = 340 / 177, e = B("jiantou", [ 1.2 * t, 0, 0 ], [ 0, 0, 90 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 7), s = B("jiantou", [ 0, 1.2 * t, 0 ], [ 0, 0, 180 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 8), i = B("jiantou", [ -1.2 * t, 0, 0 ], [ 0, 0, 270 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 9), n = B("jiantou", [ 0, -1.2 * t, 0 ], [ 0, 0, 0 ], [ t, t, t ], [ 89 / 255, 206 / 255, 147 / 255, 0 ], 10);
814
824
  return A.push(e, s, i, n), A;
815
825
  }
816
826
  getMeshes() {
@@ -818,7 +828,7 @@ class P {
818
828
  }
819
829
  }
820
830
 
821
- class m {
831
+ class Q {
822
832
  constructor(A) {
823
833
  this.A = A, this._meshes = this.t();
824
834
  }
@@ -826,15 +836,15 @@ class m {
826
836
  this.A = A;
827
837
  }
828
838
  t() {
829
- const A = [], t = 340 / 177, e = f("xuanzhuan", [ 0, 0, 0 ], [ 180, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 50 / 255, 130 / 255, 184 / 255, .8 ], 11);
830
- return A.push(e), A;
839
+ const A = [], t = B("xuanzhuan", [ 0, 0, 0 ], [ 180, 0, 0 ], [ 340 / 177 * .5, 340 / 177 * .5, 340 / 177 * .5 ], [ 50 / 255, 130 / 255, 184 / 255, .8 ], 11);
840
+ return A.push(t), A;
831
841
  }
832
842
  getMeshes() {
833
843
  return this._meshes;
834
844
  }
835
845
  }
836
846
 
837
- class u {
847
+ class l {
838
848
  constructor(A) {
839
849
  this.A = A, this._meshes = this.t();
840
850
  }
@@ -842,15 +852,15 @@ class u {
842
852
  this.A = A;
843
853
  }
844
854
  t() {
845
- const A = [], t = 340 / 177, e = f("yuanhuan", [ 0, 0, 0 ], [ 0, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 149 / 255, 179 / 255, 199 / 255, .5 ], 12);
846
- return A.push(e), A;
855
+ const A = [], t = B("yuanhuan", [ 0, 0, 0 ], [ 0, 0, 0 ], [ 340 / 177 * .5, 340 / 177 * .5, 340 / 177 * .5 ], [ 149 / 255, 179 / 255, 199 / 255, .5 ], 12);
856
+ return A.push(t), A;
847
857
  }
848
858
  getMeshes() {
849
859
  return this._meshes;
850
860
  }
851
861
  }
852
862
 
853
- class Q {
863
+ class b {
854
864
  constructor(A) {
855
865
  this.A = A, this._meshes = this.t();
856
866
  }
@@ -858,7 +868,7 @@ class Q {
858
868
  this.A = A;
859
869
  }
860
870
  t() {
861
- const A = [], t = f("plane", [ 0, 0, 0 ], [ 0, 0, 0 ], [ 10, 10, 10 ], [ 1, 0, 0, .5 ], 16);
871
+ const A = [], t = B("plane", [ 0, 0, 0 ], [ 0, 0, 0 ], [ 10, 10, 10 ], [ 1, 0, 0, .5 ], 16);
862
872
  return A.push(t), A;
863
873
  }
864
874
  getMeshes() {
@@ -866,42 +876,42 @@ class Q {
866
876
  }
867
877
  }
868
878
 
869
- const l = [], b = [], y = [], v = [], M = [], E = [ 177 / 170, 177 / 170, 177 / 170 ], D = [ 1, 2, 3, 4, 12 ];
879
+ const y = [], v = [], M = [], E = [], D = [], p = [ 177 / 170, 177 / 170, 177 / 170 ], d = [ 1, 2, 3, 4, 12 ];
870
880
 
871
- class p {
881
+ class x {
872
882
  constructor() {
873
- this.translate = new P, this.rotation = new m, this.scaling = new u, this.planeHelper = new Q,
874
- this._meshes = this.t(), this.i = !0;
883
+ this.translate = new u, this.rotation = new Q, this.scaling = new l, this.planeHelper = new b,
884
+ this._meshes = this.t(), this.s = !0;
875
885
  }
876
886
  t() {
877
887
  const A = {};
878
888
  A.translate = this.translate.getMeshes(), A.rotation = this.rotation.getMeshes(),
879
889
  A.scaling = this.scaling.getMeshes(), A.planeHelper = this.planeHelper.getMeshes();
880
- const t = 340 / 177, e = f("yuanhuan41", [ -2.745 * t, 2.745 * t, 0 ], [ 90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 149 / 255, 179 / 255, 199 / 255, .6 ], 1), s = f("yuanhuan41", [ 2.745 * t, 2.745 * t, 0 ], [ -90, 0, 180 ], [ .5 * t, .5 * t, .5 * t ], [ 50 / 255, 130 / 255, 184 / 255, .5 ], 2), i = f("yuanhuan41", [ 2.745 * t, -2.745 * t, 0 ], [ 90, 0, 180 ], [ .5 * t, .5 * t, .5 * t ], [ 149 / 255, 179 / 255, 199 / 255, .6 ], 3), n = f("yuanhuan41", [ -2.745 * t, -2.745 * t, 0 ], [ -90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 50 / 255, 130 / 255, 184 / 255, .5 ], 4), o = f("yuanpan", [ 0, 0, 0 ], [ 90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 89 / 255, 206 / 255, 147 / 255, .5 ], 5), I = f("zzhou", [ 0, 0, 6.5 ], [ 90, 0, 0 ], [ 1, 1, 1 ], [ 14 / 255, 127 / 255, 191 / 255, 1 ], 6);
890
+ const t = 340 / 177, e = B("yuanhuan41", [ -2.745 * t, 2.745 * t, 0 ], [ 90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 149 / 255, 179 / 255, 199 / 255, .6 ], 1), s = B("yuanhuan41", [ 2.745 * t, 2.745 * t, 0 ], [ -90, 0, 180 ], [ .5 * t, .5 * t, .5 * t ], [ 50 / 255, 130 / 255, 184 / 255, .5 ], 2), i = B("yuanhuan41", [ 2.745 * t, -2.745 * t, 0 ], [ 90, 0, 180 ], [ .5 * t, .5 * t, .5 * t ], [ 149 / 255, 179 / 255, 199 / 255, .6 ], 3), n = B("yuanhuan41", [ -2.745 * t, -2.745 * t, 0 ], [ -90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 50 / 255, 130 / 255, 184 / 255, .5 ], 4), o = B("yuanpan", [ 0, 0, 0 ], [ 90, 0, 0 ], [ .5 * t, .5 * t, .5 * t ], [ 89 / 255, 206 / 255, 147 / 255, .5 ], 5), I = B("zzhou", [ 0, 0, 6.5 ], [ 90, 0, 0 ], [ 1, 1, 1 ], [ 14 / 255, 127 / 255, 191 / 255, 1 ], 6);
881
891
  return A.translate.push(e, s, i, n, o, I), A;
882
892
  }
883
893
  updateMatrix(e, i, n, o, I) {
884
894
  const r = i.getCoordinates(), a = e.coordinateToPointAtRes(r, e.getGLRes()), h = i.getPointZ();
885
- s.set(b, a.x, a.y, h);
886
- const g = s.copy(l, I), c = i.getTranslation();
887
- s.add(b, b, c), s.add(b, b, g);
895
+ s.set(v, a.x, a.y, h);
896
+ const g = s.copy(y, I), c = m(e, i.getTranslation());
897
+ s.add(v, v, c), s.add(v, v, g);
888
898
  for (const I in this._meshes) for (let r = 0; r < this._meshes[I].length; r++) {
889
899
  const a = this._meshes[I][r];
890
900
  for (let I = 0; I < a.length; I++) {
891
- const r = a[I], h = r.getUniform("uPickingId"), g = s.copy(l, r.translate), c = [ r.rotation[0], r.rotation[1], r.rotation[2] ], w = r.scaling;
892
- if (11 === h && (this.i ? (c[2] += n, r.rotation[2] += n) : this.i || (c[2] += n,
893
- r.rotation[2] += n, c[0] = 360, c[2] -= 90)), D.indexOf(h) > -1) if (12 !== h) w[0] += o,
901
+ const r = a[I], h = r.getUniform("uPickingId"), g = s.copy(y, r.translate), c = [ r.rotation[0], r.rotation[1], r.rotation[2] ], w = r.scaling;
902
+ if (11 === h && (this.s ? (c[2] += n, r.rotation[2] += n) : this.s || (c[2] += n,
903
+ r.rotation[2] += n, c[0] = 360, c[2] -= 90)), d.indexOf(h) > -1) if (12 !== h) w[0] += o,
894
904
  w[1] += o, w[2] += o; else {
895
905
  const A = this._meshes.translate[4][0];
896
906
  w[0] = 1.2 * A.scaling[0], w[1] = 1.2 * A.scaling[0], w[2] = 1.2 * A.scaling[0];
897
907
  }
898
- let B = C(i, e);
899
- if (B = s.set(y, B, B, B), s.multiply(g, g, B), s.multiply(B, B, w), 1 === h || 2 === h || 3 === h || 4 === h) {
900
- const A = s.multiply(M, w, E);
908
+ let f = P(i, e);
909
+ if (f = s.set(M, f, f, f), s.multiply(g, g, f), s.multiply(f, f, w), 1 === h || 2 === h || 3 === h || 4 === h) {
910
+ const A = s.multiply(D, w, p);
901
911
  s.multiply(g, g, A);
902
912
  }
903
- const f = A.fromEuler(v, c[0], c[1], c[2]);
904
- s.add(g, g, b), t.fromRotationTranslationScale(r.localTransform, f, g, B);
913
+ const B = A.fromEuler(E, c[0], c[1], c[2]);
914
+ s.add(g, g, v), t.fromRotationTranslationScale(r.localTransform, B, g, f);
905
915
  }
906
916
  }
907
917
  }
@@ -910,8 +920,8 @@ class p {
910
920
  return t.translate = this._meshes.translate, A && "translate" !== A && (t[A] = this._meshes[A]),
911
921
  t;
912
922
  }
913
- o(A) {
914
- this.i = A;
923
+ i(A) {
924
+ this.s = A;
915
925
  }
916
926
  dispose() {
917
927
  for (const A in this._meshes) for (let t = 0; t < this._meshes[A].length; t++) {
@@ -924,302 +934,303 @@ class p {
924
934
  }
925
935
  }
926
936
 
927
- const d = [ 5, 6, 7, 8, 9, 10 ], x = [ 5, 7, 8, 9, 10 ], F = [ 2, 4, 11 ], U = [ 1, 3, 12 ], k = [ 12, 16 ], L = [ 1, 2, 3, 4 ], V = [ 1, 2, 3, 4, 12 ], O = [], S = [], H = [], N = [], T = [], K = [], _ = [];
937
+ const F = [ 5, 6, 7, 8, 9, 10 ], U = [ 5, 7, 8, 9, 10 ], k = [ 2, 4, 11 ], L = [ 1, 3, 12 ], V = [ 12, 16 ], O = [ 1, 2, 3, 4 ], S = [ 1, 2, 3, 4, 12 ], H = [], N = [], T = [], K = [], _ = [], R = [], G = [];
928
938
 
929
- class R extends(I(r(a))){
939
+ class j extends(I(r(a))){
930
940
  constructor(A) {
931
- super(A), this.options = A, this.mouseAction = "moving", this.I = "translate", this.h = !0,
932
- this.TransformHelper = new p, this.helperScene = new e.Scene([]), this.addToMapCount = 0;
941
+ super(A), this.options = A, this.mouseAction = "moving", this.o = "translate", this.I = !0,
942
+ this.TransformHelper = new x, this.helperScene = new e.Scene([]), this.addToMapCount = 0;
933
943
  }
934
944
  enable() {
935
- return this.h = !0, this.layerRenderer && this.layerRenderer.setToRedraw(), this;
945
+ return this.I = !0, this.layerRenderer && this.layerRenderer.setToRedraw(), this;
936
946
  }
937
947
  disable() {
938
- return this.h = !1, this.layerRenderer && this.layerRenderer.setToRedraw(), this.map && this.map.resetCursor(),
948
+ return this.I = !1, this.layerRenderer && this.layerRenderer.setToRedraw(), this.map && this.map.resetCursor(),
939
949
  this;
940
950
  }
941
951
  isEnable() {
942
- return this.h;
952
+ return this.I;
943
953
  }
944
- g(A) {
945
- d.indexOf(A) > -1 ? this.I = "translate" : F.indexOf(A) > -1 ? this.I = "rotation" : U.indexOf(A) > -1 ? this.I = "scaling" : this.I = "translate";
954
+ h(A) {
955
+ F.indexOf(A) > -1 ? this.o = "translate" : k.indexOf(A) > -1 ? this.o = "rotation" : L.indexOf(A) > -1 ? this.o = "scaling" : this.o = "translate";
946
956
  }
947
- B() {
948
- return this.I;
957
+ g() {
958
+ return this.o;
949
959
  }
950
960
  addTo(A) {
951
- this.map && (this.C(), console.warn("transform control has been added to a map, it suggest remove from the map before")),
952
- this.addToMapCount++, this.map = A, this.container = A.getContainer(), A.on("dom:mousemove", this.P, this),
953
- A.on("dom:mousedown", this.m, this), A.on("dom:mouseup", this.u, this), A.on("zooming moving dragrotating", this.l, this),
954
- this.v();
961
+ this.map && (this.B(), console.warn("transform control has been added to a map, it suggest remove from the map before")),
962
+ this.addToMapCount++, this.map = A, this.container = A.getContainer(), A.on("dom:mousemove", this.C, this),
963
+ A.on("dom:mousedown", this.P, this), A.on("dom:mouseup", this.m, this), A.on("zooming moving dragrotating", this.u, this),
964
+ this.l();
955
965
  }
956
966
  remove() {
957
- this.map && this.container && this.layerRenderer && (this.C(), this.TransformHelper.dispose(),
967
+ this.map && this.container && this.layerRenderer && (this.B(), this.TransformHelper.dispose(),
958
968
  this.layerRenderer.setToRedraw(), delete this.map, delete this.layer, delete this.layerRenderer,
959
- delete this.container, delete this.M);
969
+ delete this.container, delete this.v);
960
970
  }
961
- C() {
962
- this.container && this.map && (this.map.off("mousemove", this.P, this), this.map.off("mousedown", this.m, this),
963
- this.map.off("mouseup", this.u, this), this.map.off("zooming moving dragrotating", this.l, this),
971
+ B() {
972
+ this.container && this.map && (this.map.off("mousemove", this.C, this), this.map.off("mousedown", this.P, this),
973
+ this.map.off("mouseup", this.m, this), this.map.off("zooming moving dragrotating", this.u, this),
964
974
  this.layer && this.layer.off("renderend", this.render, this));
965
975
  }
966
- P(A) {
967
- if (this.D()) {
976
+ C(A) {
977
+ if (this.M()) {
968
978
  if (this.currentMousePosition = {
969
979
  x: A.containerPoint.x,
970
980
  y: A.containerPoint.y
971
981
  }, "moving" === this.mouseAction) {
972
- const A = this.p();
973
- this.currentPickingObject = this.F(this.currentMousePosition, A, "meshes"), this.currentPickingObject && null != this.currentPickingObject.pickingId ? (this.g(this.currentPickingObject.pickingId),
974
- 6 === this.currentPickingObject.pickingId ? this.U(!0) : this.U(!1)) : (this.U(!1),
975
- this.g()), this.k();
982
+ const A = this.D();
983
+ this.currentPickingObject = this.p(this.currentMousePosition, A, "meshes"), this.currentPickingObject && null != this.currentPickingObject.pickingId ? (this.h(this.currentPickingObject.pickingId),
984
+ 6 === this.currentPickingObject.pickingId ? this.F(!0) : this.F(!1)) : (this.F(!1),
985
+ this.h()), this.U();
976
986
  }
977
- this.L(this.currentMousePosition);
987
+ this.k(this.currentMousePosition);
978
988
  }
979
989
  }
980
- m(A) {
981
- if (!this.D()) return;
982
- const t = this.p();
990
+ P(A) {
991
+ if (!this.M()) return;
992
+ const t = this.D();
983
993
  this.currentMousePosition = {
984
994
  x: A.containerPoint.x,
985
995
  y: A.containerPoint.y
986
- }, this.V = !0, this.currentPickingObject = this.F(this.currentMousePosition, t, "meshes"),
987
- this.firstDownPoint = this.F(this.currentMousePosition, t, "meshes"), this.currentPickingObject && null != this.currentPickingObject.meshId ? (this.mouseAction = "transform",
988
- this.O(this.currentPickingObject.pickingId), this.map.config("zoomable", !1), this.map.config("draggable", !1),
996
+ }, this.L = !0, this.currentPickingObject = this.p(this.currentMousePosition, t, "meshes"),
997
+ this.firstDownPoint = this.p(this.currentMousePosition, t, "meshes"), this.currentPickingObject && null != this.currentPickingObject.meshId ? (this.mouseAction = "transform",
998
+ this.V(this.currentPickingObject.pickingId), this.map.config("zoomable", !1), this.map.config("draggable", !1),
989
999
  this.layerRenderer && this.layerRenderer.setToRedraw()) : (this.mouseAction = "pan",
990
- this.map.config("zoomable", !0), this.map.config("draggable", !0), this.S()), this.lastMousePosition = this.currentMousePosition,
1000
+ this.map.config("zoomable", !0), this.map.config("draggable", !0), this.O()), this.lastMousePosition = this.currentMousePosition,
991
1001
  this.lastPickingObject = this.currentPickingObject, this.lastPickingMesh = t[this.currentPickingObject.meshId];
992
1002
  }
993
- u() {
994
- "transform" === this.mouseAction && (this.firstDownPoint = null, this.S(), this.V = !0,
1003
+ m() {
1004
+ "transform" === this.mouseAction && (this.firstDownPoint = null, this.O(), this.L = !0,
995
1005
  this.fire("transformend", {
996
- action: this.H,
1006
+ action: this.S,
997
1007
  type: "transformend"
998
- })), this.mouseAction = "moving", this.I = "translate", this.map.config("zoomable", !0),
1008
+ })), this.mouseAction = "moving", this.o = "translate", this.map.config("zoomable", !0),
999
1009
  this.map.config("draggable", !0), this.layerRenderer && this.layerRenderer.setToRedraw();
1000
1010
  }
1001
- l() {
1011
+ u() {
1002
1012
  const A = this.TransformHelper.planeHelper.getMeshes()[0][0], t = this.map.getBearing();
1003
- A.rotation[2] = -t, this.N();
1013
+ A.rotation[2] = -t, this.H();
1004
1014
  }
1005
- N() {
1006
- this.D() && (this.TransformHelper.updateMatrix(this.map, this.M, 0, 0, [ 0, 0, 0 ]),
1007
- this.V = !0);
1015
+ H() {
1016
+ this.M() && (this.TransformHelper.updateMatrix(this.map, this.v, 0, 0, [ 0, 0, 0 ]),
1017
+ this.L = !0);
1008
1018
  }
1009
1019
  picked(A) {
1010
1020
  if (!this.layerRenderer) return !1;
1011
- const t = this.p(), e = this.map;
1021
+ const t = this.D(), e = this.map;
1012
1022
  let s = A;
1013
1023
  A instanceof h || (s = e.coordinateToContainerPoint(new g(A)));
1014
- const i = this.F(s, t, "picked");
1024
+ const i = this.p(s, t, "picked");
1015
1025
  return !(!i || null === i.meshId);
1016
1026
  }
1017
- S() {
1018
- const A = this.TransformHelper.getMeshes("scaling").scaling[0][0], t = 340 / 177;
1019
- A.scaling = [ .6 * t, .6 * t, .6 * t ], this.layerRenderer && (this.T(A), this.K());
1027
+ O() {
1028
+ const A = this.TransformHelper.getMeshes("scaling").scaling[0][0];
1029
+ A.scaling = [ 340 / 177 * .6, 340 / 177 * .6, 340 / 177 * .6 ], this.layerRenderer && (this.N(A),
1030
+ this.T());
1020
1031
  }
1021
- K() {
1022
- this.TransformHelper._meshes.translate.forEach((A => {
1032
+ T() {
1033
+ this.TransformHelper._meshes.translate.forEach(A => {
1023
1034
  for (let t = 0; t < A.length; t++) {
1024
1035
  const e = A[t];
1025
- L.indexOf(e.getUniform("uPickingId")) > -1 && e.material.set("color", e.originColor);
1036
+ O.indexOf(e.getUniform("uPickingId")) > -1 && e.material.set("color", e.originColor);
1026
1037
  }
1027
- }));
1038
+ });
1028
1039
  }
1029
- T(e) {
1030
- const i = this.M.getCoordinates(), n = this.map.coordinateToPointAtRes(i, this.map.getGLRes()), o = [ n.x, n.y, 0 ], I = this.M.getTranslation();
1040
+ N(e) {
1041
+ const i = this.v.getCoordinates(), n = this.map.coordinateToPointAtRes(i, this.map.getGLRes()), o = [ n.x, n.y, 0 ], I = m(this.map, this.v.getTranslation());
1031
1042
  s.add(o, o, I);
1032
1043
  const r = s.copy([], e.translate), a = e.scaling;
1033
- let h = C(this.M, this.map);
1044
+ let h = P(this.v, this.map);
1034
1045
  h = s.set([], h, h, h), s.multiply(r, r, h), s.multiply(h, h, a), s.add(r, r, o),
1035
1046
  t.fromRotationTranslationScale(e.localTransform, [ 0, 0, 0, 1 ], r, h);
1036
- this.p().forEach((e => {
1047
+ this.D().forEach(e => {
1037
1048
  const i = e.getUniform("uPickingId");
1038
1049
  if (1 === i || 3 === i || 2 === i || 4 === i) {
1039
1050
  const i = s.copy([], e.translate), n = 170 / 177;
1040
1051
  e.scaling = [ n, n, n ];
1041
1052
  const I = e.scaling, r = e.rotation;
1042
- let a = C(this.M, this.map);
1053
+ let a = P(this.v, this.map);
1043
1054
  a = s.set([], a, a, a), s.multiply(i, i, a), s.multiply(a, a, I), s.add(i, i, o);
1044
1055
  const h = A.fromEuler([], r[0], r[1], r[2]);
1045
1056
  t.fromRotationTranslationScale(e.localTransform, h, i, a);
1046
1057
  }
1047
- }));
1058
+ });
1048
1059
  }
1049
- _(A) {
1060
+ K(A) {
1050
1061
  const t = this.map.containerPointToCoordinate(A), e = this.map.coordinateToPointAtRes(t, this.map.getGLRes());
1051
1062
  return {
1052
1063
  point: [ e.x, e.y ]
1053
1064
  };
1054
1065
  }
1055
- L(A) {
1066
+ k(A) {
1056
1067
  if ("transform" === this.mouseAction) {
1057
- const A = this.B(), t = this.M.getTranslation(), e = this.M.getPointZ(), n = this.M.getCoordinates(), o = this.map.coordinateToPointAtRes(n, this.map.getGLRes()), I = this.M.getRotation(), r = this.M.getScale();
1068
+ const A = this.g(), t = m(this.map, this.v.getTranslation()), e = this.v.getPointZ(), n = this.v.getCoordinates(), o = this.map.coordinateToPointAtRes(n, this.map.getGLRes()), I = this.v.getRotation(), r = this.v.getScale();
1058
1069
  let a = null, c = null;
1059
- if (t[2] + e < .01 && "z-translate" !== this.H) a = this._(this.currentMousePosition),
1060
- c = this._(this.lastMousePosition); else {
1070
+ if (t[2] + e < .01 && "z-translate" !== this.S) a = this.K(this.currentMousePosition),
1071
+ c = this.K(this.lastMousePosition); else {
1061
1072
  const A = this.TransformHelper.planeHelper.getMeshes()[0];
1062
- if (a = this.F(this.currentMousePosition, A, "plane"), c = this.F(this.lastMousePosition, A, "plane"),
1073
+ if (a = this.p(this.currentMousePosition, A, "plane"), c = this.p(this.lastMousePosition, A, "plane"),
1063
1074
  !a || null === a.meshId || !c || null === c.meshId) return;
1064
1075
  }
1065
- const w = [ 0, 0, 0 ], B = [ 0, 0, 0 ];
1066
- let f = 0, C = 0, P = 0;
1076
+ const w = [ 0, 0, 0 ], f = [ 0, 0, 0 ];
1077
+ let B = 0, C = 0, P = 0;
1067
1078
  if ("translate" === A) {
1068
- if ("xy-translate" === this.H) {
1079
+ if ("xy-translate" === this.S) {
1069
1080
  const A = a.point[0] - c.point[0], t = a.point[1] - c.point[1];
1070
1081
  w[0] = A, w[1] = t;
1071
- } else if ("x-translate" === this.H) {
1082
+ } else if ("x-translate" === this.S) {
1072
1083
  const A = a.point[0] - c.point[0];
1073
1084
  w[0] = A;
1074
- } else if ("y-translate" === this.H) {
1085
+ } else if ("y-translate" === this.S) {
1075
1086
  const A = a.point[1] - c.point[1];
1076
1087
  w[1] = A;
1077
- } else if ("z-translate" === this.H) {
1088
+ } else if ("z-translate" === this.S) {
1078
1089
  let A = 0;
1079
- if (this.R()) {
1080
- const t = this.map.getGLRes(), e = this.map._pointAtResToContainerPoint(new h(c.point[0], c.point[1]), t), s = this.map._pointAtResToContainerPoint(new h(a.point[0], a.point[1]), t), n = i.length(i.set(N, a.point[0] - c.point[0], a.point[1] - c.point[1]));
1090
+ if (this._()) {
1091
+ const t = this.map.getGLRes(), e = this.map._pointAtResToContainerPoint(new h(c.point[0], c.point[1]), t), s = this.map._pointAtResToContainerPoint(new h(a.point[0], a.point[1]), t), n = i.length(i.set(K, a.point[0] - c.point[0], a.point[1] - c.point[1]));
1081
1092
  A = s.y < e.y ? n : -n;
1082
1093
  } else A = a.point[2] - c.point[2];
1083
1094
  w[2] = Math.sign(A) * this.map.pointAtResToAltitude(A, this.map.getGLRes());
1084
1095
  }
1085
- } else if ("rotation" === A) C = this.G(a.point, c.point), C >= 0 ? this.TransformHelper.o(!0) : this.TransformHelper.o(!1),
1086
- B[2] += C; else if ("scaling" === A) {
1087
- const A = this.j(), t = i.length(i.set(N, this.firstDownPoint.point[0] - A[0], this.firstDownPoint.point[1] - A[1])), e = i.length(i.set(N, c.point[0] - A[0], c.point[1] - A[1]));
1088
- f = this.Z(a.point, c.point, A, e, r), P = this.Z(a.point, c.point, A, t);
1096
+ } else if ("rotation" === A) C = this.R(a.point, c.point), C >= 0 ? this.TransformHelper.i(!0) : this.TransformHelper.i(!1),
1097
+ f[2] += C; else if ("scaling" === A) {
1098
+ const A = this.G(), t = i.length(i.set(K, this.firstDownPoint.point[0] - A[0], this.firstDownPoint.point[1] - A[1])), e = i.length(i.set(K, c.point[0] - A[0], c.point[1] - A[1]));
1099
+ B = this.j(a.point, c.point, A, e, r), P = this.j(a.point, c.point, A, t);
1089
1100
  }
1090
- const m = s.set([], o.x, o.y, n.z || 0), u = s.add(m, m, w), Q = this.map.pointAtResToCoordinate(new g(u[0], u[1]), this.map.getGLRes());
1091
- Q.z = u[2];
1092
- let l = null;
1093
- l = f >= 0 ? f : f * (this.options && this.options.scaleStrength || 1);
1094
- const b = s.add(r, s.set(N, l, l * (r[1] / r[0]), l * (r[2] / r[0])), r);
1095
- if (Math.min(...b) < .01) {
1101
+ const u = s.set([], o.x, o.y, n.z || 0), Q = s.add(u, u, w), l = this.map.pointAtResToCoordinate(new g(Q[0], Q[1]), this.map.getGLRes());
1102
+ l.z = Q[2];
1103
+ let b = null;
1104
+ b = B >= 0 ? B : B * (this.options && this.options.scaleStrength || 1);
1105
+ const y = s.add(r, s.set(K, b, b * (r[1] / r[0]), b * (r[2] / r[0])), r);
1106
+ if (Math.min(...y) < .01) {
1096
1107
  const A = Math.min(...r);
1097
- b[0] = r[0] * (.01 / A), b[1] = r[1] * (.01 / A), b[2] = r[2] * (.01 / A);
1108
+ y[0] = r[0] * (.01 / A), y[1] = r[1] * (.01 / A), y[2] = r[2] * (.01 / A);
1098
1109
  }
1099
- const y = s.add(I, B, I);
1100
- this.TransformHelper.updateMatrix(this.map, this.M, C, P, w), this.H.indexOf("translate") > -1 ? this.fire("positionchange", {
1101
- action: this.H,
1110
+ const v = s.add(I, f, I);
1111
+ this.TransformHelper.updateMatrix(this.map, this.v, C, P, w), this.S.indexOf("translate") > -1 ? this.fire("positionchange", {
1112
+ action: this.S,
1102
1113
  type: "positionchange",
1103
- target: this.M,
1104
- coordinate: Q
1114
+ target: this.v,
1115
+ coordinate: l
1105
1116
  }) : this.fire("transforming", {
1106
- action: this.H,
1117
+ action: this.S,
1107
1118
  type: "transforming",
1108
- target: this.M,
1119
+ target: this.v,
1109
1120
  translate: t,
1110
- rotation: y,
1111
- scale: b
1121
+ rotation: v,
1122
+ scale: y
1112
1123
  });
1113
1124
  }
1114
1125
  this.lastMousePosition = A, this.lastPickingObject = this.currentPickingObject;
1115
- const t = this.p();
1126
+ const t = this.D();
1116
1127
  this.lastPickingMesh = t[this.currentPickingObject.meshId];
1117
1128
  }
1118
- Z(A, t, e, s, n) {
1119
- const o = (i.length(i.set(N, A[0] - e[0], A[1] - e[1])) - i.length(i.set(N, t[0] - e[0], t[1] - e[1]))) / s;
1129
+ j(A, t, e, s, n) {
1130
+ const o = (i.length(i.set(K, A[0] - e[0], A[1] - e[1])) - i.length(i.set(K, t[0] - e[0], t[1] - e[1]))) / s;
1120
1131
  return n ? (n[0] - .01) * o : o;
1121
1132
  }
1122
- j() {
1123
- const A = this.map, t = this.M.getCoordinates(), e = A.coordinateToPointAtRes(t, A.getGLRes()), i = s.set(T, e.x, e.y, 0), n = this.M.getTranslation();
1133
+ G() {
1134
+ const A = this.map, t = this.v.getCoordinates(), e = A.coordinateToPointAtRes(t, A.getGLRes()), i = s.set(_, e.x, e.y, 0), n = m(A, this.v.getTranslation());
1124
1135
  return s.add(i, i, n), i;
1125
1136
  }
1126
- U(e) {
1127
- const i = this.TransformHelper.planeHelper.getMeshes()[0][0], n = t.getTranslation(H, i.localTransform), o = t.getScaling(S, i.localTransform);
1128
- let I = A.fromEuler(O, 0, 0, 0);
1137
+ F(e) {
1138
+ const i = this.TransformHelper.planeHelper.getMeshes()[0][0], n = t.getTranslation(T, i.localTransform), o = t.getScaling(N, i.localTransform);
1139
+ let I = A.fromEuler(H, 0, 0, 0);
1129
1140
  const r = this.map.getBearing();
1130
- e && !this.R() ? (I = A.fromEuler(O, 90, 0, -r), 0 === i.rotation[0] && (this.V = !0),
1131
- s.set(i.rotation, 90, 0, -r)) : (90 === i.rotation[0] && (this.V = !0), s.set(i.rotation, 0, 0, -r)),
1141
+ e && !this._() ? (I = A.fromEuler(H, 90, 0, -r), 0 === i.rotation[0] && (this.L = !0),
1142
+ s.set(i.rotation, 90, 0, -r)) : (90 === i.rotation[0] && (this.L = !0), s.set(i.rotation, 0, 0, -r)),
1132
1143
  t.fromRotationTranslationScale(i.localTransform, I, n, o);
1133
1144
  }
1134
- R() {
1145
+ _() {
1135
1146
  if (this.map.getPitch()) return !1;
1136
1147
  const A = this.map.cameraPosition, t = this.map.coordinateToPointAtRes(this.map.getCenter(), this.map.getGLRes());
1137
1148
  s.set(t, t.x, t.y, 0);
1138
- const e = this.M.getCoordinates(), i = this.map.coordinateToPointAtRes(e, this.map.getGLRes()), n = this.M.getTranslation(), o = s.set(H, i.x, i.y, 0), I = s.add(o, o, n), r = s.subtract([], A, I), a = s.subtract([], A, t);
1149
+ const e = this.v.getCoordinates(), i = this.map.coordinateToPointAtRes(e, this.map.getGLRes()), n = m(this.map, this.v.getTranslation()), o = s.set(T, i.x, i.y, 0), I = s.add(o, o, n), r = s.subtract([], A, I), a = s.subtract([], A, t);
1139
1150
  return s.angle(r, a) < 1 / 180 * Math.PI;
1140
1151
  }
1141
- k() {
1142
- const A = this.p();
1152
+ U() {
1153
+ const A = this.D();
1143
1154
  if (this.currentPickingObject && null != this.currentPickingObject.meshId) {
1144
- this.J(), this.lastPickingObject && null != this.lastPickingObject.meshId && this.lastPickingObject.meshId !== this.currentPickingObject.meshId && this.Y();
1155
+ this.Z(), this.lastPickingObject && null != this.lastPickingObject.meshId && this.lastPickingObject.meshId !== this.currentPickingObject.meshId && this.J();
1145
1156
  const t = A[this.currentPickingObject.meshId];
1146
- if (t && k.indexOf(this.currentPickingObject.pickingId) < 0) {
1157
+ if (t && V.indexOf(this.currentPickingObject.pickingId) < 0) {
1147
1158
  const A = [ t.originColor[0], t.originColor[1], t.originColor[2], .8 ];
1148
- t.material.set("color", A), this.W(t, .5);
1159
+ t.material.set("color", A), this.Y(t, .5);
1149
1160
  }
1150
1161
  this.layerRenderer.setToRedraw();
1151
1162
  } else this.lastPickingObject && null != this.lastPickingObject.meshId && (this.map.resetCursor(),
1152
- this.Y(), this.layerRenderer.setToRedraw());
1163
+ this.J(), this.layerRenderer.setToRedraw());
1153
1164
  }
1154
- J() {
1155
- 6 === this.currentPickingObject.pickingId ? this.map.setCursor("ns-resize") : x.indexOf(this.currentPickingObject.pickingId) > -1 ? this.map.setCursor("move") : this.map.setCursor("pointer");
1165
+ Z() {
1166
+ 6 === this.currentPickingObject.pickingId ? this.map.setCursor("ns-resize") : U.indexOf(this.currentPickingObject.pickingId) > -1 ? this.map.setCursor("move") : this.map.setCursor("pointer");
1156
1167
  }
1157
- Y() {
1168
+ J() {
1158
1169
  const A = this.lastPickingMesh;
1159
1170
  if (!A) return;
1160
- const t = A.getUniform("uPickingId"), e = this.p();
1161
- x.indexOf(t) > -1 ? e.forEach((A => {
1162
- x.indexOf(A.getUniform("uPickingId")) > -1 && A.material.set("color", A.originColor);
1163
- })) : V.indexOf(t) > -1 ? e.forEach((A => {
1171
+ const t = A.getUniform("uPickingId"), e = this.D();
1172
+ U.indexOf(t) > -1 ? e.forEach(A => {
1173
+ U.indexOf(A.getUniform("uPickingId")) > -1 && A.material.set("color", A.originColor);
1174
+ }) : S.indexOf(t) > -1 ? e.forEach(A => {
1164
1175
  const t = A.getUniform("uPickingId");
1165
- L.indexOf(t) > -1 && A.material.set("color", A.originColor);
1166
- })) : 11 === t && e.forEach((A => {
1167
- L.indexOf(A.getUniform("uPickingId")) > -1 && A.material.set("color", A.originColor);
1168
- })), A.material.set("color", A.originColor);
1169
- }
1170
- W(A, t) {
1171
- const e = A.getUniform("uPickingId"), s = this.p();
1172
- x.indexOf(e) > -1 ? s.forEach((e => {
1173
- if (x.indexOf(e.getUniform("uPickingId")) > -1 && e.getUniform("uPickingId") !== A.getUniform("uPickingId")) {
1176
+ O.indexOf(t) > -1 && A.material.set("color", A.originColor);
1177
+ }) : 11 === t && e.forEach(A => {
1178
+ O.indexOf(A.getUniform("uPickingId")) > -1 && A.material.set("color", A.originColor);
1179
+ }), A.material.set("color", A.originColor);
1180
+ }
1181
+ Y(A, t) {
1182
+ const e = A.getUniform("uPickingId"), s = this.D();
1183
+ U.indexOf(e) > -1 ? s.forEach(e => {
1184
+ if (U.indexOf(e.getUniform("uPickingId")) > -1 && e.getUniform("uPickingId") !== A.getUniform("uPickingId")) {
1174
1185
  const A = [ e.originColor[0], e.originColor[1], e.originColor[2], t ];
1175
1186
  e.material.set("color", A);
1176
1187
  }
1177
- })) : "scaling" === this.I ? s.forEach((A => {
1188
+ }) : "scaling" === this.o ? s.forEach(A => {
1178
1189
  const t = A.getUniform("uPickingId");
1179
1190
  if (1 === t || 3 === t || 2 === t || 4 === t) {
1180
1191
  const t = [ 149 / 255, 179 / 255, 199 / 255, .8 ];
1181
1192
  A.material.set("color", t);
1182
1193
  }
1183
- })) : "rotation" === this.I && s.forEach((A => {
1194
+ }) : "rotation" === this.o && s.forEach(A => {
1184
1195
  const t = A.getUniform("uPickingId");
1185
1196
  if (1 === t || 3 === t || 2 === t || 4 === t) {
1186
1197
  const t = A.originColor;
1187
1198
  A.material.set("color", [ t[0], t[1], t[2], 0 ]);
1188
1199
  }
1189
- }));
1200
+ });
1190
1201
  }
1191
1202
  reset() {
1192
- if (!this.map || !this.M) return;
1193
- this.M.setTranslation(this.M.originTrans), this.M.setRotation(this.q), this.M.setScale(this.X);
1194
- const A = this.M.getTranslation();
1195
- s.scale(A, A, -1), this.TransformHelper.updateMatrix(this.map, this.M, 0, 1, [ 0, 0, 0 ]);
1203
+ if (!this.map || !this.v) return;
1204
+ this.v.setTranslation(this.v.originTrans), this.v.setRotation(this.W), this.v.setScale(this.q);
1205
+ const A = m(this.map, this.v.getTranslation());
1206
+ s.scale(A, A, -1), this.TransformHelper.updateMatrix(this.map, this.v, 0, 1, [ 0, 0, 0 ]);
1196
1207
  }
1197
- G(A, t) {
1198
- const e = this.j(), s = i.set(K, t[0] - e[0], t[1] - e[1]), n = i.set(_, A[0] - e[0], A[1] - e[1]), o = Math.atan2(s[1], s[0]);
1208
+ R(A, t) {
1209
+ const e = this.G(), s = i.set(R, t[0] - e[0], t[1] - e[1]), n = i.set(G, A[0] - e[0], A[1] - e[1]), o = Math.atan2(s[1], s[0]);
1199
1210
  return (Math.atan2(n[1], n[0]) - o) / Math.PI * 180;
1200
1211
  }
1201
- O(A) {
1202
- return this.H = 5 === A ? "xy-translate" : 6 === A ? "z-translate" : 7 === A || 9 === A ? "x-translate" : 8 === A || 10 === A ? "y-translate" : 11 === A ? "z-rotate" : "scale",
1203
- this.H;
1212
+ V(A) {
1213
+ return this.S = 5 === A ? "xy-translate" : 6 === A ? "z-translate" : 7 === A || 9 === A ? "x-translate" : 8 === A || 10 === A ? "y-translate" : 11 === A ? "z-rotate" : "scale",
1214
+ this.S;
1204
1215
  }
1205
1216
  transform(A) {
1206
1217
  if (this.layerRenderer && this.layerRenderer.layer && (this.layerRenderer.layer.off("renderend", this.render),
1207
- this.layerRenderer.layer.off("resizeCanvas", this.$)), this.M && (this.M.off("remove", this.AA, this),
1208
- delete this.M), this.M = A, this.M.on("remove", this.AA, this), !this.map) return void console.error("should add to a target first");
1218
+ this.layerRenderer.layer.off("resizeCanvas", this.X)), this.v && (this.v.off("remove", this.$, this),
1219
+ delete this.v), this.v = A, this.v.on("remove", this.$, this), !this.map) return void console.error("should add to a target first");
1209
1220
  const t = this.map;
1210
- this.M.originTrans || (this.M.originTrans = this.M.getTranslation(), this.M.originRotation = this.M.getRotation(),
1211
- this.M.originScale = this.M.getScale()), this.TransformHelper.updateMatrix(t, A, 0, 0, [ 0, 0, 0 ]),
1212
- this.tA(), this.V = !0;
1221
+ this.v.originTrans || (this.v.originTrans = m(t, this.v.getTranslation()), this.v.originRotation = this.v.getRotation(),
1222
+ this.v.originScale = this.v.getScale()), this.TransformHelper.updateMatrix(t, A, 0, 0, [ 0, 0, 0 ]),
1223
+ this.AA(), this.L = !0;
1213
1224
  }
1214
1225
  getTransformTarget() {
1215
- return this.M;
1226
+ return this.v;
1216
1227
  }
1217
- AA() {
1218
- delete this.M;
1228
+ $() {
1229
+ delete this.v;
1219
1230
  }
1220
- tA() {
1221
- const A = this.M.getLayer();
1222
- A && (A.off("renderend", this.render), A.off("resizeCanvas", this.$));
1231
+ AA() {
1232
+ const A = this.v.getLayer();
1233
+ A && (A.off("renderend", this.render), A.off("resizeCanvas", this.X));
1223
1234
  const t = this.map.getLayers();
1224
1235
  let e = null;
1225
1236
  for (let A = 0; A < t.length; A++) if (t[A] instanceof n) {
@@ -1231,37 +1242,37 @@ class R extends(I(r(a))){
1231
1242
  if (i < 0) return;
1232
1243
  s.splice(i, 1), s.push(A);
1233
1244
  const o = this.map, I = A.getRenderer();
1234
- this.layerRenderer = I, this.regl = I.regl, this.renderer = I.renderer, this.eA = this.layerRenderer.getFBORayPicking(),
1235
- this.sA = {
1245
+ this.layerRenderer = I, this.regl = I.regl, this.renderer = I.renderer, this.tA = this.layerRenderer.getFBORayPicking(),
1246
+ this.eA = {
1236
1247
  projViewMatrix: o.projViewMatrix
1237
- }, A.on("renderend", this.render, this), A.on("resizeCanvas", this.$, this), I.setToRedraw();
1248
+ }, A.on("renderend", this.render, this), A.on("resizeCanvas", this.X, this), I.setToRedraw();
1238
1249
  }
1239
- $() {
1240
- this.eA.clear(), this.V = !0;
1250
+ X() {
1251
+ this.tA.clear(), this.L = !0;
1241
1252
  }
1242
- F(A, t, e) {
1253
+ p(A, t, e) {
1243
1254
  const s = this.map;
1244
- if (!(s && this.eA && this.layerRenderer && this.layerRenderer.canvas)) return null;
1255
+ if (!(s && this.tA && this.layerRenderer && this.layerRenderer.canvas)) return null;
1245
1256
  const i = s.getDevicePixelRatio(), n = A.x * i, o = A.y * i, I = {
1246
1257
  projViewMatrix: this.map.projViewMatrix,
1247
1258
  pointSize: 1
1248
1259
  }, r = this.layerRenderer.canvas.gl && this.layerRenderer.canvas.gl.wrap;
1249
- (this.V || r || !this.iA || this.iA !== e) && (this.eA.render(t, I, !0), this.iA = e,
1250
- this.V = !1);
1251
- return this.eA.pick(n, o, 10, I, {
1260
+ (this.L || r || !this.sA || this.sA !== e) && (this.tA.render(t, I, !0), this.sA = e,
1261
+ this.L = !1);
1262
+ return this.tA.pick(n, o, 10, I, {
1252
1263
  viewMatrix: this.map.viewMatrix,
1253
1264
  projMatrix: this.map.projMatrix,
1254
1265
  returnPoint: !0
1255
1266
  });
1256
1267
  }
1257
- v() {
1268
+ l() {
1258
1269
  const A = this.map.getDevicePixelRatio(), s = {
1259
1270
  x: 0,
1260
1271
  y: 0,
1261
1272
  width: () => this.map ? this.map.width * A : 1,
1262
1273
  height: () => this.map ? this.map.height * A : 1
1263
1274
  };
1264
- this.nA = new e.MeshShader({
1275
+ this.iA = new e.MeshShader({
1265
1276
  vert: "attribute vec3 aPosition;\n\nuniform mat4 projViewModelMatrix;\n\n\n\nvoid main()\n\n{\n\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.0);\n\n\n\n}\n\n",
1266
1277
  frag: "precision mediump float;\n\nuniform vec4 color;\n\n\n\nvoid main() {\n\n gl_FragColor = color;\n\n}\n\n",
1267
1278
  uniforms: [ "color", {
@@ -1276,7 +1287,7 @@ class R extends(I(r(a))){
1276
1287
  depth: {
1277
1288
  enable: !0,
1278
1289
  func: "always",
1279
- mask: !1,
1290
+ mask: !0,
1280
1291
  range: [ 0, 0 ]
1281
1292
  },
1282
1293
  blend: {
@@ -1292,18 +1303,18 @@ class R extends(I(r(a))){
1292
1303
  });
1293
1304
  }
1294
1305
  render() {
1295
- if (!this.D()) return;
1296
- const A = this.p();
1306
+ if (!this.M()) return;
1307
+ const A = this.D();
1297
1308
  this.helperScene.setMeshes(A);
1298
1309
  const t = this.layerRenderer.getFrameContext();
1299
1310
  if (t && t.renderTarget && this.layerRenderer.getFrameTimestamp() !== t.timestamp) return;
1300
- this.N(), this.nA.filter = t && t.sceneFilter;
1311
+ this.H(), this.iA.filter = t && t.sceneFilter;
1301
1312
  const e = t && t.renderTarget && t.renderTarget.fbo;
1302
- this.renderer.render(this.nA, this.sA, this.helperScene, e);
1313
+ this.renderer.render(this.iA, this.eA, this.helperScene, e);
1303
1314
  }
1304
- p() {
1315
+ D() {
1305
1316
  let A = [];
1306
- const t = this.TransformHelper.getMeshes(this.I);
1317
+ const t = this.TransformHelper.getMeshes(this.o);
1307
1318
  for (const e in t) {
1308
1319
  if ("translate" === e) continue;
1309
1320
  const s = t[e];
@@ -1313,16 +1324,16 @@ class R extends(I(r(a))){
1313
1324
  for (let t = 0; t < e.length; t++) A = A.concat(e[t]);
1314
1325
  return A;
1315
1326
  }
1316
- D() {
1327
+ M() {
1317
1328
  const A = this.layerRenderer, t = A && A.layer;
1318
- return A && this.M && t && t.isVisible() && this.M.isVisible() && this.regl && this.h;
1329
+ return A && this.v && t && t.isVisible() && this.v.isVisible() && this.regl && this.I;
1319
1330
  }
1320
1331
  }
1321
1332
 
1322
- R.mergeOptions({
1333
+ j.mergeOptions({
1323
1334
  scaleStrength: 2
1324
1335
  });
1325
1336
 
1326
- export { R as TransformControl };
1337
+ export { j as TransformControl };
1327
1338
 
1328
- "undefined" != typeof console && console.log("@maptalks/transform-control v0.8.0");
1339
+ "undefined" != typeof console && console.log("@maptalks/transform-control v0.83.0");