@vtx/map 1.2.22 → 1.2.24

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