@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.
@@ -72,11 +72,11 @@ var Map = /*#__PURE__*/function (_React$Component) {
72
72
  isDbclick: false
73
73
  };
74
74
  _this.rangingTools = {}; //测距点线缓存
75
+ _this.mapCreated = false;
75
76
  _this.state = {
76
77
  gis: null,
77
78
  //地图对象
78
79
  mapId: props.mapId,
79
- mapCreated: false,
80
80
  pointIds: [],
81
81
  //地图上点的ids
82
82
  lineIds: [],
@@ -227,9 +227,7 @@ var Map = /*#__PURE__*/function (_React$Component) {
227
227
  t.zoomStart();
228
228
  // //地图移动结束后事件/地图缩放结束后事件
229
229
  t.moveEndAndZoomEnd();
230
- t.setState({
231
- mapCreated: true
232
- });
230
+ this.mapCreated = true;
233
231
  }
234
232
  //创建地图
235
233
  }, {
@@ -3646,8 +3644,8 @@ var Map = /*#__PURE__*/function (_React$Component) {
3646
3644
  value: function componentDidUpdate(prevProps, prevState) {}
3647
3645
  //已加载组件,收到新的参数时调用
3648
3646
  }, {
3649
- key: "componentWillReceiveProps",
3650
- value: function componentWillReceiveProps(nextProps) {
3647
+ key: "UNSAFE_componentWillReceiveProps",
3648
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
3651
3649
  var t = this;
3652
3650
  //点/线旧数据
3653
3651
  var _t$state3 = t.state,
@@ -3702,7 +3700,7 @@ var Map = /*#__PURE__*/function (_React$Component) {
3702
3700
  var props = t.props;
3703
3701
 
3704
3702
  // 等待地图加载
3705
- if (!t.state.mapCreated) return;
3703
+ if (!t.mapCreated) return;
3706
3704
 
3707
3705
  /*添加海量点*/
3708
3706
  if (mapPointCollection instanceof Array && props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, props.mapPointCollection)) {