@vtx/map 1.1.48 → 1.1.49

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.
@@ -69,13 +69,13 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
69
69
  _this.heatmap = null; //热力图对象
70
70
  _this.satellite = null; //底图图层对象-卫星图
71
71
  _this.roadNet = null; //路网图层对象
72
+ _this.mapCreated = false;
72
73
  //为了样式相同,引用百度的鼠标样式
73
74
  _this.csr = /webkit/.test(navigator.userAgent.toLowerCase()) ? 'url("http://api.map.baidu.com/images/ruler.cur") 3 6, crosshair' : 'url("http://api.map.baidu.com/images/ruler.cur"), crosshair';
74
75
  _this.state = {
75
76
  gis: null,
76
77
  //地图对象
77
78
  mapId: props.mapId,
78
- mapCreated: false,
79
79
  pointIds: [],
80
80
  //地图上点的ids
81
81
  lineIds: [],
@@ -270,9 +270,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
270
270
  t.zoomEnd();
271
271
  //初始化地图点击事件
272
272
  t.clickMap();
273
- t.setState({
274
- mapCreated: true
275
- });
273
+ this.mapCreated = true;
276
274
  }
277
275
  //地图方法
278
276
  }, {
@@ -2747,7 +2745,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
2747
2745
  var t = this;
2748
2746
  var props = t.props;
2749
2747
  // 等待地图加载
2750
- if (!t.state.mapCreated) return;
2748
+ if (!t.mapCreated) return;
2751
2749
 
2752
2750
  //回调显示方法
2753
2751
  if (props.showGraphicById) {
@@ -2759,8 +2757,8 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
2759
2757
  }
2760
2758
  }
2761
2759
  }, {
2762
- key: "componentWillReceiveProps",
2763
- value: function componentWillReceiveProps(nextProps, prevProps) {
2760
+ key: "UNSAFE_componentWillReceiveProps",
2761
+ value: function UNSAFE_componentWillReceiveProps(nextProps, prevProps) {
2764
2762
  //已加载组件,收到新的参数时调用
2765
2763
  var t = this;
2766
2764
  //点/线旧数据
@@ -2827,7 +2825,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
2827
2825
  t.setMapType(coverageType);
2828
2826
  }
2829
2827
  // 等待地图加载
2830
- if (!t.state.mapCreated) return;
2828
+ if (!t.mapCreated) return;
2831
2829
  if (mapPointCollection instanceof Array && props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, t.props.mapPointCollection)) {
2832
2830
  var _t$dataMatch = t.dataMatch(t.props.mapPointCollection, mapPointCollection, 'id'),
2833
2831
  deletedDataIDs = _t$dataMatch.deletedDataIDs,