@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,92 +1,51 @@
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 _popover = _interopRequireDefault(require("antd/lib/popover"));
21
-
22
14
  var _VtxModal = require("../VtxModal");
23
-
24
15
  var _VtxMap = require("../VtxMap");
25
-
26
16
  var _default2 = _interopRequireWildcard(require("../default"));
27
-
28
17
  var _mapping = require("./mapping");
29
-
30
18
  var _util = require("../utils/util");
31
-
32
19
  var _antd = require("antd");
33
-
34
20
  var _defaultMarker = _interopRequireDefault(require("../VtxMap/images/defaultMarker.png"));
35
-
36
- 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); }
37
-
38
- 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; }
39
-
40
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
41
-
42
- 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); }
43
-
44
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
-
21
+ 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); }
22
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
23
+ 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); }
24
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
46
25
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
47
-
48
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
49
-
50
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
-
52
- 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; }
53
-
54
- 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; }
55
-
56
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
57
-
58
- 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
-
60
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
61
-
62
- 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); }
63
-
64
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
65
-
66
- 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); }; }
67
-
68
- 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); }
69
-
70
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
71
-
72
- 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; } }
73
-
74
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
75
-
76
- 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; }
77
-
78
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
79
-
26
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
27
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
28
+ 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; }
29
+ 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; }
30
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
31
+ 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); } }
32
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
33
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
34
+ 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); }
35
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
36
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
37
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
38
+ 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); }
39
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
40
+ 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; }
41
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
42
+ 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); }
43
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
80
44
  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."); }
81
-
82
- 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); }
83
-
84
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
85
-
86
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
87
-
88
- 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; }
89
-
45
+ 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; } }
46
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
47
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
48
+ 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; } //公共地址配置
90
49
  var styles = {
91
50
  searchModal: 'vtx-ui-searchmap-searchmodal',
92
51
  searchMap: 'vtx-ui-searchmap-searchmap',
@@ -119,18 +78,20 @@ var CoverageTypes = [{
119
78
  }, {
120
79
  name: '卫星底图',
121
80
  key: 'wx'
122
- }]; // message.config({
81
+ }];
82
+
83
+ // message.config({
123
84
  // top: document.getElementById('root').offsetHeight/3,
124
85
  // duration: 5,
125
86
  // });
126
-
127
87
  var warning = function warning() {
128
88
  _message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
129
89
  };
130
-
131
90
  function distinct(ary) {
91
+ if ((ary === null || ary === void 0 ? void 0 : ary.length) < 2) {
92
+ return ary;
93
+ }
132
94
  var pts = _toConsumableArray(ary);
133
-
134
95
  if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
135
96
  pts.pop();
136
97
  return distinct(pts);
@@ -138,31 +99,22 @@ function distinct(ary) {
138
99
  return pts;
139
100
  }
140
101
  }
141
-
142
102
  var getIcon = function getIcon(type) {
143
103
  return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
144
104
  type: "icon-".concat(_mapping.iconMapping[type])
145
105
  }) : type;
146
106
  };
147
-
148
107
  var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
149
- _inherits(VtxSearchMap, _React$Component);
150
-
151
- var _super = _createSuper(VtxSearchMap);
152
-
153
108
  function VtxSearchMap(props) {
154
109
  var _this;
155
-
156
110
  _classCallCheck(this, VtxSearchMap);
157
-
158
- _this = _super.call(this, props);
159
-
160
- _defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
111
+ _this = _callSuper(this, VtxSearchMap, [props]);
112
+ // 绘制多个图元时返回参数
113
+ _defineProperty(_this, "getMultiRes", function (graphicType) {
161
114
  var resData = [];
162
115
  var _this$state = _this.state,
163
- graphicValue = _this$state.graphicValue,
164
- editGraphic = _this$state.editGraphic;
165
-
116
+ graphicValue = _this$state.graphicValue,
117
+ editGraphic = _this$state.editGraphic;
166
118
  switch (graphicType) {
167
119
  case 'polygon':
168
120
  [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
@@ -173,7 +125,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
173
125
  });
174
126
  });
175
127
  break;
176
-
177
128
  case 'polyline':
178
129
  [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
179
130
  resData.push({
@@ -182,26 +133,20 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
182
133
  length: _this.map.calculateDistance(item.paths || item.geometry.paths)
183
134
  });
184
135
  });
185
-
186
136
  default:
187
137
  break;
188
138
  }
189
-
190
139
  return resData.length ? resData : null;
191
140
  });
192
-
193
141
  _this.map = null; //Map组件的ref对象
194
-
195
142
  _this.mapLoaded = false;
196
143
  _this.isDrawStatus = false;
197
144
  _this.isClickMap = false;
198
145
  _this.apid = []; //所有点id,除编辑点外
199
-
200
146
  _this.loadExtent = null;
201
147
  _this.mapId = "searchMap".concat(new Date().getTime());
