@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.
@@ -91,11 +91,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
91
91
  _this.morepoints = []; //海量点数组
92
92
  _this.movePoints = []; //移动点的动画集合
93
93
  _this.popupWindow = null;
94
+ _this.mapCreated = false;
94
95
  _this.state = {
95
96
  gis: null,
96
97
  //地图对象
97
98
  mapId: props.mapId,
98
- mapCreated: false,
99
99
  pointIds: [],
100
100
  //地图上点的ids
101
101
  lineIds: [],
@@ -327,9 +327,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
327
327
  t.zoomStart();
328
328
  //地图缩放结束后事件
329
329
  t.zoomEnd();
330
- t.setState({
331
- mapCreated: true
332
- });
330
+ this.mapCreated = true;
333
331
  }
334
332
  //创建地图
335
333
  }, {
@@ -2920,8 +2918,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2920
2918
  value: function componentDidUpdate(prevProps, prevState) {}
2921
2919
  //已加载组件,收到新的参数时调用
2922
2920
  }, {
2923
- key: "componentWillReceiveProps",
2924
- value: function componentWillReceiveProps(nextProps) {
2921
+ key: "UNSAFE_componentWillReceiveProps",
2922
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
2925
2923
  var t = this;
2926
2924
  //点/线旧数据
2927
2925
  var _t$state = t.state,
@@ -2978,7 +2976,6 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2978
2976
  coverageType = nextProps.coverageType,
2979
2977
  infoWindowData = nextProps.infoWindowData;
2980
2978
  var props = t.props;
2981
-
2982
2979
  // 设置地图地图样式
2983
2980
  if (mapStyle && !t.deepEqual(mapStyle, props.mapStyle)) {
2984
2981
  if (typeof mapStyle === 'string') {
@@ -2997,7 +2994,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2997
2994
  t.setMapType(coverageType);
2998
2995
  }
2999
2996
  // 等待地图加载
3000
- if (!t.state.mapCreated) return;
2997
+ if (!t.mapCreated) return;
3001
2998
 
3002
2999
  /*添加海量点*/
3003
3000
  if (mapPointCollection instanceof Array && props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, props.mapPointCollection)) {