@vtx/map 1.2.23 → 1.2.25

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 +142 -321
  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,22 +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) {
132
91
  if ((ary === null || ary === void 0 ? void 0 : ary.length) < 2) {
133
92
  return ary;
134
93
  }
135
-
136
94
  var pts = _toConsumableArray(ary);
137
-
138
95
  if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
139
96
  pts.pop();
140
97
  return distinct(pts);
@@ -142,31 +99,22 @@ function distinct(ary) {
142
99
  return pts;
143
100
  }
144
101
  }
145
-
146
102
  var getIcon = function getIcon(type) {
147
103
  return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
148
104
  type: "icon-".concat(_mapping.iconMapping[type])
149
105
  }) : type;
150
106
  };
151
-
152
107
  var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
153
- _inherits(VtxSearchMap, _React$Component);
154
-
155
- var _super = _createSuper(VtxSearchMap);
156
-
157
108
  function VtxSearchMap(props) {
158
109
  var _this;
159
-
160
110
  _classCallCheck(this, VtxSearchMap);
161
-
162
- _this = _super.call(this, props);
163
-
164
- _defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
111
+ _this = _callSuper(this, VtxSearchMap, [props]);
112
+ // 绘制多个图元时返回参数
113
+ _defineProperty(_this, "getMultiRes", function (graphicType) {
165
114
  var resData = [];
166
115
  var _this$state = _this.state,
167
- graphicValue = _this$state.graphicValue,
168
- editGraphic = _this$state.editGraphic;
169
-
116
+ graphicValue = _this$state.graphicValue,
117
+ editGraphic = _this$state.editGraphic;
170
118
  switch (graphicType) {
171
119
  case 'polygon':
172
120
  [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
@@ -177,7 +125,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
177
125
  });
178
126
  });
179
127
  break;
180
-
181
128
  case 'polyline':
182
129
  [].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
183
130
  resData.push({
@@ -186,26 +133,20 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
186
133
  length: _this.map.calculateDistance(item.paths || item.geometry.paths)
187
134
  });
188
135
  });
189
-
190
136
  default:
191
137
  break;
192
138
  }
193
-
194
139
  return resData.length ? resData : null;
195
140
  });
196
-
197
141
  _this.map = null; //Map组件的ref对象
198
-
199
142
  _this.mapLoaded = false;
200
143
  _this.isDrawStatus = false;
201
144
  _this.isClickMap = false;
202
145
  _this.apid = []; //所有点id,除编辑点外
203
-
204
146
  _this.loadExtent = null;
205
147
  _this.mapId = "searchMap".concat(new Date().getTime());
206
148
  _this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
207
149
  _this.clickable = false; // 多个面绘制时,是否可以点击面进行编辑
208
-
209
150
  _this.prefixUrl = props.prefixUrl || '';
210
151
  _this.searchPoiUrl = props.searchPoiUrl || '';
211
152
  _this.state = {
@@ -228,7 +169,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
228
169
  graphicValue: _this.multiDraw ? [] : null,
229
170
  // 绘制图元id集合
230
171
  drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
231
-
232
172
  /*地图Api参数*/
233
173
  mapCenter: props.mapCenter || '',
234
174
  maxZoom: props.maxZoom,
@@ -249,7 +189,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
249
189
  editGraphic: _this.multiDraw ? [] : null,
250
190
  mapZoomLevel: props.mapZoomLevel || 11,
251
191
  setZoomLevel: false,
252
-
253
192
  /*modal参数*/
254
193
  modal1Visible: props.modal1Visible || false,
255
194
  isShowOther: props.isShowOther || false,
@@ -298,35 +237,29 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
298
237
  areaText: '面积'
299
238
  }, props.customEnumText || {});
300
239
  return _this;
