@vtx/map 1.1.36 → 1.1.38

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.
Files changed (63) hide show
  1. package/lib/VtxMap/AMap/AMap.js +1014 -624
  2. package/lib/VtxMap/AMap/AMap.js.map +1 -1
  3. package/lib/VtxMap/BMap/Map.js +1207 -746
  4. package/lib/VtxMap/BMap/Map.js.map +1 -1
  5. package/lib/VtxMap/GMap/Map.js +1564 -1046
  6. package/lib/VtxMap/GMap/Map.js.map +1 -1
  7. package/lib/VtxMap/Map.js +42 -8
  8. package/lib/VtxMap/Map.js.map +1 -1
  9. package/lib/VtxMap/MapToolFunction.js +63 -26
  10. package/lib/VtxMap/MapToolFunction.js.map +1 -1
  11. package/lib/VtxMap/OMap/Map.js +1361 -867
  12. package/lib/VtxMap/OMap/Map.js.map +1 -1
  13. package/lib/VtxMap/OlMap/Map.js +1276 -746
  14. package/lib/VtxMap/OlMap/Map.js.map +1 -1
  15. package/lib/VtxMap/TMap/TMap.js +1072 -645
  16. package/lib/VtxMap/TMap/TMap.js.map +1 -1
  17. package/lib/VtxMap/index.js +8 -1
  18. package/lib/VtxMap/index.js.map +1 -1
  19. package/lib/VtxMap/mapPlayer.js +123 -67
  20. package/lib/VtxMap/mapPlayer.js.map +1 -1
  21. package/lib/VtxMap/optimizingPointMap.js +77 -21
  22. package/lib/VtxMap/optimizingPointMap.js.map +1 -1
  23. package/lib/VtxMap/style/css.js +6 -0
  24. package/lib/VtxMap/style/css.js.map +1 -1
  25. package/lib/VtxMap/style/index.js +6 -0
  26. package/lib/VtxMap/style/index.js.map +1 -1
  27. package/lib/VtxMap/zoomMap.js +41 -12
  28. package/lib/VtxMap/zoomMap.js.map +1 -1
  29. package/lib/VtxModal/VtxModal.js +63 -19
  30. package/lib/VtxModal/VtxModal.js.map +1 -1
  31. package/lib/VtxModal/draggableModal.js +48 -12
  32. package/lib/VtxModal/draggableModal.js.map +1 -1
  33. package/lib/VtxModal/index.js +6 -1
  34. package/lib/VtxModal/index.js.map +1 -1
  35. package/lib/VtxModal/style/css.js +6 -0
  36. package/lib/VtxModal/style/css.js.map +1 -1
  37. package/lib/VtxModal/style/index.js +6 -0
  38. package/lib/VtxModal/style/index.js.map +1 -1
  39. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +238 -105
  40. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
  41. package/lib/VtxSearchCheckMap/index.js +2 -0
  42. package/lib/VtxSearchCheckMap/index.js.map +1 -1
  43. package/lib/VtxSearchCheckMap/mapping.js +2 -1
  44. package/lib/VtxSearchCheckMap/mapping.js.map +1 -1
  45. package/lib/VtxSearchCheckMap/style/css.js +19 -0
  46. package/lib/VtxSearchCheckMap/style/css.js.map +1 -1
  47. package/lib/VtxSearchCheckMap/style/index.js +19 -0
  48. package/lib/VtxSearchCheckMap/style/index.js.map +1 -1
  49. package/lib/VtxSearchMap/VtxSearchMap.js +221 -91
  50. package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
  51. package/lib/VtxSearchMap/index.js +2 -0
  52. package/lib/VtxSearchMap/index.js.map +1 -1
  53. package/lib/VtxSearchMap/mapping.js +2 -1
  54. package/lib/VtxSearchMap/mapping.js.map +1 -1
  55. package/lib/VtxSearchMap/style/css.js +19 -0
  56. package/lib/VtxSearchMap/style/css.js.map +1 -1
  57. package/lib/VtxSearchMap/style/index.js +19 -0
  58. package/lib/VtxSearchMap/style/index.js.map +1 -1
  59. package/lib/default.js +13 -4
  60. package/lib/default.js.map +1 -1
  61. package/lib/index.js +3 -0
  62. package/lib/index.js.map +1 -1
  63. package/package.json +1 -1
@@ -1,46 +1,80 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
9
+
8
10
  var _react = _interopRequireDefault(require("react"));
11
+
9
12
  var _button = _interopRequireDefault(require("antd/lib/button"));
13
+
10
14
  var _input = _interopRequireDefault(require("antd/lib/input"));