202
148
  _this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
203
149
  _this.clickable = false; // 多个面绘制时,是否可以点击面进行编辑
204
-
205
150
  _this.prefixUrl = props.prefixUrl || '';
206
151
  _this.searchPoiUrl = props.searchPoiUrl || '';
207
152
  _this.state = {
@@ -224,7 +169,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
224
169
  graphicValue: _this.multiDraw ? [] : null,
225
170
  // 绘制图元id集合
226
171
  drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
227
-
228
172
  /*地图Api参数*/
229
173
  mapCenter: props.mapCenter || '',
230
174
  maxZoom: props.maxZoom,
@@ -245,7 +189,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
245
189
  editGraphic: _this.multiDraw ? [] : null,
246
190
  mapZoomLevel: props.mapZoomLevel || 11,
247
191
  setZoomLevel: false,
248
-
249
192
  /*modal参数*/
250
193
  modal1Visible: props.modal1Visible || false,
251
194
  isShowOther: props.isShowOther || false,
@@ -294,35 +237,29 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
294
237
  areaText: '面积'
295
238
  }, props.customEnumText || {});
296
239
  return _this;
297
- } // 绘制多个图元时返回参数
298
-
299
-
300
- _createClass(VtxSearchMap, [{
240
+ }
241
+ _inherits(VtxSearchMap, _React$Component);
242
+ return _createClass(VtxSearchMap, [{
301
243
  key: "callback",
302
- value: //经纬度回调
244
+ value:
245
+ //经纬度回调
303
246
  function callback() {
304
247
  var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
305
-
306
248
  if (fun in this.props && typeof this.props[fun] === 'function') {
307
249
  var editGraphicId = this.state.editGraphicId;
308
-
309
250
  switch (this.state.graphicType) {
310
251
  case 'point':
311
252
  var locationPoint = this.state.locationPoint;
312
-
313
253
  if (this.map.getGraphic('locationPoint')) {
314
254
  var p = this.map.getGraphic(locationPoint[0].id).geometry;
315
255
  this.props[fun]([p.x, p.y]);
316
256
  } else {
317
257
  return [];
318
258
  }
319
-
320
259
  break;
321
-
322
260
  case 'circle':
323
261
  if (this.map.getGraphic(editGraphicId)) {
324
262
  var _p = this.map.getGraphic(editGraphicId);
325
-
326
263
  this.props[fun]({
327
264
  x: _p.geometry.x,
328
265
  y: _p.geometry.y,
@@ -337,18 +274,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
337
274
  area: this.state.graphicValue.area
338
275
  } : null);
339
276
  }
340
-
341
277
  break;
342
-
343
278
  case 'polygon':
344
279
  if (this.multiDraw) {
345
280
  this.props[fun](this.getMultiRes('polygon'));
346
281
  return;
347
282
  }
348
-
349
283
  if (this.map.getGraphic(editGraphicId)) {
350
284
  var _p2 = this.map.getGraphic(editGraphicId);
351
-
352
285
  this.props[fun]({
353
286
  rings: distinct(_p2.geometry.rings),
354
287
  area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
@@ -359,9 +292,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
359
292
  area: this.state.graphicValue.area
360
293
  } : null);
361
294
  }
362
-
363
295
  break;
364
-
365
296
  case 'rectangle':
366
297
  if (this.state.graphicValue) {
367
298
  this.props[fun](this.state.graphicValue ? {
@@ -377,18 +308,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
377
308
  } else {
378
309
  this.props[fun](null);
379
310
  }
380
-
381
311
  break;
382
-
383
312
  case 'polyline':
384
313
  if (this.multiDraw) {
385
314
  this.props[fun](this.getMultiRes('polyline'));
386
315
  return;
387
316
  }
388
-
389
317
  if (this.map.getGraphic(editGraphicId)) {
390
318
  var _p4 = this.map.getGraphic(editGraphicId);
391
-
392
319
  this.props[fun]({
393
320
  paths: _p4.geometry.paths,
394
321
  length: this.map.calculateDistance(_p4.geometry.paths)
@@ -399,11 +326,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
399
326
  length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
400
327
  } : null);
401
328
  }
402
-
403
329
  break;
404
330
  }
405
331
  }
406
-
407
332
  if (this.props.clearDrawnGraph) {
408
333
  this.clearDrawnGraph();
409
334
  }
@@ -414,18 +339,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
414
339
  this.setState({
415
340
  isShowList: bealoon
416
341
  });
417
- } //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
418
-
342
+ }
343
+ //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
419
344
  }, {
420
345
  key: "drawLocationPoint",
421
346
  value: function drawLocationPoint() {
422
- var t = this; //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
423
-
347
+ var t = this;
348
+ //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
424
349
  if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
425
350
  var lglt = this.map.getMapExtent(),
426
- editGraphic = null,
427
- editGraphicId = 'locationPoint';
428
-
351
+ editGraphic = null,
352
+ editGraphicId = 'locationPoint';
429
353
  if (!this.multiDraw && this.props.editParam) {
430
354
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
431
355
  editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
@@ -433,7 +357,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
433
357
  });
434
358
  editGraphicId = 'drawnGraph';
435
359
  }
436
-
437
360
  if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
438
361
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
439
362
  editGraphic = this.props.editParam.map(function (item, index) {
@@ -443,7 +366,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
443
366
  });
444
367
  editGraphicId = null;
445
368
  }
446
-
447
369
  this.isinit = false;
448
370
  this.setState({
449
371
  editGraphic: editGraphic,
@@ -474,13 +396,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
474
396
  t.drawLocationPoint();
475
397
  }, 50);
476
398
  }
477
- } //校正定位的点位位置到当前的中心点
478
-
399
+ }
400
+ //校正定位的点位位置到当前的中心点
479
401
  }, {
480
402
  key: "correction",
481
403
  value: function correction() {
482
- var t = this; //获取当前中心点经纬度
483
-
404
+ var t = this;
405
+ //获取当前中心点经纬度
484
406
  var lglt = this.map.getMapExtent();
485
407
  var locationPoint = t.state.locationPoint;
486
408
  locationPoint = locationPoint.map(function (item, index) {
@@ -490,32 +412,28 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
490
412
  });
491
413
  });