301
- } // 绘制多个图元时返回参数
302
-
303
-
304
- _createClass(VtxSearchMap, [{
240
+ }
241
+ _inherits(VtxSearchMap, _React$Component);
242
+ return _createClass(VtxSearchMap, [{
305
243
  key: "callback",
306
- value: //经纬度回调
244
+ value:
245
+ //经纬度回调
307
246
  function callback() {
308
247
  var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
309
-
310
248
  if (fun in this.props && typeof this.props[fun] === 'function') {
311
249
  var editGraphicId = this.state.editGraphicId;
312
-
313
250
  switch (this.state.graphicType) {
314
251
  case 'point':
315
252
  var locationPoint = this.state.locationPoint;
316
-
317
253
  if (this.map.getGraphic('locationPoint')) {
318
254
  var p = this.map.getGraphic(locationPoint[0].id).geometry;
319
255
  this.props[fun]([p.x, p.y]);
320
256
  } else {
321
257
  return [];
322
258
  }
323
-
324
259
  break;
325
-
326
260
  case 'circle':
327
261
  if (this.map.getGraphic(editGraphicId)) {
328
262
  var _p = this.map.getGraphic(editGraphicId);
329
-
330
263
  this.props[fun]({
331
264
  x: _p.geometry.x,
332
265
  y: _p.geometry.y,
@@ -341,18 +274,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
341
274
  area: this.state.graphicValue.area
342
275
  } : null);
343
276
  }
344
-
345
277
  break;
346
-
347
278
  case 'polygon':
348
279
  if (this.multiDraw) {
349
280
  this.props[fun](this.getMultiRes('polygon'));
350
281
  return;
351
282
  }
352
-
353
283
  if (this.map.getGraphic(editGraphicId)) {
354
284
  var _p2 = this.map.getGraphic(editGraphicId);
355
-
356
285
  this.props[fun]({
357
286
  rings: distinct(_p2.geometry.rings),
358
287
  area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
@@ -363,9 +292,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
363
292
  area: this.state.graphicValue.area
364
293
  } : null);
365
294
  }
366
-
367
295
  break;
368
-
369
296
  case 'rectangle':
370
297
  if (this.state.graphicValue) {
371
298
  this.props[fun](this.state.graphicValue ? {
@@ -381,18 +308,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
381
308
  } else {
382
309
  this.props[fun](null);
383
310
  }
384
-
385
311
  break;
386
-
387
312
  case 'polyline':
388
313
  if (this.multiDraw) {
389
314
  this.props[fun](this.getMultiRes('polyline'));
390
315
  return;
391
316
  }
392
-
393
317
  if (this.map.getGraphic(editGraphicId)) {
394
318
  var _p4 = this.map.getGraphic(editGraphicId);
395
-
396
319
  this.props[fun]({
397
320
  paths: _p4.geometry.paths,
398
321
  length: this.map.calculateDistance(_p4.geometry.paths)
@@ -403,11 +326,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
403
326
  length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
404
327
  } : null);
405
328
  }
406
-
407
329
  break;
408
330
  }
409
331
  }
410
-
411
332
  if (this.props.clearDrawnGraph) {
412
333
  this.clearDrawnGraph();
413
334
  }
@@ -418,18 +339,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
418
339
  this.setState({
419
340
  isShowList: bealoon
420
341
  });
421
- } //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
422
-
342
+ }
343
+ //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
423
344
  }, {
424
345
  key: "drawLocationPoint",
425
346
  value: function drawLocationPoint() {
426
- var t = this; //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
427
-
347
+ var t = this;
348
+ //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
428
349
  if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
429
350
  var lglt = this.map.getMapExtent(),
430
- editGraphic = null,
431
- editGraphicId = 'locationPoint';
432
-
351
+ editGraphic = null,
352
+ editGraphicId = 'locationPoint';
433
353
  if (!this.multiDraw && this.props.editParam) {
434
354
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
435
355
  editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
@@ -437,7 +357,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
437
357
  });
438
358
  editGraphicId = 'drawnGraph';
439
359
  }
440
-
441
360
  if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
442
361
  // && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
443
362
  editGraphic = this.props.editParam.map(function (item, index) {
@@ -447,7 +366,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
447
366
  });
448
367
  editGraphicId = null;
449
368
  }
450
-
451
369
  this.isinit = false;
452
370
  this.setState({
453
371
  editGraphic: editGraphic,
@@ -478,13 +396,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
478
396
  t.drawLocationPoint();
479
397
  }, 50);
480
398
  }
481
- } //校正定位的点位位置到当前的中心点
482
-
399
+ }
400
+ //校正定位的点位位置到当前的中心点
483
401
  }, {
484
402
  key: "correction",
485
403
  value: function correction() {
486
- var t = this; //获取当前中心点经纬度
487
-
404
+ var t = this;
405
+ //获取当前中心点经纬度
488
406
  var lglt = this.map.getMapExtent();
489
407
  var locationPoint = t.state.locationPoint;
490
408
  locationPoint = locationPoint.map(function (item, index) {
@@ -494,32 +412,28 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
494
412
  });
495
413
  });