15
+
11
16
  var _message = _interopRequireDefault(require("antd/lib/message"));
17
+
12
18
  var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
19
+
13
20
  var _radio = _interopRequireDefault(require("antd/lib/radio"));
21
+
14
22
  var _popover = _interopRequireDefault(require("antd/lib/popover"));
23
+
15
24
  var _VtxModal = require("../VtxModal");
25
+
16
26
  var _VtxMap = require("../VtxMap");
27
+
17
28
  var _default2 = _interopRequireWildcard(require("../default"));
29
+
18
30
  var _mapping = require("./mapping");
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
21
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
+
22
38
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
39
+
40
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
+
42
+ 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; }
43
+
25
44
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
- 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, _toPropertyKey(descriptor.key), descriptor); } }
45
+
46
+ 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); } }
47
+
27
48
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
49
+
28
50
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
51
+
29
52
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
53
+
30
54
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
55
+
31
56
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
57
+
32
58
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
59
+
33
60
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
61
+
34
62
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
37
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
63
+
64
+ 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; }
65
+
38
66
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
67
+
39
68
  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."); }
69
+
40
70
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
71
+
41
72
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
73
+
42
74
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
43
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } //公共地址配置
75
+
76
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
77
+
44
78
  var styles = {
45
79
  searchModal: "vtx-ui-searchmap-searchmodal",
46
80
  searchMap: "vtx-ui-searchmap-searchmap",
@@ -62,17 +96,18 @@ var styles = {
62
96
  hiddenLabel: "vtx-ui-searchmap-hiddenlabel",
63
97
  otherModal: "vtx-ui-searchmap-othermodal",
64
98
  mapTxt: 'vtx-ui-searchmap-mapTxt'
65
- };
66
-
67
- // message.config({
99
+ }; // message.config({
68
100
  // top: document.getElementById('root').offsetHeight/3,
69
101
  // duration: 5,
70
102
  // });
103
+
71
104
  var warning = function warning() {
72
105
  _message["default"].warning("位置点查询失败,请缩小比例尺或切换关键字后再重新查询!");
73
106
  };
107
+
74
108
  function distinct(ary) {
75
109
  var pts = _toConsumableArray(ary);
110
+
76
111
  if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
77
112
  pts.pop();
78
113
  return distinct(pts);
@@ -80,24 +115,31 @@ function distinct(ary) {
80
115
  return pts;
81
116
  }
82
117
  }
118
+
83
119
  var getIcon = function getIcon(type) {
84
120
  return _default2.antdMajorVersion === "4" ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
85
121
  type: "icon-".concat(_mapping.iconMapping[type])
86
122
  }) : type;
87
123
  };
124
+
88
125
  var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
89
126
  _inherits(VtxSearchCheckMap, _React$Component);
127
+
90
128
  var _super = _createSuper(VtxSearchCheckMap);
129
+
91
130
  function VtxSearchCheckMap(props) {
92
131
  var _this;
132
+
93
133
  _classCallCheck(this, VtxSearchCheckMap);
134
+
94
135
  _this = _super.call(this, props);
95
- // 绘制多个图元时返回参数
136
+
96
137
  _defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
97
138
  var resData = [];
98
139
  var _this$state = _this.state,
99
- graphicValue = _this$state.graphicValue,
100
- editGraphic = _this$state.editGraphic;
140
+ graphicValue = _this$state.graphicValue,
141
+ editGraphic = _this$state.editGraphic;
142
+
101
143
  switch (graphicType) {
102
144
  case "polygon":
103
145
  [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
@@ -107,21 +149,25 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
107
149
  });
108
150
  });
109
151
  break;
152
+
110
153
  default:
111
154
  break;
112
155
  }
156
+
113
157
  return resData.length ? resData : null;
114
158
  });
159
+
115
160
  _this.map = null; //Map组件的ref对象
161
+
116
162
  _this.mapLoaded = false;
117
163
  _this.isDrawStatus = false;
118
164
  _this.isClickMap = false;
119
165
  _this.apid = []; //所有点id,除编辑点外
166
+
120
167
  _this.loadExtent = null;
121
168
  _this.mapId = "searchMap".concat(new Date().getTime());
122
169
  _this.multiDraw = props.multiDraw && ["polygon"].includes(props.graphicType);
