@vtx/map 1.1.16 → 1.1.18

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.
@@ -37,8 +37,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
37
37
 
38
38
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
39
 
40
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
-
42
40
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
43
41
 
44
42
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -59,6 +57,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
59
57
 
60
58
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
61
59
 
60
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
61
+
62
62
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
63
63
 
64
64
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -128,6 +128,30 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
128
128
  _classCallCheck(this, VtxSearchMap);
129
129
 
130
130
  _this = _super.call(this, props);
131
+
132
+ _defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
133
+ var resData = [];
134
+ var _this$state = _this.state,
135
+ graphicValue = _this$state.graphicValue,
136
+ editGraphic = _this$state.editGraphic;
137
+
138
+ switch (graphicType) {
139
+ case 'polygon':
140
+ [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
141
+ resData.push({
142
+ rings: distinct(item.rings || item.geometry.rings),
143
+ area: _this.map.getPolygonArea(distinct(item.rings || item.geometry.rings))
144
+ });
145
+ });
146
+ break;
147
+
148
+ default:
149
+ break;
150
+ }
151
+
152
+ return resData.length ? resData : null;
153
+ });
154
+
131
155
  _this.map = null; //Map组件的ref对象
132
156
 
133
157
  _this.mapLoaded = false;
@@ -137,6 +161,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
137
161
 
138
162
  _this.loadExtent = null;
139
163
  _this.mapId = "searchMap".concat(new Date().getTime());
164
+ _this.multiDraw = props.multiDraw && ['polygon'].includes(props.graphicType);
165
+ _this.clickable = false, // 多个面绘制时,是否可以点击面进行编辑
140
166
  _this.state = {
141
167
  //列表和地图宽度切换的动画需要
142
168
  isShowList: false,
@@ -152,8 +178,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
152
178
  graphicType: props.graphicType || 'point',
153
179
  isDraw: props.graphicType !== 'point',
154
180
  parameter: props.drawParameter,
155
- graphicValue: null,
156
- drawGraphID: 'drawnGraph',
181
+ graphicValue: _this.multiDraw ? [] : null,
182
+ // 绘制图元id集合
183
+ drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
157
184
 
158
185
  /*地图Api参数*/
159
186
  mapCenter: props.mapCenter || '',
@@ -172,7 +199,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
172
199
  isDoEdit: false,
173
200
  isEndEdit: false,
174
201
  editGraphicId: '',
175
- editGraphic: null,
202
+ editGraphic: _this.multiDraw ? [] : null,
176
203
  mapZoomLevel: props.mapZoomLevel || 11,
177
204
  setZoomLevel: false,
178
205
 
@@ -185,12 +212,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
185
212
  olProps: props.olProps
186
213
  };
187
214
  return _this;
188
- } //经纬度回调
215
+ } // 绘制多个图元时返回参数
189
216
 
190
217
 