496
414
  this.map.updatePoint(locationPoint);
497
- } //搜索关键字切换
498
-
415
+ }
416
+ //搜索关键字切换
499
417
  }, {
500
418
  key: "changeValue",
501
419
  value: function changeValue(e) {
502
420
  this.setState({
503
421
  searchValue: e.target.value
504
422
  });
505
- } // 根据经纬度定位中心点
506
-
423
+ }
424
+ // 根据经纬度定位中心点
507
425
  }, {
508
426
  key: "locateByLnglat",
509
427
  value: function locateByLnglat() {
510
428
  var t = this;
511
-
512
429
  if (!t.state.searchValue) {
513
430
  _message["default"].warn(t.TextEnum.msgConfirmInputLnglatText);
514
-
515
431
  return;
516
432
  }
517
-
518
433
  var _t$state$searchValue$ = t.state.searchValue.split(','),
519
- _t$state$searchValue$2 = _slicedToArray(_t$state$searchValue$, 2),
520
- longitude = _t$state$searchValue$2[0],
521
- latitude = _t$state$searchValue$2[1];
522
-
434
+ _t$state$searchValue$2 = _slicedToArray(_t$state$searchValue$, 2),
435
+ longitude = _t$state$searchValue$2[0],
436
+ latitude = _t$state$searchValue$2[1];
523
437
  t.setState({
524
438
  mapCenter: [longitude, latitude],
525
439
  setCenter: true
@@ -527,31 +441,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
527
441
  t.setState({
528
442
  setCenter: false
529
443
  });
530
-
531
444
  if (t.state.graphicType == 'point') {
532
445
  t.correction();
533
446
  }
534
447
  });
535
- } //根据关键字搜索数据
536
-
448
+ }
449
+ //根据关键字搜索数据
537
450
  }, {
538
451
  key: "searchList",
539
452
  value: function searchList() {
540
453
  var t = this;
541
-
542
454
  if (!t.state.searchValue) {
543
455
  _message["default"].warn(this.TextEnum.msgConfirmInputText);
544
-
545
456
  return;
546
457
  }
547
-
548
458
  if (t.state.searchMode === 'lnglat') {
549
459
  t.locateByLnglat();
550
460
  } else {
551
461
  t.searchPointsLBS();
552
462
  }
553
- } // lbs解析经纬度为地址
554
-
463
+ }
464
+ // lbs解析经纬度为地址
555
465
  }, {
556
466
  key: "convertAddressByLnglat",
557
467
  value: function convertAddressByLnglat() {
@@ -559,7 +469,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
559
469
  console.log(obj);
560
470
  var t = this;
561
471
  var lnglat = '';
562
-
563
472
  if (obj.geometry && obj.geometry.type && ['point', 'circle'].includes(obj.geometry.type)) {
564
473
  lnglat = "".concat(obj.geometry.x, ",").concat(obj.geometry.y);
565
474
  } else if (obj.geometry && obj.geometry.paths) {
@@ -569,10 +478,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
569
478
  } else if (obj.geometry && obj.geometry.rings) {
570
479
  lnglat = getAvg(obj.geometry.rings);
571
480
  }
572
-
573
481
  if (!!lnglat) {
574
482
  $.ajax({
575
- url: "".concat(t.prefixUrl, "/vortexapi/rest/lbs/geoconvert/v2"),
483
+ url: "".concat(t.prefixUrl, "/cloudLbs/vortexapi/rest/lbs/geoconvert/v2"),
576
484
  method: "GET",
577
485
  data: {
578
486
  location: lnglat,
@@ -585,7 +493,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
585
493
  success: function success(res) {
586
494
  if ((res === null || res === void 0 ? void 0 : res.result) === 0) {
587
495
  var _res$data;
588
-
589
496
  t.setState({
590
497
  lbsAddress: ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.address) || ''
591
498
  });
@@ -596,14 +503,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
596
503
  }
597
504
  });
598
505
  }
599
- } // 从lbs中查询
600
-
506
+ }
507
+ // 从lbs中查询
601
508
  }, {
602
509
  key: "searchPointsLBS",
603
510
  value: function searchPointsLBS() {
604
511
  var t = this;
605
512
  $.ajax({
606
- url: t.searchPoiUrl || "".concat(t.prefixUrl, "/vortexapi/rest/lbs/poi"),
513
+ url: t.searchPoiUrl || "".concat(t.prefixUrl, "/cloudLbs/vortexapi/rest/lbs/poi"),
607
514
  method: "GET",
608
515
  data: {
609
516
  keywords: t.state.searchValue,
@@ -614,7 +521,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
614
521
  },
615
522
  success: function success(res) {
616
523
  console.log(res);
617
-
618
524
  if ((res === null || res === void 0 ? void 0 : res.result) === 0) {
619
525
  var list = res.data.map(function (item) {
620
526
  var lnglat = (0, _util.transform)({
@@ -640,8 +546,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
640
546
  _message["default"].warn("");
641
547
  }
642
548
  });
643
- } // 废弃
644
-
549
+ }
550
+ // 废弃
645
551
  }, {
646
552
  key: "searchPoints",
647
553
  value: function searchPoints() {
@@ -672,12 +578,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
672
578
  key: "handleSearch",
673
579
  value: function handleSearch(results) {
674
580
  var t = this;
675
-
676
581
  if (results.length > 0) {
677
582
  var lsp = [],
678
- lsm = [];
583
+ lsm = [];
679
584
  t.apid = [];
680
-
681
585
  for (var i = 0; i < results.length; i++) {
682
586
  var r = results[i];
683
587
  lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
@@ -692,7 +596,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
692
596
  });
693
597
  t.apid.push(r.id);
694
598
  }
695
-
696
599
  t.setState({
697
600
  listPoint: lsp,
698
601
  listMess: lsm,
@@ -702,13 +605,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
702
605
  } else {
703
606
  warning();
704
607
  }
705
- } //返回最佳位置(zoom,center)
608
+ }
706
609
 
610
+ //返回最佳位置(zoom,center)
707
611
  }, {
708
612
  key: "setFitView",
709
613
  value: function setFitView() {
710
614
  var _this2 = this;
711
-
712
615
  this.setState({
713
616
  mapVisiblePoints: {
714
617
  fitView: this.apid,
@@ -720,8 +623,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
720
623
  setVisiblePoints: false
721
624
  });
722
625
  });
723
- } //清空列表的所有数据(包括点位)
724
-
626
+ }
627
+ //清空列表的所有数据(包括点位)
725
628
  }, {
726
629
  key: "clearList",
727
630
  value: function clearList() {
@@ -732,15 +635,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
732
635
  listMess: [],
733
636
  isShowList: false
734
637
  });
735
- } //列表选中地址
736
-
638
+ }
639
+ //列表选中地址
737
640
  }, {
738
641
  key: "chooseAddress",
739
642
  value: function chooseAddress(id) {
740
643
  var t = this;
741
644
  var _this$state2 = this.state,
742
- listPoint = _this$state2.listPoint,
743
- listMess = _this$state2.listMess;
645
+ listPoint = _this$state2.listPoint,
646
+ listMess = _this$state2.listMess;
744
647
  var mapCenter = [];
745
648
  listPoint = listPoint.map(function (item, index) {
746
649
  if (item.id === id) {
@@ -776,7 +679,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
776
679
  t.setState({
777
680
  setCenter: false
778
681
  });
779
-
780
682
  if (t.state.graphicType == 'point') {
781
683
  t.correction();
782
684
  }
@@ -787,33 +689,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
787
689
  value: function getAllOtherGraphId() {
788
690
  var ids = [];
789
691
  var _this$props$otherGrap = this.props.otherGraph,
790
- otherGraph = _this$props$otherGrap === void 0 ? {} : _this$props$otherGrap;
791
-
692
+ otherGraph = _this$props$otherGrap === void 0 ? {} : _this$props$otherGrap;
792
693
  for (var key in otherGraph) {
793
694
  (otherGraph[key] || []).forEach(function (item) {
794
695
  ids.push(item.id);
795
696
  });
796
697
  }
797
-
798
698
  return ids;
799
699
  }
800
700
  }, {
801
701
  key: "clickGraphic",
802
702
  value: function clickGraphic(obj) {
803
703
  var _this3 = this;
804
-
805
704
  var disableEditIds = this.getAllOtherGraphId();
806
-
807
705
  if (obj.attributes && disableEditIds.includes(obj.attributes.id)) {
808
706
  _message["default"].warn(this.TextEnum.msgDoNotAllowOtherGraph);
809
707
  } else {
810
708
  if (obj.type === 'point' && obj.attributes.other === 'search') {
811
709
  this.chooseAddress(obj.attributes.id);
812
710
  }
813
-
814
711
  if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
815
712
  var _obj$param$attributes;
816
-
817
713
  // 开启编辑
818
714
  this.setState({
819
715
  editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
@@ -831,7 +727,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
831
727
  value: function closeModal(e) {
832
728
  this.isDrawStatus = false;
833
729
  this.isClickMap = false;
834
-
835
730
  if (this.isDrawStatus && this.isClickMap) {
836
731
  _message["default"].warning(this.TextEnum.msgEndEditingDrawText);
837
732
  } else {
@@ -841,17 +736,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
841
736
  this.setState({
842
737
  modal1Visible: false
843
738
  });
844
- } // if(this.props.clearDrawnGraph){
845
-
846
-
847
- this.clearDrawnGraph(); // }
739
+ }
740
+ // if(this.props.clearDrawnGraph){
741
+ this.clearDrawnGraph();
742
+ // }
848
743
  }
849
744
  }
850
745
  }, {
851
746
  key: "clearDrawnGraph",
852
747
  value: function clearDrawnGraph() {
853
748
  var _this4 = this;
854
-
855
749
  this.isDrawStatus = true;
856
750
  this.setState({
857
751
  isDraw: this.state.graphicType !== 'point',
@@ -867,7 +761,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
867
761
  key: "continueDraw",
868
762
  value: function continueDraw(func) {
869
763
  var _this5 = this;
870
-
871
764
  this.clickable = false;
872
765
  this.setState({
873
766
  isDraw: false,
@@ -890,15 +783,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
890
783
  key: "editGraphic",
891
784
  value: function editGraphic() {
892
785
  var _this6 = this;
893
-
894
786
  if (this.isDrawStatus && this.isClickMap) {
895
787
  _message["default"].warning(this.TextEnum.msgEndEditingDrawText);
896
-
897
788
  return;
898
789
  }
899
-
900
790
  _message["default"].info(this.TextEnum.msgClickGraphicEditText);
901
-
902
791
  this.clickable = true;
903
792
  this.isDrawStatus = false;
904
793
  this.setState({
@@ -919,8 +808,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
919
808
  this.convertAddressByLnglat(obj);
920
809
  if (!this.multiDraw) return;
921
810
  var _this$state3 = this.state,
922
- graphicValue = _this$state3.graphicValue,
923
- editGraphic = _this$state3.editGraphic;
811
+ graphicValue = _this$state3.graphicValue,
812
+ editGraphic = _this$state3.editGraphic;
924
813
  this.setState({
925
814
  graphicValue: (graphicValue || []).map(function (item) {
926
815
  return item.id === obj.id ? obj : item;
@@ -939,7 +828,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
939
828
  currentMap: str
940
829
  });
941
830
  var layers = [];
942
-
943
831
  switch (mapType) {
944
832
  case 'amap':
945
833
  case 'bmap':
@@ -949,12 +837,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
949
837
  } else {
950
838
  t.map.setMapType('wx');
951
839
  }
952
-
953
840
  break;
954
-
955
841
  case 'gmap':
956
842
  break;
957
-
958
843
  default:
959
844
  break;
960
845
  }
@@ -963,12 +848,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
963
848
  key: "computeGraphic",
964
849
  value: function computeGraphic() {
965
850
  var _this7 = this;
966
-
967
851
  var str = '';
968
852
  var _this$state4 = this.state,
969
- graphicValue = _this$state4.graphicValue,
970
- editGraphicId = _this$state4.editGraphicId;
971
-
853
+ graphicValue = _this$state4.graphicValue,
854
+ editGraphicId = _this$state4.editGraphicId;
972
855
  switch (this.state.graphicType) {
973
856
  case 'circle':
974
857
  if (this.map.getGraphic(editGraphicId)) {
@@ -977,36 +860,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
977
860
  } else {
978
861
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
979
862
  }
980
-
981
863
  break;
982
-
983
864
  case 'polygon':
984
865
  if (this.map.getGraphic(editGraphicId)) {
985
866
  var _p5 = this.map.getGraphic(editGraphicId);
986
-
987
867
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(formatNumber(this.map.getPolygonArea(distinct(_p5.geometry.rings))), "\u33A1");
988
868
  } else {
989
869
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
990
870
  }
991
-
992
871
  break;
993
-
994
872
  case 'rectangle':
995
873
  str = "".concat(this.TextEnum.areaText, "\uFF1A").concat(graphicValue ? formatNumber(graphicValue.area) : '-', "\u33A1");
996
874
  break;
997
-
998
875
  case 'polyline':
999
876
  if (this.map.getGraphic(editGraphicId)) {
1000
877
  var _p6 = this.map.getGraphic(editGraphicId);
1001
-
1002
878
  str = "".concat(this.TextEnum.lengthText, "\uFF1A").concat(formatNumber(this.map.calculateDistance(_p6.geometry.paths)), "m");
1003
879
  } else {
1004
880
  str = "".concat(this.TextEnum.lengthText, "\uFF1A").concat(graphicValue ? formatNumber(this.map.calculateDistance(graphicValue.geometry.paths)) : '-', "m");
1005
881
  }
1006
-
1007
882
  break;
1008
883
  }
1009
-
1010
884
  if (str) {
1011
885
  return /*#__PURE__*/_react["default"].createElement("span", {
1012
886
  style: {
@@ -1028,45 +902,44 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1028
902
  key: "render",
1029
903
  value: function render() {
1030
904
  var _this8 = this;
1031
-
1032
905
  var t = this;
1033
906
  var TextEnum = t.TextEnum;
1034
907
  var _this$state5 = this.state,
1035
- isShowList = _this$state5.isShowList,
1036
- searchValue = _this$state5.searchValue,
1037
- locationPoint = _this$state5.locationPoint,
1038
- listPoint = _this$state5.listPoint,
1039
- listMess = _this$state5.listMess,
1040
- mapZoomLevel = _this$state5.mapZoomLevel,
1041
- setZoomLevel = _this$state5.setZoomLevel,
1042
- maxZoom = _this$state5.maxZoom,
1043
- minZoom = _this$state5.minZoom,
1044
- wkid = _this$state5.wkid,
1045
- mapServer = _this$state5.mapServer,
1046
- mapCenter = _this$state5.mapCenter,
1047
- setCenter = _this$state5.setCenter,
1048
- mapType = _this$state5.mapType,
1049
- mapStyle = _this$state5.mapStyle,
1050
- mapVisiblePoints = _this$state5.mapVisiblePoints,
1051
- setVisiblePoints = _this$state5.setVisiblePoints,
1052
- isDoEdit = _this$state5.isDoEdit,
1053
- editGraphicId = _this$state5.editGraphicId,
1054
- isEndEdit = _this$state5.isEndEdit,
1055
- modal1Visible = _this$state5.modal1Visible,
1056
- drawGraphID = _this$state5.drawGraphID,
1057
- isShowOther = _this$state5.isShowOther,
1058
- otherText = _this$state5.otherText,
1059
- isShowOtherGraph = _this$state5.isShowOtherGraph,
1060
- editGraphic = _this$state5.editGraphic,
1061
- graphicType = _this$state5.graphicType,
1062
- graphicValue = _this$state5.graphicValue,
1063
- olProps = _this$state5.olProps,
1064
- isChangeMapType = _this$state5.isChangeMapType,
1065
- currentMap = _this$state5.currentMap,
1066
- showControl = _this$state5.showControl,
1067
- coverageType = _this$state5.coverageType,
1068
- customNodes = _this$state5.customNodes,
1069
- 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;
1070
943
  var InputProps = {
1071
944
  style: {
1072
945
  'width': '200px'
@@ -1091,13 +964,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1091
964
  isDoEdit: !_this8.multiDraw,
1092
965
  isDraw: _this8.multiDraw
1093
966
  };
1094
-
1095
967
  if (!_this8.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
1096
968
  objparam.editGraphicId = obj.id;
1097
969
  }
1098
-
1099
970
  _this8.setState(objparam);
1100
-
1101
971
  _this8.convertAddressByLnglat(obj);
1102
972
  },
1103
973
  mapDraw: {
@@ -1129,51 +999,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1129
999
  }
1130
1000
  };
1131
1001
  var mapPoints = [],
1132
- mapLines = [],
1133
- mapPolygons = [],
1134
- mapCircles = [];
1135
-
1002
+ mapLines = [],
1003
+ mapPolygons = [],
1004
+ mapCircles = [];
1136
1005
  if (graphicType == 'point') {
1137
1006
  mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
1138
1007
  } else {
1139
1008
  mapPoints = _toConsumableArray(listPoint);
1140
1009
  }
1141
-
1142
1010
  if (graphicType === 'polygon') {
1143
1011
  if (editGraphic) {
1144
1012
  var _mapPolygons;
1145
-
1146
1013
  Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
1147
1014
  !this.multiDraw && (drawProps = null);
1148
1015
  }
1149
1016
  }
1150
-
1151
1017
  if (graphicType === 'polyline') {
1152
1018
  if (editGraphic) {
1153
1019
  var _mapLines;
1154
-
1155
1020
  Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
1156
1021
  !this.multiDraw && (drawProps = null);
1157
1022
  }
1158
1023
  }
1159
-
1160
1024
  if (graphicType === 'rectangle') {
1161
1025
  if (editGraphic) {
1162
1026
  mapPolygons.push(editGraphic);
1163
1027
  drawProps = null;
1164
1028
  }
1165
1029
  }
1166
-
1167
1030
  if (graphicType === 'circle') {
1168
1031
  if (editGraphic) {
1169
1032
  mapCircles.push(editGraphic);
1170
1033
  drawProps = null;
1171
1034
  }
1172
1035
  }
1173
-
1174
1036
  if (isShowOtherGraph) {
1175
1037
  var otherGraph = this.props.otherGraph;
1176
-
1177
1038
  if (otherGraph) {
1178
1039
  mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
1179
1040
  mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
@@ -1181,7 +1042,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1181
1042
  mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
1182
1043
  }
1183
1044
  }
1184
-
1185
1045
  return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
1186
1046
  title: this.state.graphicType == 'point' ? TextEnum.locationTitleText : TextEnum.drawTitleText,
1187
1047
  style: {
@@ -1210,10 +1070,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1210
1070
  onClick: function onClick() {
1211
1071
  if (_this8.multiDraw && _this8.state.isDoEdit && !_this8.state.isEndEdit) {
1212
1072
  _this8.continueDraw(_this8.callback.bind(_this8));
1213
-
1214
1073
  return;
1215
1074
  }
1216
-
1217
1075
  _this8.callback();
1218
1076
  },
1219
1077
  icon: getIcon('check')
@@ -1261,16 +1119,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1261
1119
  disabled: this.isDrawStatus,
1262
1120
  onClick: function onClick() {
1263
1121
  _this8.isDrawStatus = true;
1264
-
1265
1122
  if (_this8.multiDraw) {
1266
1123
  _this8.clickable = false;
1267
- graphicValue === null || graphicValue === void 0 ? void 0 : graphicValue.forEach(function (item) {
1124
+ graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
1268
1125
  return t.map.removeGraphic(item.id, 'draw');
1269
1126
  });
1270
- editGraphic === null || editGraphic === void 0 ? void 0 : editGraphic.forEach(function (item) {
1127
+ editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
1271
1128
  return t.map.removeGraphic(item.id, 'draw');
1272
1129
  });
1273
-
1274
1130
  _this8.setState({
1275
1131
  isDraw: false,
1276
1132
  isCloseDraw: true,
@@ -1297,7 +1153,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1297
1153
  });
1298
1154
  });
1299
1155
  }
1300
-
1301
1156
  _this8.callback('editDraw');
1302
1157
  },
1303
1158
  icon: getIcon('edit')
@@ -1327,7 +1182,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1327
1182
  onClick: function onClick(_ref) {
1328
1183
  var key = _ref.key;
1329
1184
  console.log(key);
1330
-
1331
1185
  _this8.setState({
1332
1186
  coverageType: key
1333
1187
  });
@@ -1426,25 +1280,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1426
1280
  key: "initSearchMap",
1427
1281
  value: function initSearchMap() {
1428
1282
  var _this9 = this;
1429
-
1430
- if (this.props.modal1Visible
1431
- /*&& !this.state.locationPoint[0]*/
1432
- ) {
1283
+ if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
1433
1284
  if (this.map) {
1434
1285
  this.map.loadMapComplete.then(function () {
1435
1286
  if (!_this9.mapLoaded) {
1436
1287
  var _this9$props$editPara, _this9$props$editPara2;
1437
-
1438
1288
  _this9.mapLoaded = true;
1439
-
1440
1289
  _this9.drawLocationPoint();
1441
-
1442
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) {
1443
1291
  var timer = setTimeout(function () {
1444
1292
  var _this9$props$editPara3, _this9$props$editPara4;
1445
-
1446
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) || []);
1447
-
1448
1294
  clearTimeout(timer);
1449
1295
  }, 100);
1450
1296
  }
@@ -1468,21 +1314,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1468
1314
  }, {
1469
1315
  key: "UNSAFE_componentWillReceiveProps",
1470
1316
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
1471
- var _this10 = this;
1472
-
1317
+ var _this0 = this;
1473
1318
  var t = this;
1474
1319
  this.isClickMap = false;
1475
-
1476
1320
  if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
1477
1321
  this.map.clearAll();
1478
1322
  t.mapLoaded = false;
1479
1323
  t.isinit = true;
1480
1324
  }
1481
-
1482
1325
  if (nextProps.editParam) {
1483
1326
  t.mapLoaded = false;
1484
1327
  }
1485
-
1486
1328
  t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
1487
1329
  this.setState({
1488
1330
  modal1Visible: nextProps.modal1Visible,
@@ -1506,49 +1348,36 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1506
1348
  setTimeout(function () {
1507
1349
  //实现2+次进入时,清理数据
1508
1350
  if (nextProps.modal1Visible) {
1509
- _this10.clearList();
1510
-
1511
- _this10.setState({
1351
+ _this0.clearList();
1352
+ _this0.setState({
1512
1353
  setZoomLevel: true
1513
1354
  }, function () {
1514
- _this10.setState({
1355
+ _this0.setState({
1515
1356
  setZoomLevel: false
1516
1357
  });
1517
1358
  });
1518
-
1519
- if (!!_this10.map && !!_this10.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1520
- if (_this10.map.getGraphic('locationPoint')) {
1359
+ if (!!_this0.map && !!_this0.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
1360
+ if (_this0.map.getGraphic('locationPoint')) {
1521
1361
  switch (nextProps.mapType) {
1522
1362
  case 'bmap':
1523
- _this10.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1524
-
1363
+ _this0.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1525
1364
  break;
1526
-
1527
1365
  case 'amap':
1528
- _this10.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1529
-
1366
+ _this0.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1530
1367
  break;
1531
-
1532
1368
  case 'tmap':
1533
- _this10.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1534
-
1369
+ _this0.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
1535
1370
  break;
1536
-
1537
1371
  case 'gmap':
1538
- _this10.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
1539
-
1540
- _this10.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
1541
-
1542
- _this10.map.state.gis.graphics.refresh();
1543
-
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();
1544
1375
  case 'olMap':
1545
- _this10.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1546
-
1376
+ _this0.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
1547
1377
  break;
1548
1378
  }
1549
1379
  }
1550
-
1551
- _this10.map.setCenter(nextProps.mapCenter);
1380
+ _this0.map.setCenter(nextProps.mapCenter);
1552
1381
  }
1553
1382
  }
1554
1383
  }, 100);
@@ -1558,33 +1387,25 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
1558
1387
  value: function componentWillUnmount() {
1559
1388
  //关闭moveTo定时
1560
1389
  var t = this;
1561
-
1562
1390
  if (t.loadExtent) {
1563
1391
  clearInterval(t.loadExtent);
1564
1392
  }
1565
1393
  }
1566
1394
  }]);
1567
-
1568
- return VtxSearchMap;
1569
1395
  }(_react["default"].Component);
1570
-
1571
- var _default = VtxSearchMap;
1572
- exports["default"] = _default;
1573
-
1396
+ var _default = exports["default"] = VtxSearchMap;
1574
1397
  function formatNumber(num) {
1575
1398
  return Number(num).toFixed(2);
1576
1399
  }
1577
-
1578
1400
  function getAvg() {
1579
1401
  var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1580
1402
  var sumLng = 0,
1581
- sumLat = 0;
1403
+ sumLat = 0;
1582
1404
  arr.forEach(function (item) {
1583
1405
  sumLng += Number(item[0]);
1584
1406
  sumLat += Number(item[1]);
1585
1407
  });
1586
1408
  return "".concat(sumLng / arr.length, ",").concat(sumLat / arr.length);
1587
1409
  }
1588
-
1589
1410
  module.exports = exports["default"];
1590
1411
  //# sourceMappingURL=VtxSearchMap.js.map