492
414
  this.map.updatePoint(locationPoint);
493
- } //搜索关键字切换
494
-
415
+ }
416
+ //搜索关键字切换
495
417
  }, {
496
418
  key: "changeValue",
497
419
  value: function changeValue(e) {
498
420
  this.setState({
499
421
  searchValue: e.target.value
500
422
  });
501
- } // 根据经纬度定位中心点
502
-
423
+ }
424
+ // 根据经纬度定位中心点
503
425
  }, {
504
426
  key: "locateByLnglat",
505
427
  value: function locateByLnglat() {
506
428
  var t = this;
507
-
508
429
  if (!t.state.searchValue) {
509
430
  _message["default"].warn(t.TextEnum.msgConfirmInputLnglatText);
510
-
511
431
  return;
512
432
  }
513
-
514
433
  var _t$state$searchValue$ = t.state.searchValue.split(','),
515
- _t$state$searchValue$2 = _slicedToArray(_t$state$searchValue$, 2),
516
- longitude = _t$state$searchValue$2[0],
517
- latitude = _t$state$searchValue$2[1];
518
-
434
+ _t$state$searchValue$2 = _slicedToArray(_t$state$searchValue$, 2),
435
+ longitude = _t$state$searchValue$2[0],
436
+ latitude = _t$state$searchValue$2[1];
519
437
  t.setState({
520
438
  mapCenter: [longitude, latitude],
521
439
  setCenter: true
@@ -523,31 +441,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
523
441
  t.setState({
524
442
  setCenter: false
525
443
  });
526
-
527
444
  if (t.state.graphicType == 'point') {
528
445
  t.correction();
529
446
  }
530
447
  });
531
- } //根据关键字搜索数据
532
-
448
+ }
449
+ //根据关键字搜索数据
533
450
  }, {
534
451
  key: "searchList",
535
452
  value: function searchList() {
536
453
  var t = this;
537
-
538
454
  if (!t.state.searchValue) {
539
455
  _message["default"].warn(this.TextEnum.msgConfirmInputText);
540
-
541
456
  return;
542
457
  }
543
-
544
458
  if (t.state.searchMode === 'lnglat') {
545
459
  t.locateByLnglat();
546
460
  } else {
547
461
  t.searchPointsLBS();
548
462
  }
549
- } // lbs解析经纬度为地址
550
-
463
+ }
464
+ // lbs解析经纬度为地址
551
465
  }, {
552
466
  key: "convertAddressByLnglat",
553
467
  value: function convertAddressByLnglat() {
@@ -555,7 +469,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
555
469
  console.log(obj);
556
470
  var t = this;
557
471
  var lnglat = '';
558
-
559
472
  if (obj.geometry && obj.geometry.type && ['point', 'circle'].includes(obj.geometry.type)) {
560
473
  lnglat = "".concat(obj.geometry.x, ",").concat(obj.geometry.y);
561
474
  } else if (obj.geometry && obj.geometry.paths) {
@@ -565,7 +478,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
565
478
  } else if (obj.geometry && obj.geometry.rings) {
566
479
  lnglat = getAvg(obj.geometry.rings);
567
480
  }
568
-
569
481
  if (!!lnglat) {
570
482
  $.ajax({
571
483
  url: "".concat(t.prefixUrl, "/vortexapi/rest/lbs/geoconvert/v2"),
@@ -581,7 +493,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
581
493
  success: function success(res) {
582
494
  if ((res === null || res === void 0 ? void 0 : res.result) === 0) {
583
495
  var _res$data;
584
-
585
496
  t.setState({
586
497
  lbsAddress: ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.address) || ''
587
498
  });
@@ -592,8 +503,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
592
503
  }
593
504
  });
594
505
  }
595
- } // 从lbs中查询
596
-
506
+ }
507
+ // 从lbs中查询
597
508
  }, {
598
509
  key: "searchPointsLBS",
599
510
  value: function searchPointsLBS() {
@@ -610,7 +521,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
610
521
  },
611
522
  success: function success(res) {
612
523
  console.log(res);
613
-
614
524
  if ((res === null || res === void 0 ? void 0 : res.result) === 0) {
615
525
  var list = res.data.map(function (item) {
616
526
  var lnglat = (0, _util.transform)({
@@ -636,8 +546,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
636
546
  _message["default"].warn("");
637
547
  }
638
548
  });
639
- } // 废弃
640
-
549
+ }
550
+ // 废弃
641
551
  }, {
642
552
  key: "searchPoints",
643
553
  value: function searchPoints() {
@@ -668,12 +578,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
668
578
  key: "handleSearch",
669
579
  value: function handleSearch(results) {
670
580
  var t = this;
671
-
672
581
  if (results.length > 0) {
673
582
  var lsp = [],
674
- lsm = [];
583
+ lsm = [];
675
584
  t.apid = [];
676
-
677
585
  for (var i = 0; i < results.length; i++) {
678
586
  var r = results[i];
679
587
  lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
@@ -688,7 +596,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
688
596
  });
689
597
  t.apid.push(r.id);
690
598
  }
691
-
692
599
  t.setState({
693
600
  listPoint: lsp,
694
601
  listMess: lsm,
@@ -698,13 +605,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
698
605
  } else {
699
606
  warning();
700
607
  }
701
- } //返回最佳位置(zoom,center)
608
+ }
702
609
 
610
+ //返回最佳位置(zoom,center)
703
611
  }, {
704
612
  key: "setFitView",
705
613
  value: function setFitView() {
706
614
  var _this2 = this;
707
-
708
615
  this.setState({
709
616
  mapVisiblePoints: {
710
617
  fitView: this.apid,
@@ -716,8 +623,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
716
623
  setVisiblePoints: false
717
624
  });
718
625
  });
719
- } //清空列表的所有数据(包括点位)
720
-
626
+ }
627
+ //清空列表的所有数据(包括点位)
721
628
  }, {
722
629
  key: "clearList",
723
630
  value: function clearList() {
@@ -728,15 +635,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
728
635
  listMess: [],
729
636
  isShowList: false
730
637
  });