191
218
  _createClass(VtxSearchMap, [{
192
219
  key: "callback",
193
- value: function callback() {
220
+ value: //经纬度回调
221
+ function callback() {
194
222
  var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
195
223
 
196
224
  if (fun in this.props && typeof this.props[fun] === 'function') {
@@ -219,6 +247,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
219
247
  break;
220
248
 
221
249
  case 'polygon':
250
+ if (this.multiDraw) {
251
+ this.props[fun](this.getMultiRes('polygon'));
252
+ return;
253
+ }
254
+
222
255
  if (this.map.getGraphic(editGraphicId)) {
223
256
  var _p = this.map.getGraphic(editGraphicId);
224
257
 
@@ -283,7 +316,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
283
316
  editGraphic = null,
284
317
  editGraphicId = 'locationPoint';
285
318
 
286
- if (this.props.editParam) {
319
+ if (!this.multiDraw && this.props.editParam) {
287
320
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
288
321
  editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
289
322
  id: 'drawnGraph'
@@ -291,6 +324,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
291
324
  editGraphicId = 'drawnGraph';
292
325
  }
293
326
 
327
+ if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
328
+ // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
329
+ editGraphic = this.props.editParam.map(function (item, index) {
330
+ return _objectSpread(_objectSpread({}, item), {}, {
331
+ id: "drawnGraph".concat(index)
332
+ });
333
+ });
334
+ editGraphicId = null;
335
+ }
336
+
294
337
  this.isinit = false;
295
338
  this.setState({
296
339
  editGraphic: editGraphic,
@@ -420,9 +463,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
420
463
  key: "chooseAddress",
421
464
  value: function chooseAddress(id) {
422
465
  var t = this;
423
- var _this$state = this.state,
424
- listPoint = _this$state.listPoint,
425
- listMess = _this$state.listMess;
466
+ var _this$state2 = this.state,
467
+ listPoint = _this$state2.listPoint,
468
+ listMess = _this$state2.listMess;
426
469
  var mapCenter = [];
427
470
  listPoint = listPoint.map(function (item, index) {
428
471
  if (item.id === id) {
@@ -467,9 +510,25 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
467
510
  }, {
468
511
  key: "clickGraphic",
469
512
  value: function clickGraphic(obj) {
513
+ var _this3 = this;
514
+
470
515
  if (obj.type === 'point' && obj.attributes.other === 'search') {
471
516
  this.chooseAddress(obj.attributes.id);
472
517
  }
518
+
519
+ if (this.clickable && obj.type === 'polygon') {
520
+ var _obj$param$attributes;
521
+
522
+ // 开启编辑
523
+ this.setState({
524
+ editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
525
+ isDoEdit: false
526
+ }, function () {
527
+ _this3.setState({
528
+ isDoEdit: true
529
+ });
530
+ });
531
+ }
473
532
  }
474
533
  }, {
475
534
  key: "closeModal",
@@ -492,54 +551,117 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
492
551
  }, {
493
552
  key: "clearDrawnGraph",
494
553
  value: function clearDrawnGraph() {
495
- var _this3 = this;
554
+ var _this4 = this;
496
555
 
497
556
  this.isDrawStatus = true;
498
557
  this.setState({
499
558
  isDraw: this.state.graphicType !== 'point',
500
- graphicValue: null,
559
+ graphicValue: this.multiDraw ? [] : null,
501
560
  isEndEdit: this.state.graphicType !== 'point'
502
561
  }, function () {
503
- _this3.setState({
562
+ _this4.setState({
504
563
  isEndEdit: false
505
564
  });
506
565
  });
507
566
  }
567
+ }, {
568
+ key: "continueDraw",
569
+ value: function continueDraw() {
570
+ var _this5 = this;
571
+
572
+ this.clickable = false;
573
+ this.setState({
574
+ isDraw: false,
575
+ isCloseDraw: true,
576
+ isEndEdit: false,
577
+ graphicValue: null
578
+ }, function () {
579
+ _this5.setState({
580
+ isDraw: true,
581
+ isCloseDraw: false,
582
+ isEndEdit: true
583
+ });
584
+ });
585
+ }
586
+ }, {
587
+ key: "editGraphic",
588
+ value: function editGraphic() {
589
+ var _this6 = this;
590
+
591
+ if (this.isDrawStatus && this.isClickMap) {
592
+ _message["default"].warning('请双击结束图元编辑');
593
+
594
+ return;
595
+ }
596
+
597
+ _message["default"].info('请点击图元进行编辑');
598
+
599
+ this.clickable = true;
600
+ this.isDrawStatus = false;
601
+ this.setState({
602
+ isDraw: true,
603
+ isCloseDraw: false,
604
+ isDoEdit: false
605
+ }, function () {
606
+ _this6.setState({
607
+ isDraw: false,
608
+ isCloseDraw: true,
609
+ isDoEdit: true
610
+ });
611
+ });
612
+ }
613
+ }, {
614
+ key: "editGraphicChange",
615
+ value: function editGraphicChange(obj) {
616
+ if (!this.multiDraw) return;
617
+ var _this$state3 = this.state,
618
+ graphicValue = _this$state3.graphicValue,
619
+ editGraphic = _this$state3.editGraphic;
620
+ this.setState({
621
+ graphicValue: (graphicValue || []).map(function (item) {
622
+ return item.id === obj.id ? obj : item;
623
+ }),
624
+ editGraphic: (editGraphic || []).map(function (item) {
625
+ return item.id === obj.id ? obj : item;
626
+ })
627
+ });
628
+ }
508
629
  }, {
509
630
  key: "render",
510
631
  value: function render() {
511
- var _this4 = this;
632
+ var _this7 = this;
512
633
 
513
634
  var t = this;
514
- var _this$state2 = this.state,
515
- isShowList = _this$state2.isShowList,
516
- searchValue = _this$state2.searchValue,
517
- locationPoint = _this$state2.locationPoint,
518
- listPoint = _this$state2.listPoint,
519
- listMess = _this$state2.listMess,
520
- mapZoomLevel = _this$state2.mapZoomLevel,
521
- setZoomLevel = _this$state2.setZoomLevel,
522
- maxZoom = _this$state2.maxZoom,
523
- minZoom = _this$state2.minZoom,
524
- wkid = _this$state2.wkid,
525
- mapServer = _this$state2.mapServer,
526
- mapCenter = _this$state2.mapCenter,
527
- setCenter = _this$state2.setCenter,
528
- mapType = _this$state2.mapType,
529
- mapStyle = _this$state2.mapStyle,
530
- mapVisiblePoints = _this$state2.mapVisiblePoints,
531
- setVisiblePoints = _this$state2.setVisiblePoints,
532
- isDoEdit = _this$state2.isDoEdit,
533
- editGraphicId = _this$state2.editGraphicId,
534
- isEndEdit = _this$state2.isEndEdit,
535
- modal1Visible = _this$state2.modal1Visible,
536
- drawGraphID = _this$state2.drawGraphID,
537
- isShowOther = _this$state2.isShowOther,
538
- otherText = _this$state2.otherText,
539
- isShowOtherGraph = _this$state2.isShowOtherGraph,
540
- editGraphic = _this$state2.editGraphic,
541
- graphicType = _this$state2.graphicType,
542
- olProps = _this$state2.olProps;
635
+ var _this$state4 = this.state,
636
+ isShowList = _this$state4.isShowList,
637
+ searchValue = _this$state4.searchValue,
638
+ locationPoint = _this$state4.locationPoint,
639
+ listPoint = _this$state4.listPoint,
640
+ listMess = _this$state4.listMess,
641
+ mapZoomLevel = _this$state4.mapZoomLevel,
642
+ setZoomLevel = _this$state4.setZoomLevel,
643
+ maxZoom = _this$state4.maxZoom,
644
+ minZoom = _this$state4.minZoom,
645
+ wkid = _this$state4.wkid,
646
+ mapServer = _this$state4.mapServer,
647
+ mapCenter = _this$state4.mapCenter,
648
+ setCenter = _this$state4.setCenter,
649
+ mapType = _this$state4.mapType,
650
+ mapStyle = _this$state4.mapStyle,
651
+ mapVisiblePoints = _this$state4.mapVisiblePoints,
652
+ setVisiblePoints = _this$state4.setVisiblePoints,
653
+ isDoEdit = _this$state4.isDoEdit,
654
+ editGraphicId = _this$state4.editGraphicId,
655
+ isEndEdit = _this$state4.isEndEdit,
656
+ modal1Visible = _this$state4.modal1Visible,
657
+ drawGraphID = _this$state4.drawGraphID,
658
+ isShowOther = _this$state4.isShowOther,
659
+ otherText = _this$state4.otherText,
660
+ isShowOtherGraph = _this$state4.isShowOtherGraph,
661
+ editGraphic = _this$state4.editGraphic,
662
+ graphicType = _this$state4.graphicType,
663
+ graphicValue = _this$state4.graphicValue,
664
+ olProps = _this$state4.olProps;
543
665
  var InputProps = {
544
666
  style: {
545
667
  'width': '200px'
@@ -557,23 +679,19 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
557
679
  isDraw: this.state.isDraw,
558
680
  isCloseDraw: this.state.isCloseDraw,
559
681
  drawEnd: function drawEnd(obj) {
560
- _this4.isDrawStatus = false;
561
- _this4.isClickMap = false;
682
+ _this7.isDrawStatus = false;
683
+ _this7.isClickMap = false;
562
684
  var objparam = {
563
- graphicValue: obj,
564
- isDraw: false
685
+ graphicValue: _this7.multiDraw ? [].concat(_toConsumableArray(graphicValue || []), [obj]) : obj,
686
+ isDoEdit: !_this7.multiDraw,
687
+ isDraw: _this7.multiDraw
565
688
  };
566
689
 
567
- if (obj.geometryType == 'polyline' || obj.geometryType == 'polygon') {
690
+ if (!_this7.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
568
691
  objparam.editGraphicId = obj.id;
569
- objparam.isDoEdit = true;
570
692
  }
571
693
 
572
- _this4.setState(objparam, function () {
573
- _this4.setState({
574
- isDoEdit: false
575
- });
576
- });
694
+ _this7.setState(objparam);
577
695
  },
578
696
  mapDraw: {
579
697
  geometryType: this.state.graphicType,
@@ -598,7 +716,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
598
716
  //填充透明度
599
717
  lineType: 'solid'
600
718
  } : {}),
601
- data: {
719
+ data: this.multiDraw ? null : {
602
720
  id: drawGraphID
603
721
  }
604
722
  }
@@ -616,8 +734,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
616
734
 
617
735
  if (graphicType === 'polygon') {
618
736
  if (editGraphic) {
619
- mapPolygons.push(editGraphic);
620
- drawProps = null;
737
+ var _mapPolygons;
738
+
739
+ Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
740
+ !this.multiDraw && (drawProps = null);
621
741
  }
622
742
  }
623
743
 
@@ -672,7 +792,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
672
792
  }, /*#__PURE__*/_react["default"].createElement(_button["default"], {
673
793
  type: "primary",
674
794
  onClick: function onClick() {
675
- _this4.callback();
795
+ _this7.callback();
676
796
  },
677
797
  icon: getIcon('check')
678
798
  }, "\u786E\u5B9A"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
@@ -700,24 +820,54 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
700
820
  }, "\u6821\u6B63") : null, this.state.graphicType != 'point' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
701
821
  disabled: this.isDrawStatus,
702
822
  onClick: function onClick() {
703
- _this4.isDrawStatus = true;
823
+ _this7.isDrawStatus = true;
704
824
 
705
- _this4.setState({
706
- isDraw: true,
707
- graphicValue: null,
708
- editGraphic: null,
709
- isEndEdit: true
710
- }, function () {
711
- t.map.removeGraphic('drawnGraph', 'draw');
712
- t.setState({
713
- isEndEdit: false
825
+ if (_this7.multiDraw) {
826
+ _this7.clickable = false;
827
+ graphicValue === null || graphicValue === void 0 ? void 0 : graphicValue.forEach(function (item) {
828
+ return t.map.removeGraphic(item.id, 'draw');
829
+ });
830
+ editGraphic === null || editGraphic === void 0 ? void 0 : editGraphic.forEach(function (item) {
831
+ return t.map.removeGraphic(item.id, 'draw');
714
832
  });
715
- });
716
833
 
717
- _this4.callback('editDraw');
834
+ _this7.setState({
835
+ isDraw: false,
836
+ isCloseDraw: true,
837
+ isEndEdit: false,
838
+ graphicValue: null,
839
+ editGraphic: null
840
+ }, function () {
841
+ _this7.setState({
842
+ isDraw: true,
843
+ isCloseDraw: false,
844
+ isEndEdit: true
845
+ });
846
+ });
847
+ } else {
848
+ _this7.setState({
849
+ isDraw: true,
850
+ graphicValue: null,
851
+ editGraphic: null,
852
+ isEndEdit: true
853
+ }, function () {
854
+ t.map.removeGraphic('drawnGraph', 'draw');
855
+ t.setState({
856
+ isEndEdit: false
857
+ });
858
+ });
859
+ }
860
+
861
+ _this7.callback('editDraw');
718
862
  },
719
863
  icon: getIcon('edit')
720
- }, "\u91CD\u65B0\u7ED8\u5236") : null, mapType == 'gmap' || mapType == 'olmap' ? '' : /*#__PURE__*/_react["default"].createElement(_button["default"], {
864
+ }, "\u91CD\u65B0\u7ED8\u5236") : null, this.multiDraw && /*#__PURE__*/_react["default"].createElement(_button["default"], {
865
+ onClick: this.continueDraw.bind(this),
866
+ icon: getIcon('edit')
867
+ }, "\u7EE7\u7EED\u7ED8\u5236"), this.multiDraw && /*#__PURE__*/_react["default"].createElement(_button["default"], {
868
+ onClick: this.editGraphic.bind(this),
869
+ icon: getIcon('edit')
870
+ }, "\u7F16\u8F91\u56FE\u5143"), mapType == 'gmap' || mapType == 'olmap' ? '' : /*#__PURE__*/_react["default"].createElement(_button["default"], {
721
871
  onClick: this.setFitView.bind(this),
722
872
  icon: getIcon('sync')
723
873
  }, "\u8FD4\u56DE\u5168\u5C40\u5730\u56FE"), isShowOther ? /*#__PURE__*/_react["default"].createElement("div", {
@@ -725,7 +875,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
725
875
  }, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
726
876
  checked: isShowOtherGraph,
727
877
  onChange: function onChange(e) {
728
- _this4.setState({
878
+ _this7.setState({
729
879
  isShowOtherGraph: e.target.checked
730
880
  });
731
881
  }
@@ -744,7 +894,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
744
894
  className: styles.title
745
895
  }, "\u67E5\u8BE2\u7ED3\u679C"), /*#__PURE__*/_react["default"].createElement("div", {
746
896
  onClick: function onClick() {
747
- return _this4.showOrhidden(false);
897
+ return _this7.showOrhidden(false);
748
898
  },
749
899
  className: styles.btn
750
900
  }, /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
@@ -755,13 +905,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
755
905
  return /*#__PURE__*/_react["default"].createElement("div", {
756
906
  key: index,
757
907
  onClick: function onClick() {
758
- return _this4.chooseAddress(item.id);
908
+ return _this7.chooseAddress(item.id);
759
909
  },
760
910
  className: "".concat(styles.lists, " ").concat(item.isSelect ? styles.select : '')
761
911
  }, item.title);
762
912
  }))), /*#__PURE__*/_react["default"].createElement("div", {
763
913
  onClick: function onClick() {
764
- return _this4.showOrhidden(true);
914
+ return _this7.showOrhidden(true);
765
915
  },
766
916
  className: "".concat(styles.btn, " ").concat(!isShowList ? styles.show : styles.hidden)
767
917
  }, /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
@@ -770,7 +920,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
770
920
  className: styles.content_right
771
921
  }, /*#__PURE__*/_react["default"].createElement(_VtxMap.VtxMap, _extends({
772
922
  getMapInstance: function getMapInstance(map) {
773
- if (map) _this4.map = map;
923
+ if (map) _this7.map = map;
774
924
  },
775
925
  mapType: mapType,
776
926
  mapStyle: mapStyle,
@@ -792,7 +942,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
792
942
  isDoEdit: isDoEdit,
793
943
  isEndEdit: isEndEdit,
794
944
  editGraphicId: editGraphicId,
795
- editGraphicChange: function editGraphicChange() {},
945
+ editGraphicChange: this.editGraphicChange.bind(this),
796
946
  clickGraphic: this.clickGraphic.bind(this),
797
947
  clickMap: function clickMap() {
798
948
  t.isClickMap = true;
@@ -803,17 +953,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
803
953
  }, {
804
954
  key: "initSearchMap",
805
955
  value: function initSearchMap() {
806
- var _this5 = this;
956
+ var _this8 = this;
807
957
 
808
958
  if (this.props.modal1Visible
809
959
  /*&& !this.state.locationPoint[0]*/
810
960
  ) {
811
961
  if (this.map) {
812
962
  this.map.loadMapComplete.then(function () {
813
- if (!_this5.mapLoaded) {
814
- _this5.mapLoaded = true;
963
+ if (!_this8.mapLoaded) {
964
+ _this8.mapLoaded = true;
815
965
 
816
- _this5.drawLocationPoint();
966
+ _this8.drawLocationPoint();
817
967
  }
818
968
  });
819
969
  }
@@ -834,7 +984,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
834
984
  }, {
835
985
  key: "componentWillReceiveProps",
836
986
  value: function componentWillReceiveProps(nextProps) {
837
- var _this6 = this;
987
+ var _this9 = this;
838
988
 
839
989
  var t = this;
840
990
  this.isClickMap = false;
@@ -872,49 +1022,49 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
872
1022
  setTimeout(function () {
873
1023
  //实现2+次进入时,清理数据
874
1024
  if (nextProps.modal1Visible) {
875
- _this6.clearList();
1025
+ _this9.clearList();
876
1026
 
877
- _this6.setState({
1027
+ _this9.setState({
878
1028
  setZoomLevel: true
879
1029
  }, function () {
880
- _this6.setState({
1030
+ _this9.setState({
881
1031
  setZoomLevel: false
882
1032
  });
883
1033
  });
884
1034
 
885
- if (!!_this6.map && !!_this6.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
886
- if (_this6.map.getGraphic('locationPoint')) {
1035
+ if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1036
+ if (_this9.map.getGraphic('locationPoint')) {
887
1037
  switch (nextProps.mapType) {
888
1038
  case 'bmap':
889
- _this6.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1039
+ _this9.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
890
1040
 
891
1041
  break;
892
1042
 
893
1043
  case 'amap':
894
- _this6.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1044
+ _this9.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
895
1045
 
896
1046
  break;
897
1047
 
898
1048
  case 'tmap':
899
- _this6.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1049
+ _this9.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
900
1050
 
901
1051
  break;
902
1052
 
903
1053
  case 'gmap':
904
- _this6.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
1054
+ _this9.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
905
1055
 
906
- _this6.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
1056
+ _this9.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
907
1057
 
908
- _this6.map.state.gis.graphics.refresh();
1058
+ _this9.map.state.gis.graphics.refresh();
909
1059
 
910
1060
  case 'olMap':
911
- _this6.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1061
+ _this9.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
912
1062
 
913
1063
  break;
914
1064
  }
915
1065
  }
916
1066
 
917
- _this6.map.setCenter(nextProps.mapCenter);
1067
+ _this9.map.setCenter(nextProps.mapCenter);
918
1068
  }
919
1069
  }
920
1070
  }, 100);