@vtx/map 1.1.20 → 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.
@@ -892,6 +892,22 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
892
892
  });
893
893
  t.state.gis.addControl(navigation);
894
894
  t.navigationControl = navigation;
895
+ } // 移除比例尺
896
+
897
+ }, {
898
+ key: "removeControl",
899
+ value: function removeControl() {
900
+ var t = this;
901
+
902
+ if (t.scaleControl) {
903
+ t.state.gis.removeControl(t.scaleControl);
904
+ t.scaleControl = null;
905
+ }
906
+
907
+ if (t.navigationControl) {
908
+ t.state.gis.removeControl(t.navigationControl);
909
+ t.navigationControl = null;
910
+ }
895
911
  } //展示地图切换控件
896
912
 
897
913
  }, {
@@ -3374,6 +3390,11 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
3374
3390
 
3375
3391
  if (nextProps.showControl && JSON.stringify(nextProps.showControl) != JSON.stringify(t.props.showControl)) {
3376
3392
  t.showControl(nextProps);
3393
+ } // 比例尺移除
3394
+
3395
+
3396
+ if (!nextProps.showControl) {
3397
+ t.removeControl();
3377
3398
  } // 地图类型控件位置改变
3378
3399
 
3379
3400