123
- _this.clickable = false,
124
- // 多个面绘制时,是否可以点击面进行编辑
170
+ _this.clickable = false, // 多个面绘制时,是否可以点击面进行编辑
125
171
  _this.state = {
126
172
  //列表和地图宽度切换的动画需要
127
173
  isShowList: false,
@@ -140,6 +186,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
140
186
  graphicValue: _this.multiDraw ? [] : null,
141
187
  // 绘制图元id集合
142
188
  drawGraphID: _this.multiDraw ? ["drawnGraph"] : "drawnGraph",
189
+
143
190
  /*地图Api参数*/
144
191
  mapCenter: props.mapCenter || "",
145
192
  maxZoom: props.maxZoom,
@@ -160,6 +207,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
160
207
  editGraphic: _this.multiDraw ? [] : null,
161
208
  mapZoomLevel: props.mapZoomLevel || 11,
162
209
  setZoomLevel: false,
210
+
163
211
  /*modal参数*/
164
212
  modal1Visible: props.modal1Visible || false,
165
213
  isShowOther: props.isShowOther || false,
@@ -174,25 +222,31 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
174
222
  currentMap: 'normal'
175
223
  };
176
224
  return _this;
177
- }
225
+ } // 绘制多个图元时返回参数
226
+
227
+
178
228
  _createClass(VtxSearchCheckMap, [{
179
229
  key: "callback",
180
- value:
181
- //经纬度回调
230
+ value: //经纬度回调
182
231
  function callback() {
183
232
  var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "callback";
233
+
184
234
  if (fun in this.props && typeof this.props[fun] === "function") {
185
235
  var editGraphicId = this.state.editGraphicId;
236
+
186
237
  switch (this.state.graphicType) {
187
238
  case "point":
188
239
  var locationPoint = this.state.locationPoint;
240
+
189
241
  if (this.map.getGraphic("locationPoint")) {
190
242
  var p = this.map.getGraphic(locationPoint[0].id).geometry;
191
243
  this.props[fun]([p.x, p.y]);
192
244
  } else {
193
245
  return [];
194
246
  }
247
+
195
248
  break;
249
+
196
250
  case "circle":
197
251
  this.props[fun](this.state.graphicValue ? {
198
252
  x: this.state.graphicValue.geometry.x,
@@ -201,13 +255,16 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
201
255
  area: this.state.graphicValue.area
202
256
  } : null);
203
257
  break;
258
+
204
259
  case "polygon":
205
260
  if (this.multiDraw) {
206
261
  this.props[fun](this.getMultiRes("polygon"));
207
262
  return;
208
263
  }
264
+
209
265
  if (this.map.getGraphic(editGraphicId)) {
210
266
  var _p = this.map.getGraphic(editGraphicId);
267
+
211
268
  this.props[fun]({
212
269
  rings: distinct(_p.geometry.rings),
213
270
  area: this.map.getPolygonArea(distinct(_p.geometry.rings))
@@ -218,16 +275,20 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
218
275
  area: this.state.graphicValue.area
219
276
  } : null);
220
277
  }
278
+
221
279
  break;
280
+
222
281
  case "rectangle":
223
282
  this.props[fun](this.state.graphicValue ? {
224
283
  rings: distinct(this.state.graphicValue.geometry.rings),
225
284
  area: this.state.graphicValue.area
226
285
  } : null);
227
286
  break;
287
+
228
288
  case "polyline":
229
289
  if (this.map.getGraphic(editGraphicId)) {
230
290
  var _p2 = this.map.getGraphic(editGraphicId);
291
+
231
292
  this.props[fun]({
232
293
  paths: _p2.geometry.paths,
233
294
  length: this.map.calculateDistance(_p2.geometry.paths)
@@ -238,9 +299,11 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
238
299
  length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
239
300
  } : null);
240
301
  }
302
+
241
303
  break;
242
304
  }
243
305
  }
306
+
244
307
  if (this.props.clearDrawnGraph) {
245
308
  this.clearDrawnGraph();
246
309
  }
@@ -251,17 +314,18 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
251
314
  this.setState({
252
315
  isShowList: bealoon
253
316
  });
254
- }
255
- //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
317
+ } //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
318
+
256
319
  }, {
257
320
  key: "drawLocationPoint",
258
321
  value: function drawLocationPoint() {
259
- var t = this;
260
- //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
322
+ var t = this; //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
323
+
261
324
  if (this.props.mapType !== "gmap" || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
262
325
  var lglt = this.map.getMapExtent(),
263
- editGraphic = null,
264
- editGraphicId = "locationPoint";
326
+ editGraphic = null,
327
+ editGraphicId = "locationPoint";
328
+
265
329
  if (!this.multiDraw && this.props.editParam) {
266
330
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
267
331
  editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
@@ -269,6 +333,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
269
333
  });
270
334
  editGraphicId = "drawnGraph";
271
335
  }
336
+
272
337
  if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
273
338
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
274
339
  editGraphic = this.props.editParam.map(function (item, index) {
@@ -278,6 +343,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
278
343
  });
279
344
  editGraphicId = null;
280
345
  }
346
+
281
347
  this.isinit = false;
282
348
  this.setState({
283
349
  editGraphic: editGraphic,
@@ -308,51 +374,53 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
308
374
  t.drawLocationPoint();
309
375
  }, 50);
310
376
  }
