@vtx/map 1.1.19 → 1.1.21

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.
@@ -725,6 +725,22 @@ var TMap = /*#__PURE__*/function (_React$Component) {
725
725
  });
726
726
  }
727
727
  }
728
+ } // 移除比例尺
729
+
730
+ }, {
731
+ key: "removeControl",
732
+ value: function removeControl() {
733
+ var t = this;
734
+
735
+ if (t.scaleControl) {
736
+ t.state.gis.removeControl(t.scaleControl);
737
+ t.scaleControl = null;
738
+ }
739
+
740
+ if (t.navigationControl) {
741
+ t.state.gis.removeControl(t.navigationControl);
742
+ t.navigationControl = null;
743
+ }
728
744
  } //展示地图切换控件
729
745
 
730
746
  }, {
@@ -2284,6 +2300,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2284
2300
  }, {
2285
2301
  key: "editGraphicChange",
2286
2302
  value: function editGraphicChange(id) {
2303
+ if (!id) return;
2287
2304
  var t = this;
2288
2305
  var ms = t.getGraphic(id);
2289
2306
  var obj = {
@@ -3514,6 +3531,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3514
3531
 
3515
3532
  if (nextProps.showControl && JSON.stringify(nextProps.showControl) != JSON.stringify(t.props.showControl)) {
3516
3533
  t.showControl(nextProps);
3534
+ } // 比例尺移除
3535
+
3536
+
3537
+ if (!nextProps.showControl) {
3538
+ t.removeControl();
3517
3539
  } // 地图类型控件位置改变
3518
3540
 
3519
3541