731
- } //列表选中地址
732
-
638
+ }
639
+ //列表选中地址
733
640
  }, {
734
641
  key: "chooseAddress",
735
642
  value: function chooseAddress(id) {
736
643
  var t = this;
737
644
  var _this$state2 = this.state,
738
- listPoint = _this$state2.listPoint,
739
- listMess = _this$state2.listMess;
645
+ listPoint = _this$state2.listPoint,
646
+ listMess = _this$state2.listMess;
740
647
  var mapCenter = [];
741
648
  listPoint = listPoint.map(function (item, index) {
742
649
  if (item.id === id) {
@@ -772,7 +679,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
772
679
  t.setState({
773
680
  setCenter: false
774
681
  });
775
-
776
682
  if (t.state.graphicType == 'point') {
777
683
  t.correction();
778
684
  }
@@ -783,33 +689,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
783
689
  value: function getAllOtherGraphId() {
784
690
  var ids = [];
785
691
  var _this$props$otherGrap = this.props.otherGraph,
786
- otherGraph = _this$props$otherGrap === void 0 ? {} : _this$props$otherGrap;
787
-
692
+ otherGraph = _this$props$otherGrap === void 0 ? {} : _this$props$otherGrap;
788
693
  for (var key in otherGraph) {
789
694
  (otherGraph[key] || []).forEach(function (item) {
790
695
  ids.push(item.id);
791
696
  });
792
697
  }
793
-
794
698
  return ids;
795
699
  }
796
700
  }, {
797
701
  key: "clickGraphic",
798
702
  value: function clickGraphic(obj) {
799
703
  var _this3 = this;
800
-
801
704
  var disableEditIds = this.getAllOtherGraphId();
802
-
803
705
  if (obj.attributes && disableEditIds.includes(obj.attributes.id)) {
804
706
  _message["default"].warn(this.TextEnum.msgDoNotAllowOtherGraph);
805
707
  } else {
806
708
  if (obj.type === 'point' && obj.attributes.other === 'search') {
807
709
  this.chooseAddress(obj.attributes.id);
808
710
  }
809
-
810
711
  if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
811
712
  var _obj$param$attributes;
812
-
813
713
  // 开启编辑
814
714
  this.setState({
815
715
  editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
@@ -827,7 +727,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
827
727
  value: function closeModal(e) {
828
728
  this.isDrawStatus = false;
829
729
  this.isClickMap = false;
830
-
831
730
  if (this.isDrawStatus && this.isClickMap) {
832
731
  _message["default"].warning(this.TextEnum.msgEndEditingDrawText);
833
732
  } else {
@@ -837,17 +736,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
837
736
  this.setState({
838
737
  modal1Visible: false
839
738
  });
840
- } // if(this.props.clearDrawnGraph){
841
-
842
-
843
- this.clearDrawnGraph(); // }
739
+ }
740
+ // if(this.props.clearDrawnGraph){
741
+ this.clearDrawnGraph();
742
+ // }
844
743
  }
845
744
  }
846
745
  }, {
847
746
  key: "clearDrawnGraph",
848
747
  value: function clearDrawnGraph() {
849
748
  var _this4 = this;
850
-
851
749
  this.isDrawStatus = true;
852
750
  this.setState({
853
751
  isDraw: this.state.graphicType !== 'point',
@@ -863,7 +761,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
863
761
  key: "continueDraw",
864
762
  value: function continueDraw(func) {
865
763
  var _this5 = this;
866
-
867
764
  this.clickable = false;
868
765
  this.setState({
869
766
  isDraw: false,
@@ -886,15 +783,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
886
783
  key: "editGraphic",
887
784
  value: function editGraphic() {
888
785
  var _this6 = this;
889
-
890
786
  if (this.isDrawStatus && this.isClickMap) {
891
787
  _message["default"].warning(this.TextEnum.msgEndEditingDrawText);
892
-
893
788
  return;
894
789
  }
895
-
896
790
  _message["default"].info(this.TextEnum.msgClickGraphicEditText);
897
-
898
791
  this.clickable = true;
899
792
  this.isDrawStatus = false;
900
793
  this.setState({
@@ -915,8 +808,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
915
808
  this.convertAddressByLnglat(obj);
916
809
  if (!this.multiDraw) return;
917
810
  var _this$state3 = this.state,
918
- graphicValue = _this$state3.graphicValue,
919
- editGraphic = _this$state3.editGraphic;
811
+ graphicValue = _this$state3.graphicValue,
812
+ editGraphic = _this$state3.editGraphic;
920
813
  this.setState({
921
814
  graphicValue: (graphicValue || []).map(function (item) {
922
815
  return item.id === obj.id ? obj : item;
@@ -935,7 +828,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
935
828
  currentMap: str
936
829
  });
937
830
  var layers = [];
938
-
939
831
  switch (mapType) {
940
832
  case 'amap':
941
833
  case 'bmap':
@@ -945,12 +837,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
945
837
  } else {
946
838
  t.map.setMapType('wx');
947
839
  }
948
-
949
840
  break;
950
-
951
841
  case 'gmap':
952
842
  break;
953
-
954
843
  default:
955
844
  break;
956
845
  }
@@ -959,12 +848,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
959
848
  key: "computeGraphic",
960
849
  value: function computeGraphic() {
961
850
  var _this7 = this;
962
-
963
851
  var str = '';
964
852
  var _this$state4 = this.state,
965
- graphicValue = _this$state4.graphicValue,
966
- editGraphicId = _this$state4.editGraphicId;
967
-
853
+ graphicValue = _this$state4.graphicValue,
854
+ editGraphicId = _this$state4.editGraphicId;
968
855
  switch (this.state.graphicType) {
969
856
  case 'circle':
970
857
  if (this.map.getGraphic(editGraphicId)) {
@@ -973,36 +860,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
973
860
  } else {
974
861
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
975
862
  }
976
-
977
863
  break;
978
-
979
864
  case 'polygon':
980
865
  if (this.map.getGraphic(editGraphicId)) {
981
866
  var _p5 = this.map.getGraphic(editGraphicId);
982
-
983
867
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(formatNumber(this.map.getPolygonArea(distinct(_p5.geometry.rings))), "\u33A1");
984
868
  } else {
985
869
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
986
870
  }
987
-
988
871
  break;
989
-
990
872
  case 'rectangle':
991
873
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
992
874
  break;
993
-
994
875
  case 'polyline':
995
876
  if (this.map.getGraphic(editGraphicId)) {
996
877
  var _p6 = this.map.getGraphic(editGraphicId);
997
-
998
878
  str = "".concat(this.TextEnum.lengthText, "\uFF1A").concat(formatNumber(this.map.calculateDistance(_p6.geometry.paths)), "m");
999
879
  } else {
1000
880
  str = "".concat(this.TextEnum.lengthText, "\uFF1A").concat(graphicValue ? formatNumber(this.map.calculateDistance(graphicValue.geometry.paths)) : '-', "m");
1001
881
  }
1002
-
1003
882
  break;
1004
883
  }
1005
-
1006
884
  if (str) {
1007
885
  return /*#__PURE__*/_react["default"].createElement("span", {
1008
886
  style: {
@@ -1024,45 +902,44 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1024
902
  key: "render",
1025
903
  value: function render() {
1026
904
  var _this8 = this;
1027
-
1028
905
  var t = this;
1029
906
  var TextEnum = t.TextEnum;
1030
907
  var _this$state5 = this.state,
1031
- isShowList = _this$state5.isShowList,
1032
- searchValue = _this$state5.searchValue,
1033
- locationPoint = _this$state5.locationPoint,
1034
- listPoint = _this$state5.listPoint,
1035
- listMess = _this$state5.listMess,
1036
- mapZoomLevel = _this$state5.mapZoomLevel,
1037
- setZoomLevel = _this$state5.setZoomLevel,
1038
- maxZoom = _this$state5.maxZoom,
1039
- minZoom = _this$state5.minZoom,
1040
- wkid = _this$state5.wkid,
1041
- mapServer = _this$state5.mapServer,
1042
- mapCenter = _this$state5.mapCenter,
1043
- setCenter = _this$state5.setCenter,
1044
- mapType = _this$state5.mapType,
1045
- mapStyle = _this$state5.mapStyle,
1046
- mapVisiblePoints = _this$state5.mapVisiblePoints,
1047
- setVisiblePoints = _this$state5.setVisiblePoints,
1048
- isDoEdit = _this$state5.isDoEdit,
1049
- editGraphicId = _this$state5.editGraphicId,
1050
- isEndEdit = _this$state5.isEndEdit,
1051
- modal1Visible = _this$state5.modal1Visible,
1052
- drawGraphID = _this$state5.drawGraphID,
1053
- isShowOther = _this$state5.isShowOther,
1054
- otherText = _this$state5.otherText,
1055
- isShowOtherGraph = _this$state5.isShowOtherGraph,
1056
- editGraphic = _this$state5.editGraphic,
1057
- graphicType = _this$state5.graphicType,
1058
- graphicValue = _this$state5.graphicValue,
1059
- olProps = _this$state5.olProps,
1060
- isChangeMapType = _this$state5.isChangeMapType,
1061
- currentMap = _this$state5.currentMap,
1062
- showControl = _this$state5.showControl,
1063
- coverageType = _this$state5.coverageType,
1064
- customNodes = _this$state5.customNodes,
1065
- language = _this$state5.language;
908
+ isShowList = _this$state5.isShowList,
909
+ searchValue = _this$state5.searchValue,
910
+ locationPoint = _this$state5.locationPoint,
911
+ listPoint = _this$state5.listPoint,
912
+ listMess = _this$state5.listMess,
913
+ mapZoomLevel = _this$state5.mapZoomLevel,
914
+ setZoomLevel = _this$state5.setZoomLevel,
915
+ maxZoom = _this$state5.maxZoom,
916
+ minZoom = _this$state5.minZoom,
917
+ wkid = _this$state5.wkid,
918
+ mapServer = _this$state5.mapServer,
919
+ mapCenter = _this$state5.mapCenter,
920
+ setCenter = _this$state5.setCenter,
921
+ mapType = _this$state5.mapType,
922
+ mapStyle = _this$state5.mapStyle,
923
+ mapVisiblePoints = _this$state5.mapVisiblePoints,
924
+ setVisiblePoints = _this$state5.setVisiblePoints,
925
+ isDoEdit = _this$state5.isDoEdit,
926
+ editGraphicId = _this$state5.editGraphicId,
927
+ isEndEdit = _this$state5.isEndEdit,
928
+ modal1Visible = _this$state5.modal1Visible,
929
+ drawGraphID = _this$state5.drawGraphID,
930
+ isShowOther = _this$state5.isShowOther,
931
+ otherText = _this$state5.otherText,
932
+ isShowOtherGraph = _this$state5.isShowOtherGraph,
933
+ editGraphic = _this$state5.editGraphic,
934
+ graphicType = _this$state5.graphicType,
935
+ graphicValue = _this$state5.graphicValue,
936
+ olProps = _this$state5.olProps,
937
+ isChangeMapType = _this$state5.isChangeMapType,
938
+ currentMap = _this$state5.currentMap,
939
+ showControl = _this$state5.showControl,
940
+ coverageType = _this$state5.coverageType,
941
+ customNodes = _this$state5.customNodes,
942
+ language = _this$state5.language;
1066
943
  var InputProps = {
1067
944
  style: {
1068
945
  'width': '200px'
@@ -1087,13 +964,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1087
964
  isDoEdit: !_this8.multiDraw,
1088
965
  isDraw: _this8.multiDraw
1089
966
  };
1090
-
1091
967
  if (!_this8.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
1092
968
  objparam.editGraphicId = obj.id;
1093
969
  }
1094
-
1095
970
  _this8.setState(objparam);
1096
-
1097
971
  _this8.convertAddressByLnglat(obj);
1098
972
  },
1099
973
  mapDraw: {
@@ -1125,51 +999,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1125
999
  }
1126
1000
  };
1127
1001
  var mapPoints = [],
1128
- mapLines = [],
1129
- mapPolygons = [],
1130
- mapCircles = [];
1131
-
1002
+ mapLines = [],
1003
+ mapPolygons = [],
1004
+ mapCircles = [];
1132
1005
  if (graphicType == 'point') {
1133
1006
  mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
1134
1007
  } else {
1135
1008
  mapPoints = _toConsumableArray(listPoint);
1136
1009
  }
1137
-
1138
1010
  if (graphicType === 'polygon') {
1139
1011
  if (editGraphic) {
1140
1012
  var _mapPolygons;
1141
-
1142
1013
  Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
1143
1014
  !this.multiDraw && (drawProps = null);
1144
1015
  }
1145
1016
  }
1146
-
1147
1017
  if (graphicType === 'polyline') {
1148
1018
  if (editGraphic) {
1149
1019
  var _mapLines;
1150
-
1151
1020
  Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
1152
1021
  !this.multiDraw && (drawProps = null);
1153
1022
  }
1154
1023
  }
1155
-
1156
1024
  if (graphicType === 'rectangle') {
1157
1025
  if (editGraphic) {
1158
1026
  mapPolygons.push(editGraphic);
1159
1027
  drawProps = null;
1160
1028
  }
1161
1029
  }
1162
-
1163
1030
  if (graphicType === 'circle') {
1164
1031
  if (editGraphic) {
1165
1032
  mapCircles.push(editGraphic);
1166
1033
  drawProps = null;
1167
1034
  }
1168
1035
  }
1169
-
1170
1036
  if (isShowOtherGraph) {
1171
1037
  var otherGraph = this.props.otherGraph;
1172
-
1173
1038
  if (otherGraph) {
1174
1039
  mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
1175
1040
  mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
@@ -1177,7 +1042,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1177
1042
  mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
1178
1043
  }
1179
1044
  }
1180
-
1181
1045
  return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
1182
1046
  title: this.state.graphicType == 'point' ? TextEnum.locationTitleText : TextEnum.drawTitleText,
1183
1047
  style: {
@@ -1206,10 +1070,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1206
1070
  onClick: function onClick() {
1207
1071
  if (_this8.multiDraw && _this8.state.isDoEdit && !_this8.state.isEndEdit) {
1208
1072
  _this8.continueDraw(_this8.callback.bind(_this8));
1209
-
1210
1073
  return;
1211
1074
  }
1212
-
1213
1075
  _this8.callback();
1214
1076
  },
1215
1077
  icon: getIcon('check')
@@ -1257,16 +1119,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1257
1119
  disabled: this.isDrawStatus,
1258
1120
  onClick: function onClick() {
1259
1121
  _this8.isDrawStatus = true;
1260
-
1261
1122
  if (_this8.multiDraw) {
1262
1123
  _this8.clickable = false;
1263
- graphicValue === null || graphicValue === void 0 ? void 0 : graphicValue.forEach(function (item) {
1124
+ graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
1264
1125
  return t.map.removeGraphic(item.id, 'draw');
1265
1126
  });
1266
- editGraphic === null || editGraphic === void 0 ? void 0 : editGraphic.forEach(function (item) {
1127
+ editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
1267
1128
  return t.map.removeGraphic(item.id, 'draw');
1268
1129
  });
1269
-
1270
1130
  _this8.setState({
1271
1131
  isDraw: false,
1272
1132
  isCloseDraw: true,
@@ -1293,7 +1153,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1293
1153
  });
1294
1154
  });
1295
1155
  }
1296
-
1297
1156
  _this8.callback('editDraw');
1298
1157
  },
1299
1158
  icon: getIcon('edit')
@@ -1323,7 +1182,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1323
1182
  onClick: function onClick(_ref) {
1324
1183
  var key = _ref.key;
1325
1184
  console.log(key);
1326
-
1327
1185
  _this8.setState({
1328
1186
  coverageType: key
1329
1187
  });
@@ -1422,25 +1280,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1422
1280
  key: "initSearchMap",
1423
1281
  value: function initSearchMap() {
1424
1282
  var _this9 = this;
1425
-
1426
- if (this.props.modal1Visible
1427
- /*&& !this.state.locationPoint[0]*/
1428
- ) {
1283
+ if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
1429
1284
  if (this.map) {
1430
1285
  this.map.loadMapComplete.then(function () {
1431
1286
  if (!_this9.mapLoaded) {
1432
1287
  var _this9$props$editPara, _this9$props$editPara2;
1433
-
1434
1288
  _this9.mapLoaded = true;
1435
-
1436
1289
  _this9.drawLocationPoint();
1437
-
1438
1290
  if ((_this9$props$editPara = _this9.props.editParam) !== null && _this9$props$editPara !== void 0 && _this9$props$editPara.rings || (_this9$props$editPara2 = _this9.props.editParam) !== null && _this9$props$editPara2 !== void 0 && _this9$props$editPara2.paths) {
1439
1291
  var timer = setTimeout(function () {
1440
1292
  var _this9$props$editPara3, _this9$props$editPara4;
1441
-
1442
1293
  _this9.map.fitView(((_this9$props$editPara3 = _this9.props.editParam) === null || _this9$props$editPara3 === void 0 ? void 0 : _this9$props$editPara3.rings) || ((_this9$props$editPara4 = _this9.props.editParam) === null || _this9$props$editPara4 === void 0 ? void 0 : _this9$props$editPara4.paths) || []);
1443
-
1444
1294
  clearTimeout(timer);
1445
1295
  }, 100);
1446
1296
  }
@@ -1464,21 +1314,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1464
1314
  }, {
1465
1315
  key: "UNSAFE_componentWillReceiveProps",
1466
1316
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
1467
- var _this10 = this;
1468
-
1317
+ var _this0 = this;
1469
1318
  var t = this;
1470
1319
  this.isClickMap = false;
1471
-
1472
1320
  if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
1473
1321
  this.map.clearAll();
1474
1322
  t.mapLoaded = false;
1475
1323
  t.isinit = true;
1476
1324
  }
1477
-
1478
1325
  if (nextProps.editParam) {
1479
1326
  t.mapLoaded = false;
1480
1327
  }
1481
-
1482
1328
  t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
1483
1329
  this.setState({
1484
1330
  modal1Visible: nextProps.modal1Visible,
@@ -1502,49 +1348,36 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1502
1348
  setTimeout(function () {
1503
1349
  //实现2+次进入时,清理数据
1504
1350
  if (nextProps.modal1Visible) {
1505
- _this10.clearList();
1506
-
1507
- _this10.setState({
1351
+ _this0.clearList();
1352
+ _this0.setState({
1508
1353
  setZoomLevel: true
1509
1354
  }, function () {
1510
- _this10.setState({
1355
+ _this0.setState({
1511
1356
  setZoomLevel: false
1512
1357
  });
1513
1358
  });
1514
-
1515
- if (!!_this10.map && !!_this10.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1516
- if (_this10.map.getGraphic('locationPoint')) {
1359
+ if (!!_this0.map && !!_this0.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1360
+ if (_this0.map.getGraphic('locationPoint')) {
1517
1361
  switch (nextProps.mapType) {
1518
1362
  case 'bmap':
1519
- _this10.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1520
-
1363
+ _this0.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1521
1364
  break;
1522
-
1523
1365
  case 'amap':
1524
- _this10.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1525
-
1366
+ _this0.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1526
1367
  break;
1527
-
1528
1368
  case 'tmap':
1529
- _this10.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1530
-
1369
+ _this0.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1531
1370
  break;
1532
-
1533
1371
  case 'gmap':
1534
- _this10.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
1535
-
1536
- _this10.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
1537
-
1538
- _this10.map.state.gis.graphics.refresh();
1539
-
1372
+ _this0.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
1373
+ _this0.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
1374
+ _this0.map.state.gis.graphics.refresh();
1540
1375
  case 'olMap':
1541
- _this10.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1542
-
1376
+ _this0.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1543
1377
  break;
1544
1378
  }
1545
1379
  }
1546
-
1547
- _this10.map.setCenter(nextProps.mapCenter);
1380
+ _this0.map.setCenter(nextProps.mapCenter);
1548
1381
  }
1549
1382
  }
1550
1383
  }, 100);
@@ -1554,33 +1387,25 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1554
1387
  value: function componentWillUnmount() {
1555
1388
  //关闭moveTo定时
1556
1389
  var t = this;
1557
-
1558
1390
  if (t.loadExtent) {
1559
1391
  clearInterval(t.loadExtent);
1560
1392
  }
1561
1393
  }
1562
1394
  }]);
1563
-
1564
- return VtxSearchMap;
1565
1395
  }(_react["default"].Component);
1566
-
1567
- var _default = VtxSearchMap;
1568
- exports["default"] = _default;
1569
-
1396
+ var _default = exports["default"] = VtxSearchMap;
1570
1397
  function formatNumber(num) {
1571
1398
  return Number(num).toFixed(2);
1572
1399
  }
1573
-
1574
1400
  function getAvg() {
1575
1401
  var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1576
1402
  var sumLng = 0,
1577
- sumLat = 0;
1403
+ sumLat = 0;
1578
1404
  arr.forEach(function (item) {
1579
1405
  sumLng += Number(item[0]);
1580
1406
  sumLat += Number(item[1]);
1581
1407
  });
1582
1408
  return "".concat(sumLng / arr.length, ",").concat(sumLat / arr.length);
1583
1409
  }
1584
-
1585
1410
  module.exports = exports["default"];
1586
1411
  //# sourceMappingURL=VtxSearchMap.js.map