311
- }
312
- //校正定位的点位位置到当前的中心点
377
+ } //校正定位的点位位置到当前的中心点
378
+
313
379
  }, {
314
380
  key: "correction",
315
381
  value: function correction() {
316
- var t = this;
317
- //获取当前中心点经纬度
382
+ var t = this; //获取当前中心点经纬度
383
+
318
384
  var lglt = this.map.getMapExtent();
319
385
  var _t$state = t.state,
320
- locationPoint = _t$state.locationPoint,
321
- checkValue = _t$state.checkValue;
386
+ locationPoint = _t$state.locationPoint,
387
+ checkValue = _t$state.checkValue;
322
388
  locationPoint = locationPoint.map(function (item, index) {
323
389
  return _objectSpread(_objectSpread({}, item), {}, {
324
390
  longitude: lglt.nowCenter.lng,
325
391
  latitude: lglt.nowCenter.lat
326
392
  });
327
393
  });
328
- this.map.updatePoint(locationPoint);
329
- // 若坐标反查选中,校正是需要更新输入框中的经纬度
394
+ this.map.updatePoint(locationPoint); // 若坐标反查选中,校正是需要更新输入框中的经纬度
395
+
330
396
  if (checkValue) this.setState({
331
397
  searchValue: "".concat(lglt.nowCenter.lng, ",").concat(lglt.nowCenter.lat)
332
398
  });
333
- }
334
- //搜索关键字切换
399
+ } //搜索关键字切换
400
+
335
401
  }, {
336
402
  key: "changeValue",
337
403
  value: function changeValue(e) {
338
404
  this.setState({
339
405
  searchValue: e.target.value
340
406
  });
341
- }
342
- //根据关键字搜索数据
407
+ } //根据关键字搜索数据
408
+
343
409
  }, {
344
410
  key: "searchList",
345
411
  value: function searchList() {
346
412
  //因为antd组件问题,这边使用手动关键位,控制方法执行
347
413
  var t = this;
414
+
348
415
  if (!this.state.checkValue) {
349
416
  // 非点位并且点位非坐标反查时
350
417
  var searchPoints = t.map.searchPoints(this.state.searchValue);
351
418
  searchPoints.then(function (results) {
352
419
  if (results.length > 0) {
353
420
  var lsp = [],
354
- lsm = [];
421
+ lsm = [];
355
422
  t.apid = [];
423
+
356
424
  for (var i = 0; i < results.length; i++) {
357
425
  var r = results[i];
358
426
  lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
@@ -367,6 +435,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
367
435
  });
368
436
  t.apid.push(r.id);
369
437
  }
438
+
370
439
  t.setState({
371
440
  listPoint: lsp,
372
441
  listMess: lsm,
@@ -379,23 +448,30 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
379
448
  });
380
449
  } else {
381
450
  var _this$state$searchVal;
451
+
382
452
  // 点位弹框并坐标反查情况
383
- var lnglats = (_this$state$searchVal = this.state.searchValue) === null || _this$state$searchVal === void 0 ? void 0 : _this$state$searchVal.split(",");
384
- // 英文逗号分割,若长度为不为2,表示数据格式错误
453
+ var lnglats = (_this$state$searchVal = this.state.searchValue) === null || _this$state$searchVal === void 0 ? void 0 : _this$state$searchVal.split(","); // 英文逗号分割,若长度为不为2,表示数据格式错误
454
+
385
455
  if ((lnglats === null || lnglats === void 0 ? void 0 : lnglats.length) !== 2) {
386
456
  _message["default"].warning("请按正确的经纬度格式输入,经度在前,用英文逗号隔开!");
457
+
387
458
  return;
388
- }
389
- // 经纬度分别正则校验
459
+ } // 经纬度分别正则校验
460
+
461
+
390
462
  if (!new RegExp(/^[\-\+]?(0(\.\d{1,15})?|([1-9](\d)?)(\.\d{1,15})?|1[0-7]\d{1}(\.\d{1,15})?|180\.0{1,15})$/).test(lnglats[0])) {
391
463
  _message["default"].warning("请输入正确格式经度!");
464
+
392
465
  return;
393
466
  }
467
+
394
468
  if (!new RegExp(/^[\-\+]?((0|([1-8]\d?))(\.\d{1,15})?|90(\.0{1,15})?)$/).test(lnglats[1])) {
395
469
  _message["default"].warning("请输入正确格式纬度!");
470
+
396
471
  return;
397
- }
398
- // 正确的经纬度作为地图中心点
472
+ } // 正确的经纬度作为地图中心点
473
+
474
+
399
475
  var centerPoint = [{
400
476
  id: "locationPoint",
401
477
  longitude: lnglats[0],
@@ -412,12 +488,13 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
412
488
  });
413
489
  this.map.updatePoint(centerPoint);
414
490
  }
415
- }
416
- //返回最佳位置(zoom,center)
491
+ } //返回最佳位置(zoom,center)
492
+
417
493
  }, {
418
494
  key: "setFitView",
419
495
  value: function setFitView() {
420
496
  var _this2 = this;
497
+
421
498
  this.setState({
422
499
  mapVisiblePoints: {
423
500
  fitView: this.apid,
@@ -429,8 +506,8 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
429
506
  setVisiblePoints: false
430
507
  });
431
508
  });
432
- }
433
- //清空列表的所有数据(包括点位)
509
+ } //清空列表的所有数据(包括点位)
510
+
434
511
  }, {
435
512
  key: "clearList",
436
513
  value: function clearList() {
@@ -441,15 +518,15 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
441
518
  listMess: [],
442
519
  isShowList: false
443
520
  });
444
- }
445
- //列表选中地址
521
+ } //列表选中地址
522
+
446
523
  }, {
447
524
  key: "chooseAddress",
448
525
  value: function chooseAddress(id) {
449
526
  var t = this;
450
527
  var _this$state2 = this.state,
451
- listPoint = _this$state2.listPoint,
452
- listMess = _this$state2.listMess;
528
+ listPoint = _this$state2.listPoint,
529
+ listMess = _this$state2.listMess;
453
530
  var mapCenter = [];
454
531
  listPoint = listPoint.map(function (item, index) {
455
532
  if (item.id === id) {
@@ -485,6 +562,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
485
562
  t.setState({
486
563
  setCenter: false
487
564
  });
565
+
488
566
  if (t.state.graphicType == "point") {
489
567
  t.correction();
490
568
  }
@@ -494,11 +572,14 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
494
572
  key: "clickGraphic",
495
573
  value: function clickGraphic(obj) {
496
574
  var _this3 = this;
575
+
497
576
  if (obj.type === "point" && obj.attributes.other === "search") {
498
577
  this.chooseAddress(obj.attributes.id);
499
578
  }
579
+
500
580
  if (this.clickable && obj.type === "polygon") {
501
581
  var _obj$param$attributes;
582
+
502
583
  // 开启编辑
503
584
  this.setState({
504
585
  editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
@@ -522,16 +603,17 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
522
603
  this.setState({
523
604
  modal1Visible: false
524
605
  });
525
- }
526
- // if(this.props.clearDrawnGraph){
527
- this.clearDrawnGraph();
528
- // }
606
+ } // if(this.props.clearDrawnGraph){
607
+
608
+
609
+ this.clearDrawnGraph(); // }
529
610
  }
530
611
  }
531
612
  }, {
532
613
  key: "clearDrawnGraph",
533
614
  value: function clearDrawnGraph() {
534
615
  var _this4 = this;
616
+
535
617
  this.isDrawStatus = true;
536
618
  this.setState({
537
619
  isDraw: this.state.graphicType !== "point",
@@ -547,6 +629,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
547
629
  key: "continueDraw",
548
630
  value: function continueDraw() {
549
631
  var _this5 = this;
632
+
550
633
  this.clickable = false;
551
634
  this.setState({
552
635
  isDraw: false,
@@ -565,11 +648,15 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
565
648
  key: "editGraphic",
566
649
  value: function editGraphic() {
567
650
  var _this6 = this;
651
+
568
652
  if (this.isDrawStatus && this.isClickMap) {
569
653
  _message["default"].warning("请双击结束图元编辑");
654
+
570
655
  return;
571
656
  }
657
+
572
658
  _message["default"].info("请点击图元进行编辑");
659
+
573
660
  this.clickable = true;
574
661
  this.isDrawStatus = false;
575
662
  this.setState({
@@ -588,17 +675,18 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
588
675
  key: "editGraphicChange",
589
676
  value: function editGraphicChange(obj) {
590
677
  var checkValue = this.state.checkValue;
591
- console.log(checkValue);
592
- // 若坐标反查选中
678
+ console.log(checkValue); // 若坐标反查选中
679
+
593
680
  if (checkValue) {
594
681
  this.setState({
595
682
  searchValue: "".concat(obj.geometry.x, ",").concat(obj.geometry.y)
596
683
  });
597
684
  }
685
+
598
686
  if (!this.multiDraw) return;
599
687
  var _this$state3 = this.state,
600
- graphicValue = _this$state3.graphicValue,
601
- editGraphic = _this$state3.editGraphic;
688
+ graphicValue = _this$state3.graphicValue,
689
+ editGraphic = _this$state3.editGraphic;
602
690
  this.setState({
603
691
  graphicValue: (graphicValue || []).map(function (item) {
604
692
  return item.id === obj.id ? obj : item;
@@ -607,8 +695,8 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
607
695
  return item.id === obj.id ? obj : item;
608
696
  })
609
697
  });
610
- }
611
- // 点位反查
698
+ } // 点位反查
699
+
612
700
  }, {
613
701
  key: "counterCheck",
614
702
  value: function counterCheck() {
@@ -626,6 +714,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
626
714
  currentMap: str
627
715
  });
628
716
  var layers = [];
717
+
629
718
  switch (mapType) {
630
719
  case 'amap':
631
720
  case 'bmap':
@@ -635,9 +724,12 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
635
724
  } else {
636
725
  t.map.setMapType('wx');
637
726
  }
727
+
638
728
  break;
729
+
639
730
  case 'gmap':
640
731
  break;
732
+
641
733
  default:
642
734
  break;
643
735
  }
@@ -646,40 +738,41 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
646
738
  key: "render",
647
739
  value: function render() {
648
740
  var _this7 = this;
741
+
649
742
  var t = this;
650
743
  var _this$state4 = this.state,
651
- isShowList = _this$state4.isShowList,
652
- searchValue = _this$state4.searchValue,
653
- locationPoint = _this$state4.locationPoint,
654
- listPoint = _this$state4.listPoint,
655
- listMess = _this$state4.listMess,
656
- mapZoomLevel = _this$state4.mapZoomLevel,
657
- setZoomLevel = _this$state4.setZoomLevel,
658
- maxZoom = _this$state4.maxZoom,
659
- minZoom = _this$state4.minZoom,
660
- wkid = _this$state4.wkid,
661
- mapServer = _this$state4.mapServer,
662
- mapCenter = _this$state4.mapCenter,
663
- setCenter = _this$state4.setCenter,
664
- mapType = _this$state4.mapType,
665
- mapStyle = _this$state4.mapStyle,
666
- mapVisiblePoints = _this$state4.mapVisiblePoints,
667
- setVisiblePoints = _this$state4.setVisiblePoints,
668
- isDoEdit = _this$state4.isDoEdit,
669
- editGraphicId = _this$state4.editGraphicId,
670
- isEndEdit = _this$state4.isEndEdit,
671
- modal1Visible = _this$state4.modal1Visible,
672
- drawGraphID = _this$state4.drawGraphID,
673
- isShowOther = _this$state4.isShowOther,
674
- otherText = _this$state4.otherText,
675
- isShowOtherGraph = _this$state4.isShowOtherGraph,
676
- editGraphic = _this$state4.editGraphic,
677
- graphicType = _this$state4.graphicType,
678
- graphicValue = _this$state4.graphicValue,
679
- olProps = _this$state4.olProps,
680
- checkValue = _this$state4.checkValue,
681
- isChangeMapType = _this$state4.isChangeMapType,
682
- currentMap = _this$state4.currentMap;
744
+ isShowList = _this$state4.isShowList,
745
+ searchValue = _this$state4.searchValue,
746
+ locationPoint = _this$state4.locationPoint,
747
+ listPoint = _this$state4.listPoint,
748
+ listMess = _this$state4.listMess,
749
+ mapZoomLevel = _this$state4.mapZoomLevel,
750
+ setZoomLevel = _this$state4.setZoomLevel,
751
+ maxZoom = _this$state4.maxZoom,
752
+ minZoom = _this$state4.minZoom,
753
+ wkid = _this$state4.wkid,
754
+ mapServer = _this$state4.mapServer,
755
+ mapCenter = _this$state4.mapCenter,
756
+ setCenter = _this$state4.setCenter,
757
+ mapType = _this$state4.mapType,
758
+ mapStyle = _this$state4.mapStyle,
759
+ mapVisiblePoints = _this$state4.mapVisiblePoints,
760
+ setVisiblePoints = _this$state4.setVisiblePoints,
761
+ isDoEdit = _this$state4.isDoEdit,
762
+ editGraphicId = _this$state4.editGraphicId,
763
+ isEndEdit = _this$state4.isEndEdit,
764
+ modal1Visible = _this$state4.modal1Visible,
765
+ drawGraphID = _this$state4.drawGraphID,
766
+ isShowOther = _this$state4.isShowOther,
767
+ otherText = _this$state4.otherText,
768
+ isShowOtherGraph = _this$state4.isShowOtherGraph,
769
+ editGraphic = _this$state4.editGraphic,
770
+ graphicType = _this$state4.graphicType,
771
+ graphicValue = _this$state4.graphicValue,
772
+ olProps = _this$state4.olProps,
773
+ checkValue = _this$state4.checkValue,
774
+ isChangeMapType = _this$state4.isChangeMapType,
775
+ currentMap = _this$state4.currentMap;
683
776
  var InputProps = {
684
777
  style: {
685
778
  width: "200px",
@@ -690,8 +783,8 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
690
783
  onChange: this.changeValue.bind(this),
691
784
  onPressEnter: this.searchList.bind(this),
692
785
  onKeyDown: this.changeValue.bind(this)
693
- };
694
- // 经纬度反查输入框
786
+ }; // 经纬度反查输入框
787
+
695
788
  var checkInputProps = {
696
789
  style: {
697
790
  width: "200px",
@@ -717,9 +810,11 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
717
810
  isDoEdit: !_this7.multiDraw,
718
811
  isDraw: _this7.multiDraw
719
812
  };
813
+
720
814
  if (!_this7.multiDraw && (obj.geometryType == "polyline" || obj.geometryType == "polygon")) {
721
815
  objparam.editGraphicId = obj.id;
722
816
  }
817
+
723
818
  _this7.setState(objparam);
724
819
  },
725
820
  mapDraw: {
@@ -751,41 +846,49 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
751
846
  }
752
847
  };
753
848
  var mapPoints = [],
754
- mapLines = [],
755
- mapPolygons = [],
756
- mapCircles = [];
849
+ mapLines = [],
850
+ mapPolygons = [],
851
+ mapCircles = [];
852
+
757
853
  if (graphicType == "point") {
758
854
  mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
759
855
  } else {
760
856
  mapPoints = _toConsumableArray(listPoint);
761
857
  }
858
+
762
859
  if (graphicType === "polygon") {
763
860
  if (editGraphic) {
764
861
  var _mapPolygons;
862
+
765
863
  Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
766
864
  !this.multiDraw && (drawProps = null);
767
865
  }
768
866
  }
867
+
769
868
  if (graphicType === "polyline") {
770
869
  if (editGraphic) {
771
870
  mapLines.push(editGraphic);
772
871
  drawProps = null;
773
872
  }
774
873
  }
874
+
775
875
  if (graphicType === "rectangle") {
776
876
  if (editGraphic) {
777
877
  mapPolygons.push(editGraphic);
778
878
  drawProps = null;
779
879
  }
780
880
  }
881
+
781
882
  if (graphicType === "circle") {
782
883
  if (editGraphic) {
783
884
  mapCircles.push(editGraphic);
784
885
  drawProps = null;
785
886
  }
786
887
  }
888
+
787
889
  if (isShowOtherGraph) {
788
890
  var otherGraph = this.props.otherGraph;
891
+
789
892
  if (otherGraph) {
790
893
  mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
791
894
  mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
@@ -793,6 +896,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
793
896
  mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
794
897
  }
795
898
  }
899
+
796
900
  var mapTypeContent = /*#__PURE__*/_react["default"].createElement("div", {
797
901
  style: {
798
902
  width: '170px',
@@ -828,6 +932,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
828
932
  }, /*#__PURE__*/_react["default"].createElement("img", {
829
933
  src: "".concat(_default2["default"].mapServerURL, "/images/wx.png")
830
934
  })));
935
+
831
936
  return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
832
937
  title: this.state.graphicType == "point" ? "定位" : "绘制",
833
938
  style: {
@@ -881,14 +986,16 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
881
986
  disabled: this.isDrawStatus,
882
987
  onClick: function onClick() {
883
988
  _this7.isDrawStatus = true;
989
+
884
990
  if (_this7.multiDraw) {
885
991
  _this7.clickable = false;
886
- graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
992
+ graphicValue === null || graphicValue === void 0 ? void 0 : graphicValue.forEach(function (item) {
887
993
  return t.map.removeGraphic(item.id, "draw");
888
994
  });
889
- editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
995
+ editGraphic === null || editGraphic === void 0 ? void 0 : editGraphic.forEach(function (item) {
890
996
  return t.map.removeGraphic(item.id, "draw");
891
997
  });
998
+
892
999
  _this7.setState({
893
1000
  isDraw: false,
894
1001
  isCloseDraw: true,
@@ -915,6 +1022,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
915
1022
  });
916
1023
  });
917
1024
  }
1025
+
918
1026
  _this7.callback("editDraw");
919
1027
  },
920
1028
  icon: getIcon("edit")
@@ -1018,11 +1126,15 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
1018
1126
  key: "initSearchMap",
1019
1127
  value: function initSearchMap() {
1020
1128
  var _this8 = this;
1021
- if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
1129
+
1130
+ if (this.props.modal1Visible
1131
+ /*&& !this.state.locationPoint[0]*/
1132
+ ) {
1022
1133
  if (this.map) {
1023
1134
  this.map.loadMapComplete.then(function () {
1024
1135
  if (!_this8.mapLoaded) {
1025
1136
  _this8.mapLoaded = true;
1137
+
1026
1138
  _this8.drawLocationPoint();
1027
1139
  }
1028
1140
  });
@@ -1045,16 +1157,20 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
1045
1157
  key: "componentWillReceiveProps",
1046
1158
  value: function componentWillReceiveProps(nextProps) {
1047
1159
  var _this9 = this;
1160
+
1048
1161
  var t = this;
1049
1162
  this.isClickMap = false;
1163
+
1050
1164
  if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
1051
1165
  this.map.clearAll();
1052
1166
  t.mapLoaded = false;
1053
1167
  t.isinit = true;
1054
1168
  }
1169
+
1055
1170
  if (nextProps.editParam) {
1056
1171
  t.mapLoaded = false;
1057
1172
  }
1173
+
1058
1174
  t.isDrawStatus = nextProps.graphicType !== "point" && !nextProps.editParam;
1059
1175
  this.setState({
1060
1176
  modal1Visible: nextProps.modal1Visible,
@@ -1079,6 +1195,7 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
1079
1195
  //实现2+次进入时,清理数据
1080
1196
  if (nextProps.modal1Visible) {
1081
1197
  _this9.clearList();
1198
+
1082
1199
  _this9.setState({
1083
1200
  setZoomLevel: true
1084
1201
  }, function () {
@@ -1086,27 +1203,39 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
1086
1203
  setZoomLevel: false
1087
1204
  });
1088
1205
  });
1206
+
1089
1207
  if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1090
1208
  if (_this9.map.getGraphic("locationPoint")) {
1091
1209
  switch (nextProps.mapType) {
1092
1210
  case "bmap":
1093
1211
  _this9.map.getGraphic("locationPoint").mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1212
+
1094
1213
  break;
1214
+
1095
1215
  case "amap":
1096
1216
  _this9.map.getGraphic("locationPoint").mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1217
+
1097
1218
  break;
1219
+
1098
1220
  case "tmap":
1099
1221
  _this9.map.getGraphic("locationPoint").mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1222
+
1100
1223
  break;
1224
+
1101
1225
  case "gmap":
1102
1226
  _this9.map.getGraphic("locationPoint").mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
1227
+
1103
1228
  _this9.map.getGraphic("locationPoint").mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
1229
+
1104
1230
  _this9.map.state.gis.graphics.refresh();
1231
+
1105
1232
  case "olMap":
1106
1233
  _this9.map.getGraphic("locationPoint").mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1234
+
1107
1235
  break;
1108
1236
  }
1109
1237
  }
1238
+
1110
1239
  _this9.map.setCenter(nextProps.mapCenter);
1111
1240
  }
1112
1241
  }
@@ -1117,13 +1246,17 @@ var VtxSearchCheckMap = /*#__PURE__*/function (_React$Component) {
1117
1246
  value: function componentWillUnmount() {
1118
1247
  //关闭moveTo定时
1119
1248
  var t = this;
1249
+
1120
1250
  if (t.loadExtent) {
1121
1251
  clearInterval(t.loadExtent);
1122
1252
  }
1123
1253
  }
1124
1254
  }]);
1255
+
1125
1256
  return VtxSearchCheckMap;
1126
1257
  }(_react["default"].Component);
1127
- var _default = exports["default"] = VtxSearchCheckMap;
1258
+
1259
+ var _default = VtxSearchCheckMap;
1260
+ exports["default"] = _default;
1128
1261
  module.exports = exports["default"];
1129
1262
  //# sourceMappingURL=VtxSearchCheckMap.js.map