@vtx/map 1.2.30 → 6.0.0-beta.1

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 (88) hide show
  1. package/README.md +44 -44
  2. package/lib/VtxMap/AMap/AMap.js +359 -355
  3. package/lib/VtxMap/BMap/Map.js +331 -330
  4. package/lib/VtxMap/BMap/Map1.js +1712 -0
  5. package/lib/VtxMap/GMap/Map.js +432 -427
  6. package/lib/VtxMap/Map.js +31 -27
  7. package/lib/VtxMap/MapToolFunction.js +6 -7
  8. package/lib/VtxMap/OMap/Map.js +410 -405
  9. package/lib/VtxMap/OMap/Map.less +70 -70
  10. package/lib/VtxMap/OlMap/Map.js +450 -440
  11. package/lib/VtxMap/OlMap/Map.less +230 -230
  12. package/lib/VtxMap/TMap/TMap.js +321 -318
  13. package/lib/VtxMap/index.js +10 -11
  14. package/lib/VtxMap/mapPlayer.js +15 -16
  15. package/lib/VtxMap/optimizingPointMap.js +35 -33
  16. package/lib/VtxMap/style/index.js +1 -2
  17. package/lib/VtxMap/zoomMap.js +24 -23
  18. package/lib/VtxModal/VtxModal.js +94 -82
  19. package/lib/VtxModal/VtxModal.less +83 -52
  20. package/lib/VtxModal/draggableModal.js +35 -33
  21. package/lib/VtxModal/index.js +6 -7
  22. package/lib/VtxModal/style/index.js +1 -15
  23. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +265 -244
  24. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.less +69 -43
  25. package/lib/VtxSearchCheckMap/index.js +4 -9
  26. package/lib/VtxSearchCheckMap/mapping.js +1 -2
  27. package/lib/VtxSearchCheckMap/style/index.js +5 -11
  28. package/lib/VtxSearchMap/VtxSearchMap.js +326 -288
  29. package/lib/VtxSearchMap/VtxSearchMap.less +74 -47
  30. package/lib/VtxSearchMap/VtxSearchMapAntd3.less +1 -1
  31. package/lib/VtxSearchMap/index.js +4 -9
  32. package/lib/VtxSearchMap/mapping.js +1 -2
  33. package/lib/VtxSearchMap/style/index.js +1 -28
  34. package/lib/default.js +44 -24
  35. package/lib/index.js +30 -31
  36. package/lib/utils/util.js +3 -4
  37. package/package.json +19 -27
  38. package/lib/VtxMap/AMap/AMap.css +0 -27
  39. package/lib/VtxMap/AMap/AMap.js.map +0 -1
  40. package/lib/VtxMap/BMap/Map.css +0 -26
  41. package/lib/VtxMap/BMap/Map.js.map +0 -1
  42. package/lib/VtxMap/GMap/Map.css +0 -88
  43. package/lib/VtxMap/GMap/Map.js.map +0 -1
  44. package/lib/VtxMap/Map.css +0 -7
  45. package/lib/VtxMap/Map.js.map +0 -1
  46. package/lib/VtxMap/MapToolFunction.js.map +0 -1
  47. package/lib/VtxMap/OMap/Map.css +0 -76
  48. package/lib/VtxMap/OMap/Map.js.map +0 -1
  49. package/lib/VtxMap/OlMap/Map.css +0 -229
  50. package/lib/VtxMap/OlMap/Map.js.map +0 -1
  51. package/lib/VtxMap/TMap/TMap.css +0 -31
  52. package/lib/VtxMap/TMap/TMap.js.map +0 -1
  53. package/lib/VtxMap/index.js.map +0 -1
  54. package/lib/VtxMap/mapPlayer.js.map +0 -1
  55. package/lib/VtxMap/optimizingPointMap.js.map +0 -1
  56. package/lib/VtxMap/style/css.js +0 -10
  57. package/lib/VtxMap/style/css.js.map +0 -1
  58. package/lib/VtxMap/style/index.js.map +0 -1
  59. package/lib/VtxMap/zoomMap.js.map +0 -1
  60. package/lib/VtxModal/VtxModal.css +0 -62
  61. package/lib/VtxModal/VtxModal.js.map +0 -1
  62. package/lib/VtxModal/VtxModalAntd3.css +0 -62
  63. package/lib/VtxModal/VtxModalAntd3.less +0 -67
  64. package/lib/VtxModal/draggableModal.js.map +0 -1
  65. package/lib/VtxModal/index.js.map +0 -1
  66. package/lib/VtxModal/style/css.js +0 -15
  67. package/lib/VtxModal/style/css.js.map +0 -1
  68. package/lib/VtxModal/style/index.js.map +0 -1
  69. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.css +0 -182
  70. package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +0 -1
  71. package/lib/VtxSearchCheckMap/VtxSearchCheckMapAntd3.css +0 -0
  72. package/lib/VtxSearchCheckMap/VtxSearchCheckMapAntd3.less +0 -1
  73. package/lib/VtxSearchCheckMap/index.js.map +0 -1
  74. package/lib/VtxSearchCheckMap/mapping.js.map +0 -1
  75. package/lib/VtxSearchCheckMap/style/css.js +0 -28
  76. package/lib/VtxSearchCheckMap/style/css.js.map +0 -1
  77. package/lib/VtxSearchCheckMap/style/index.js.map +0 -1
  78. package/lib/VtxSearchMap/VtxSearchMap.css +0 -202
  79. package/lib/VtxSearchMap/VtxSearchMap.js.map +0 -1
  80. package/lib/VtxSearchMap/VtxSearchMapAntd3.css +0 -0
  81. package/lib/VtxSearchMap/index.js.map +0 -1
  82. package/lib/VtxSearchMap/mapping.js.map +0 -1
  83. package/lib/VtxSearchMap/style/css.js +0 -28
  84. package/lib/VtxSearchMap/style/css.js.map +0 -1
  85. package/lib/VtxSearchMap/style/index.js.map +0 -1
  86. package/lib/default.js.map +0 -1
  87. package/lib/index.js.map +0 -1
  88. package/lib/utils/util.js.map +0 -1
@@ -4,48 +4,51 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports["default"] = void 0;
7
+ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactDom = require("react-dom");
10
10
  var _MapToolFunction = require("../MapToolFunction");
11
11
  var _immutable = _interopRequireDefault(require("immutable"));
12
- var _unionBy = _interopRequireDefault(require("lodash/unionBy"));
13
- var _default2 = _interopRequireDefault(require("../../default"));
12
+ var _unionBy = _interopRequireDefault(require("lodash-es/unionBy"));
13
+ var _default2 = _interopRequireWildcard(require("../../default"));
14
14
  var _antd = require("antd");
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
17
20
  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; }
18
21
  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; }
19
- 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; }
20
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
22
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
21
24
  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."); }
22
- 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; } }
23
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
24
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
25
- 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; }
26
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
27
- 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); } }
28
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
29
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
25
+ 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); }
26
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
27
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
28
+ 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; }
29
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
31
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
30
33
  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); }
31
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
32
- 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); }
33
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
34
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
35
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
36
- 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); }
37
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
38
- var Set = _immutable["default"].Set;
34
+ 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); }
35
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
36
+ 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); }; }
37
+ 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); }
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
+ 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; } }
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+ var Set = _immutable.default.Set;
39
42
  //公共地址配置
40
43
 
41
44
  // 百度地图js文件内做了一些额外的http or https判断
42
45
  // 如果协议为Https,我们需要改动全局变量BMAP_PROTOCOL和BMap_loadScriptTime
43
- if (window.location.protocol === 'https:') {
46
+ if (window.location.protocol === "https:") {
44
47
  window.BMAP_PROTOCOL = "https";
45
48
  window.BMap_loadScriptTime = new Date().getTime();
46
49
  }
47
50
  var gisMapConstant = {
48
- circle: 'BMAP_POINT_SHAPE_CIRCLE',
51
+ circle: "BMAP_POINT_SHAPE_CIRCLE",
49
52
  //圆形
50
53
  star: 1,
51
54
  //星形
@@ -70,10 +73,12 @@ var gisMapConstant = {
70
73
  huge: 7 //定义点的尺寸为超大,宽高为30px*30px
71
74
  };
72
75
  var BaiduMap = /*#__PURE__*/function (_React$Component) {
76
+ _inherits(BaiduMap, _React$Component);
77
+ var _super = _createSuper(BaiduMap);
73
78
  function BaiduMap(props) {
74
79
  var _this;
75
80
  _classCallCheck(this, BaiduMap);
76
- _this = _callSuper(this, BaiduMap, [props]);
81
+ _this = _super.call(this, props);
77
82
  _this.GM = new _MapToolFunction.graphicManage(); //初始化 图元管理方法
78
83
  _this.getPolygonArea = _MapToolFunction.getPolygonArea;
79
84
  _this.initPointIndex = 0; //初始化地图时记录点当前位置
@@ -102,9 +107,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
102
107
  //地图上面的ids
103
108
  circleIds: [],
104
109
  //地图上圆的ids
105
- editId: '',
110
+ editId: "",
106
111
  //当前编辑的图元id
107
- editGraphic: '',
112
+ editGraphic: "",
108
113
  //当前编辑完后图元所有数据
109
114
  boundaryInfo: [],
110
115
  //当前画出的边界线的id和区域名
@@ -121,77 +126,76 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
121
126
  _this.loadMapJs();
122
127
  return _this;
123
128
  }
124
- _inherits(BaiduMap, _React$Component);
125
- return _createClass(BaiduMap, [{
129
+ _createClass(BaiduMap, [{
126
130
  key: "loadPlugin",
127
131
  value: function loadPlugin() {
128
132
  var loadList = [];
129
133
  if (!window.BMapLib || !window.BMapLib.DistanceTool) {
130
134
  loadList.push(new Promise(function (resolve, reject) {
131
- $.getScript("".concat(_default2["default"].mapServerURL, "/DistanceTool_min.js"), function () {
135
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/DistanceTool_min.js"), function () {
132
136
  resolve();
133
137
  });
134
138
  }));
135
139
  }
136
140
  if (!window.BMapLib || !window.BMapLib.TrafficControl) {
137
141
  loadList.push(new Promise(function (resolve, reject) {
138
- $.getScript("".concat(_default2["default"].mapServerURL, "/TrafficControl_min.js"), function () {
142
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/TrafficControl_min.js"), function () {
139
143
  resolve();
140
144
  });
141
145
  }));
142
146
  }
143
147
  if (!window.BMapLib || !window.BMapLib.MarkerClusterer) {
144
148
  loadList.push(new Promise(function (resolve, reject) {
145
- $.getScript("".concat(_default2["default"].mapServerURL, "/MarkerClusterer_min.js"), function () {
149
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/MarkerClusterer_min.js"), function () {
146
150
  resolve();
147
151
  });
148
152
  }));
149
153
  }
150
154
  if (!window.BMapLib || !window.BMapLib.AreaRestriction) {
151
155
  loadList.push(new Promise(function (resolve, reject) {
152
- $.getScript("".concat(_default2["default"].mapServerURL, "/AreaRestriction_min.js"), function () {
156
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/AreaRestriction_min.js"), function () {
153
157
  resolve();
154
158
  });
155
159
  }));
156
160
  }
157
161
  if (!window.BMapLib || !window.BMapLib.DrawingManager) {
158
162
  loadList.push(new Promise(function (resolve, reject) {
159
- $.getScript("".concat(_default2["default"].mapServerURL, "/DrawingManager_min.js"), function () {
163
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/DrawingManager_min.js"), function () {
160
164
  resolve();
161
165
  });
162
166
  }));
163
167
  }
164
168
  if (!window.BMapLib || !window.BMapLib.HeatmapOverlay) {
165
169
  loadList.push(new Promise(function (resolve, reject) {
166
- $.getScript("".concat(_default2["default"].mapServerURL, "/Heatmap_min.js"), function () {
170
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/Heatmap_min.js"), function () {
167
171
  resolve();
168
172
  });
169
173
  }));
170
174
  }
171
175
  if (!window.BMapLib || !window.BMapLib.GeoUtils) {
172
176
  loadList.push(new Promise(function (resolve, reject) {
173
- $.getScript("".concat(_default2["default"].mapServerURL, "/GeoUtils_min.js"), function () {
177
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/GeoUtils_min.js"), function () {
174
178
  resolve();
175
179
  });
176
180
  }));
177
181
  }
178
182
  if (!window.BMapLib || !window.BMapLib.TextIconOverlay) {
179
183
  loadList.push(new Promise(function (resolve, reject) {
180
- $.getScript("".concat(_default2["default"].mapServerURL, "/TextIconOverlay_min.js"), function () {
184
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/TextIconOverlay_min.js"), function () {
181
185
  resolve();
182
186
  });
183
187
  }));
184
188
  }
185
189
  if (!window.BMapLib || !window.BMapLib.InfoBox) {
186
190
  loadList.push(new Promise(function (resolve, reject) {
187
- $.getScript("".concat(_default2["default"].mapServerURL, "/InfoBox_min.js"), function () {
191
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/InfoBox_min.js"), function () {
188
192
  resolve();
189
193
  });
190
194
  }));
191
195
  loadList.push();
192
196
  }
193
197
  loadList.push(new Promise(function (resolve, reject) {
194
- $.getScript("".concat(_default2["default"].mapServerURL, "/TextIconOverlay_min.js"), function () {
198
+ (0, _default2.loadScript)("".concat(_default2.default.mapServerURL, "/TextIconOverlay_min.js"), function () {
195
199
  resolve();
196
200
  });
197
201
  }));
@@ -204,19 +208,21 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
204
208
  value: function loadMapJs() {
205
209
  var _this2 = this;
206
210
  this.loadMapComplete = new Promise(function (resolve, reject) {
207
- if (window.BMap) {
208
- resolve(_this2.loadPlugin());
209
- } else {
210
- // EVlFc6DZzAzU5avIjoxNcFgQ
211
- $.getScript(_default2["default"].bmapScriptUrl, function () {
211
+ (0, _default2.ensurejQuery)().then(function () {
212
+ if (window.BMap) {
212
213
  resolve(_this2.loadPlugin());
213
- });
214
- $("<link>").attr({
215
- rel: "stylesheet",
216
- type: "text/css",
217
- href: '//api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.css'
218
- }).appendTo("head");
219
- }
214
+ } else {
215
+ // EVlFc6DZzAzU5avIjoxNcFgQ
216
+ (0, _default2.loadScript)(_default2.default.bmapScriptUrl, function () {
217
+ resolve(_this2.loadPlugin());
218
+ });
219
+ $("<link>").attr({
220
+ rel: "stylesheet",
221
+ type: "text/css",
222
+ href: "//api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.css"
223
+ }).appendTo("head");
224
+ }
225
+ });
220
226
  });
221
227
  }
222
228
  //初始化地图数据
@@ -371,7 +377,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
371
377
  maxZoom: options.maxZoom
372
378
  });
373
379
  if (mapStyle) {
374
- if (typeof mapStyle === 'string') {
380
+ if (typeof mapStyle === "string") {
375
381
  t.state.gis.setMapStyle({
376
382
  style: mapStyle
377
383
  });
@@ -383,8 +389,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
383
389
  }
384
390
  }
385
391
  setTimeout(function () {
386
- $('#myCanvasElement').parent().children('svg').css({
387
- 'z-index': 1
392
+ $("#myCanvasElement").parent().children("svg").css({
393
+ "z-index": 1
388
394
  });
389
395
  }, 500);
390
396
  // 初始化地图,设置中心点坐标和地图级别
@@ -400,10 +406,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
400
406
  showPanel: false
401
407
  });
402
408
  map.addControl(t._trafficCtrl);
403
- if (document.getElementById('tcBtn').remove) {
404
- document.getElementById('tcBtn').remove();
409
+ if (document.getElementById("tcBtn").remove) {
410
+ document.getElementById("tcBtn").remove();
405
411
  } else {
406
- document.getElementById('tcBtn').removeNode();
412
+ document.getElementById("tcBtn").removeNode();
407
413
  }
408
414
  }
409
415
  //开启鼠标滚轮缩放
@@ -430,7 +436,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
430
436
  if (!t._drawmanager) {
431
437
  t._drawmanager = new BMapLib.DrawingManager(map);
432
438
  //监听绘制结束事件
433
- t._drawmanager.addEventListener('overlaycomplete', function (e) {
439
+ t._drawmanager.addEventListener("overlaycomplete", function (e) {
434
440
  var _t$frameSelectProps$b;
435
441
  if (e.label) {
436
442
  t.state.gis.removeOverlay(e.label);
@@ -441,22 +447,22 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
441
447
  var backobj = {
442
448
  id: drawExtData.id,
443
449
  attributes: drawExtData.attributes,
444
- geometryType: drawExtData.type == 'rectangle' ? 'polygon' : drawExtData.type,
450
+ geometryType: drawExtData.type == "rectangle" ? "polygon" : drawExtData.type,
445
451
  mapLayer: e.overlay,
446
452
  geometry: {
447
- type: drawExtData.type == 'rectangle' ? 'polygon' : drawExtData.type
453
+ type: drawExtData.type == "rectangle" ? "polygon" : drawExtData.type
448
454
  }
449
455
  };
450
456
  //点击事件
451
- e.overlay.addEventListener('click', function (e) {
457
+ e.overlay.addEventListener("click", function (e) {
452
458
  t.clickGraphic(drawExtData.id, e);
453
459
  });
454
460
  //鼠标移入事件
455
- e.overlay.addEventListener('mouseover', function (e) {
461
+ e.overlay.addEventListener("mouseover", function (e) {
456
462
  t.mouseOverGraphic(drawExtData.id, e);
457
463
  });
458
464
  //鼠标移出事件
459
- e.overlay.addEventListener('mouseout', function (e) {
465
+ e.overlay.addEventListener("mouseout", function (e) {
460
466
  t.mouseOutGraphic(drawExtData.id, e);
461
467
  });
462
468
  //缓存绘制的图元信息
@@ -469,29 +475,29 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
469
475
  path = _t$dealData.path;
470
476
  //处理返回数据
471
477
  switch (drawExtData.type) {
472
- case 'point':
478
+ case "point":
473
479
  backobj.geometry.x = e.overlay.getPosition().lng;
474
480
  backobj.geometry.y = e.overlay.getPosition().lat;
475
481
  break;
476
- case 'polyline':
482
+ case "polyline":
477
483
  backobj.distance = e.calculate;
478
484
  backobj.lnglatAry = lnglatAry;
479
485
  backobj.geometry.paths = path;
480
486
  backobj.geometry._extent = _extent;
481
487
  break;
482
- case 'polygon':
488
+ case "polygon":
483
489
  backobj.area = e.calculate;
484
490
  backobj.lnglatAry = lnglatAry;
485
491
  backobj.geometry.rings = path;
486
492
  backobj.geometry._extent = _extent;
487
493
  break;
488
- case 'rectangle':
494
+ case "rectangle":
489
495
  backobj.area = e.calculate;
490
496
  backobj.lnglatAry = lnglatAry;
491
497
  backobj.geometry.rings = path;
492
498
  backobj.geometry._extent = _extent;
493
499
  break;
494
- case 'circle':
500
+ case "circle":
495
501
  backobj.geometry.x = e.overlay.getCenter().lng;
496
502
  backobj.geometry.y = e.overlay.getCenter().lat;
497
503
  backobj.geometry.radius = e.overlay.getRadius();
@@ -500,7 +506,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
500
506
  }
501
507
  t.GM.setGraphicParam(drawExtData.id, backobj);
502
508
  t._drawmanager.close();
503
- if ('drawEnd' in t.props) {
509
+ if ("drawEnd" in t.props) {
504
510
  t.props.drawEnd(backobj);
505
511
  }
506
512
  if (((_t$frameSelectProps$b = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b === void 0 ? void 0 : _t$frameSelectProps$b.callback) instanceof Function) {
@@ -510,21 +516,21 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
510
516
  }
511
517
  t.initPropsForUser();
512
518
  }
513
- /*
514
- 切换地图矢量图和卫星图背景
515
- type:
516
- BMAP_NORMAL_MAP 矢量图
517
- BMAP_SATELLITE_MAP 单卫星图 (暂定不用)
518
- BMAP_HYBRID_MAP 卫星路况图
519
- */
519
+ /*
520
+ 切换地图矢量图和卫星图背景
521
+ type:
522
+ BMAP_NORMAL_MAP 矢量图
523
+ BMAP_SATELLITE_MAP 单卫星图 (暂定不用)
524
+ BMAP_HYBRID_MAP 卫星路况图
525
+ */
520
526
  }, {
521
527
  key: "setMapType",
522
528
  value: function setMapType(type) {
523
529
  switch (type) {
524
- case 'sl':
530
+ case "sl":
525
531
  this.state.gis.setMapType(BMAP_NORMAL_MAP);
526
532
  break;
527
- case 'wx':
533
+ case "wx":
528
534
  this.state.gis.setMapType(BMAP_HYBRID_MAP);
529
535
  break;
530
536
  }
@@ -553,8 +559,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
553
559
  imageURL: url
554
560
  },
555
561
  swnep = new BMap.Bounds(swp, nep),
556
- _imageUrlOverlay = new BMap.GroundOverlay(swnep, option);
557
- t.state.gis.addOverlay(_imageUrlOverlay);
562
+ imageUrlOverlay = new BMap.GroundOverlay(swnep, option);
563
+ t.state.gis.addOverlay(imageUrlOverlay);
558
564
  } else {
559
565
  console.warn("\u533A\u57DF\u7ECF\u7EAC\u5EA6sw/ne\u6570\u636E\u9519\u8BEF");
560
566
  return false;
@@ -582,7 +588,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
582
588
  var cg = {
583
589
  width: 30,
584
590
  height: 30,
585
- labelContent: '',
591
+ labelContent: "",
586
592
  labelPixelX: 0,
587
593
  labelPixelY: 34,
588
594
  BAnimationType: 3,
@@ -607,14 +613,14 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
607
613
  var position = new BMap.Point(item.longitude, item.latitude);
608
614
  var marker = null;
609
615
  if (item.markerContent) {
610
- /*自定义html加点
611
- 用Label来实现,无法再添加label(高德有判断,实现不同)*/
616
+ /*自定义html加点
617
+ 用Label来实现,无法再添加label(高德有判断,实现不同)*/
612
618
  //覆盖物参数
613
619
  var markerOption = {
614
620
  offset: new BMap.Size(cg.markerContentX + cg.width / 2, cg.markerContentY + cg.height / 2),
615
621
  icon: null
616
622
  };
617
- var icon = new BMap.Icon("".concat(_default2["default"].mapServerURL, "/images/touming.png"), new BMap.Size(cg.width, cg.height));
623
+ var icon = new BMap.Icon("".concat(_default2.default.mapServerURL, "/images/touming.png"), new BMap.Size(cg.width, cg.height));
618
624
  icon.setImageSize(new BMap.Size(cg.width, cg.height));
619
625
  markerOption = _objectSpread(_objectSpread({}, markerOption), {}, {
620
626
  icon: icon
@@ -627,8 +633,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
627
633
  };
628
634
  var markerL = new BMap.Label(item.markerContent, markerLOption);
629
635
  markerL.setStyle({
630
- backgroundColor: '',
631
- border: '0'
636
+ backgroundColor: "",
637
+ border: "0"
632
638
  });
633
639
  marker.setLabel(markerL);
634
640
  } else {
@@ -638,7 +644,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
638
644
  offset: new BMap.Size(cg.markerContentX + cg.width / 2, cg.markerContentY + cg.height / 2),
639
645
  icon: null
640
646
  };
641
- var _icon = new BMap.Icon(item.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"), new BMap.Size(cg.width, cg.height));
647
+ var _icon = new BMap.Icon(item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"), new BMap.Size(cg.width, cg.height));
642
648
  _icon.setImageSize(new BMap.Size(cg.width, cg.height));
643
649
  _markerOption = _objectSpread(_objectSpread({}, _markerOption), {}, {
644
650
  icon: _icon
@@ -649,17 +655,17 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
649
655
  //添加label
650
656
  if (item.canShowLabel && cg.labelContent) {
651
657
  //label默认样式
652
- var labelClass = 'label-content';
658
+ var labelClass = "label-content";
653
659
  //接受label自定义样式
654
660
  if (item.labelClass) {
655
- labelClass = item.labelClass.split(',').join(' ');
661
+ labelClass = item.labelClass.split(",").join(" ");
656
662
  }
657
- var markerLabel = new BMap.Label("<div class='" + labelClass + "' style=\"margin-left: 0;\">" + cg.labelContent + "</div>", {
663
+ var markerLabel = new BMap.Label("<div class='" + labelClass + '\' style="margin-left: 0;">' + cg.labelContent + "</div>", {
658
664
  offset: new BMap.Size(cg.labelPixelX, cg.labelPixelY)
659
665
  });
660
666
  markerLabel.setStyle({
661
- border: '0',
662
- backgroundColor: ''
667
+ border: "0",
668
+ backgroundColor: ""
663
669
  });
664
670
  marker.setLabel(markerLabel);
665
671
  }
@@ -675,15 +681,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
675
681
  marker.setAnimation(BMAP_ANIMATION_DROP);
676
682
  }
677
683
  //点击事件
678
- marker.addEventListener('click', function (e) {
684
+ marker.addEventListener("click", function (e) {
679
685
  t.clickGraphic(item.id, e);
680
686
  });
681
687
  //鼠标移入事件
682
- marker.addEventListener('mouseover', function (e) {
688
+ marker.addEventListener("mouseover", function (e) {
683
689
  t.mouseOverGraphic(item.id, e);
684
690
  });
685
691
  //鼠标移出事件
686
- marker.addEventListener('mouseout', function (e) {
692
+ marker.addEventListener("mouseout", function (e) {
687
693
  t.mouseOutGraphic(item.id, e);
688
694
  });
689
695
  //缓存所有点的id
@@ -693,15 +699,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
693
699
  attributes: _objectSpread(_objectSpread({}, item), {}, {
694
700
  other: item
695
701
  }),
696
- geometryType: 'point',
702
+ geometryType: "point",
697
703
  geometry: {
698
- type: 'point',
704
+ type: "point",
699
705
  x: item.longitude,
700
706
  y: item.latitude
701
707
  }
702
708
  });
703
709
  });
704
- if (type !== 'defined') {
710
+ if (type !== "defined") {
705
711
  //所有点缓存在state中
706
712
  // t.setState({
707
713
  // pointIds: psids
@@ -729,7 +735,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
729
735
  var cg = {
730
736
  width: 30,
731
737
  height: 30,
732
- labelContent: '',
738
+ labelContent: "",
733
739
  labelPixelX: 0,
734
740
  labelPixelY: 34,
735
741
  BAnimationType: 3,
@@ -752,7 +758,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
752
758
  }
753
759
  if (item.markerContent) {
754
760
  gc.setOffset(new BMap.Size(cg.markerContentX + cg.width / 2, cg.markerContentY + cg.height / 2));
755
- var icon = new BMap.Icon("".concat(_default2["default"].mapServerURL, "/images/touming.png"), new BMap.Size(cg.width, cg.height));
761
+ var icon = new BMap.Icon("".concat(_default2.default.mapServerURL, "/images/touming.png"), new BMap.Size(cg.width, cg.height));
756
762
  icon.setImageSize(new BMap.Size(cg.width, cg.height));
757
763
  gc.setIcon(icon);
758
764
  if (!!gc.getLabel()) {
@@ -765,8 +771,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
765
771
  };
766
772
  var markerL = new BMap.Label(item.markerContent, markerLOption);
767
773
  markerL.setStyle({
768
- backgroundColor: '',
769
- border: '0'
774
+ backgroundColor: "",
775
+ border: "0"
770
776
  });
771
777
  gc.setLabel(markerL);
772
778
  }
@@ -774,7 +780,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
774
780
  cg.width = cg.width || gc.getIcon().size.width;
775
781
  cg.height = cg.height || gc.getIcon().size.height;
776
782
  //未改变方式的点 直接修改数据
777
- var _icon2 = new BMap.Icon(item.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"), new BMap.Size(cg.width, cg.height));
783
+ var _icon2 = new BMap.Icon(item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"), new BMap.Size(cg.width, cg.height));
778
784
  _icon2.setImageSize(new BMap.Size(cg.width, cg.height));
779
785
  gc.setIcon(_icon2);
780
786
  gc.setOffset(new BMap.Size((cg.markerContentX || -15) + cg.width / 2, (cg.markerContentY || -30) + cg.height / 2));
@@ -784,12 +790,12 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
784
790
  if (item.canShowLabel && cg.labelContent) {
785
791
  var markerLabel = gc.getLabel(),
786
792
  //label默认样式
787
- labelClass = 'label-content';
793
+ labelClass = "label-content";
788
794
  //接受label自定义样式
789
795
  if (item.labelClass) {
790
- labelClass = item.labelClass.split(',').join(' ');
796
+ labelClass = item.labelClass.split(",").join(" ");
791
797
  }
792
- var labelContent = "<div class='" + labelClass + "' style=\"margin-left: 0;\">" + cg.labelContent + "</div>",
798
+ var labelContent = "<div class='" + labelClass + '\' style="margin-left: 0;">' + cg.labelContent + "</div>",
793
799
  labelOffset = new BMap.Size(cg.labelPixelX, cg.labelPixelY);
794
800
  if (markerLabel) {
795
801
  markerLabel.setContent(labelContent);
@@ -799,14 +805,14 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
799
805
  offset: labelOffset
800
806
  });
801
807
  markerLabel.setStyle({
802
- border: '0',
803
- backgroundColor: ''
808
+ border: "0",
809
+ backgroundColor: ""
804
810
  });
805
811
  gc.setLabel(markerLabel);
806
812
  }
807
813
  } else {
808
814
  if (!!gc.getLabel()) {
809
- gc.getLabel().setContent('');
815
+ gc.getLabel().setContent("");
810
816
  }
811
817
  }
812
818
  if (cg.BAnimationType == 0) {
@@ -832,9 +838,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
832
838
  attributes: _objectSpread(_objectSpread({}, item), {}, {
833
839
  other: item
834
840
  }),
835
- geometryType: 'point',
841
+ geometryType: "point",
836
842
  geometry: {
837
- type: 'point',
843
+ type: "point",
838
844
  x: item.longitude,
839
845
  y: item.latitude
840
846
  }
@@ -876,10 +882,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
876
882
  }
877
883
  //初始化默认参数
878
884
  var cg = {
879
- color: '#277ffa',
885
+ color: "#277ffa",
880
886
  pellucidity: 0.9,
881
887
  lineWidth: 5,
882
- lineType: 'solid',
888
+ lineType: "solid",
883
889
  isHidden: false
884
890
  };
885
891
  //合并参数
@@ -912,15 +918,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
912
918
  //添加线至地图
913
919
  t.state.gis.addOverlay(line);
914
920
  //点击事件
915
- line.addEventListener('click', function (e) {
921
+ line.addEventListener("click", function (e) {
916
922
  t.clickGraphic(item.id, e);
917
923
  });
918
924
  //鼠标移入事件
919
- line.addEventListener('mouseover', function (e) {
925
+ line.addEventListener("mouseover", function (e) {
920
926
  t.mouseOverGraphic(item.id, e);
921
927
  });
922
928
  //鼠标移出事件
923
- line.addEventListener('mouseout', function (e) {
929
+ line.addEventListener("mouseout", function (e) {
924
930
  t.mouseOutGraphic(item.id, e);
925
931
  });
926
932
  t.GM.setGraphic(item.id, line).setGraphicParam(item.id, {
@@ -928,14 +934,14 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
928
934
  paths: item.paths,
929
935
  other: item
930
936
  }),
931
- geometryType: 'polyline',
937
+ geometryType: "polyline",
932
938
  geometry: {
933
- type: 'polyline',
939
+ type: "polyline",
934
940
  paths: item.paths
935
941
  }
936
942
  });
937
943
  });
938
- if (type !== 'defined') {
944
+ if (type !== "defined") {
939
945
  t.state.lineIds = lsids;
940
946
  // t.setState({
941
947
  // lineIds: lsids
@@ -963,10 +969,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
963
969
  var gc = t.GM.getGraphic(item.id);
964
970
  //初始化默认参数
965
971
  var cg = {
966
- color: '#277ffa',
972
+ color: "#277ffa",
967
973
  pellucidity: 0.9,
968
974
  lineWidth: 5,
969
- lineType: 'solid',
975
+ lineType: "solid",
970
976
  //'solid' 'dashed'
971
977
  isHidden: false
972
978
  };
@@ -999,9 +1005,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
999
1005
  paths: item.paths,
1000
1006
  other: item
1001
1007
  }),
1002
- geometryType: 'polyline',
1008
+ geometryType: "polyline",
1003
1009
  geometry: {
1004
- type: 'polyline',
1010
+ type: "polyline",
1005
1011
  paths: item.paths
1006
1012
  }
1007
1013
  });
@@ -1027,11 +1033,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1027
1033
  }
1028
1034
  //初始化参数
1029
1035
  var cg = {
1030
- lineType: 'solid',
1036
+ lineType: "solid",
1031
1037
  lineWidth: 5,
1032
- lineColor: '#277ffa',
1038
+ lineColor: "#277ffa",
1033
1039
  lineOpacity: 1,
1034
- color: '#fff',
1040
+ color: "#fff",
1035
1041
  pellucidity: 0.5
1036
1042
  // isHidden: false //后期需要再加
1037
1043
  };
@@ -1055,15 +1061,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1055
1061
  //添加面至地图
1056
1062
  t.state.gis.addOverlay(polygon);
1057
1063
  //点击事件
1058
- polygon.addEventListener('click', function (e) {
1064
+ polygon.addEventListener("click", function (e) {
1059
1065
  t.clickGraphic(item.id, e);
1060
1066
  });
1061
1067
  //鼠标移入事件
1062
- polygon.addEventListener('mouseover', function (e) {
1068
+ polygon.addEventListener("mouseover", function (e) {
1063
1069
  t.mouseOverGraphic(item.id, e);
1064
1070
  });
1065
1071
  //鼠标移出事件
1066
- polygon.addEventListener('mouseout', function (e) {
1072
+ polygon.addEventListener("mouseout", function (e) {
1067
1073
  t.mouseOutGraphic(item.id, e);
1068
1074
  });
1069
1075
  //缓存面id
@@ -1074,9 +1080,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1074
1080
  rings: item.rings,
1075
1081
  other: item
1076
1082
  }),
1077
- geometryType: 'polygon',
1083
+ geometryType: "polygon",
1078
1084
  geometry: {
1079
- type: 'polygon',
1085
+ type: "polygon",
1080
1086
  rings: item.rings
1081
1087
  }
1082
1088
  });
@@ -1103,11 +1109,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1103
1109
  var gc = t.GM.getGraphic(item.id);
1104
1110
  //初始化参数
1105
1111
  var cg = {
1106
- lineType: 'solid',
1112
+ lineType: "solid",
1107
1113
  lineWidth: 5,
1108
- lineColor: '#277ffa',
1114
+ lineColor: "#277ffa",
1109
1115
  lineOpacity: 1,
1110
- color: '#fff',
1116
+ color: "#fff",
1111
1117
  pellucidity: 0.5
1112
1118
  // isHidden: false //后期需要再加
1113
1119
  };
@@ -1136,9 +1142,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1136
1142
  rings: item.rings,
1137
1143
  other: item
1138
1144
  }),
1139
- geometryType: 'polygon',
1145
+ geometryType: "polygon",
1140
1146
  geometry: {
1141
- type: 'polygon',
1147
+ type: "polygon",
1142
1148
  rings: item.rings
1143
1149
  }
1144
1150
  });
@@ -1166,11 +1172,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1166
1172
  return false;
1167
1173
  }
1168
1174
  var cg = {
1169
- lineType: 'solid',
1175
+ lineType: "solid",
1170
1176
  lineWidth: 5,
1171
- lineColor: '#277ffa',
1177
+ lineColor: "#277ffa",
1172
1178
  lineOpacity: 1,
1173
- color: '#fff',
1179
+ color: "#fff",
1174
1180
  pellucidity: 0.5
1175
1181
  // isHidden: false //后期需要在加
1176
1182
  };
@@ -1192,15 +1198,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1192
1198
  //添加圆至地图
1193
1199
  t.state.gis.addOverlay(circle);
1194
1200
  //点击事件
1195
- circle.addEventListener('click', function (e) {
1201
+ circle.addEventListener("click", function (e) {
1196
1202
  t.clickGraphic(item.id, e);
1197
1203
  });
1198
1204
  //鼠标移入事件
1199
- circle.addEventListener('mouseover', function (e) {
1205
+ circle.addEventListener("mouseover", function (e) {
1200
1206
  t.mouseOverGraphic(item.id, e);
1201
1207
  });
1202
1208
  //鼠标移出事件
1203
- circle.addEventListener('mouseout', function (e) {
1209
+ circle.addEventListener("mouseout", function (e) {
1204
1210
  t.mouseOutGraphic(item.id, e);
1205
1211
  });
1206
1212
  ccsids.push(item.id);
@@ -1209,9 +1215,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1209
1215
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1210
1216
  other: item
1211
1217
  }),
1212
- geometryType: 'circle',
1218
+ geometryType: "circle",
1213
1219
  geometry: {
1214
- type: 'circle',
1220
+ type: "circle",
1215
1221
  x: item.longitude,
1216
1222
  y: item.latitude,
1217
1223
  radius: item.radius
@@ -1240,11 +1246,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1240
1246
  var gc = t.GM.getGraphic(item.id);
1241
1247
  //获取原有的面属性,转换key值
1242
1248
  var cg = {
1243
- lineType: 'solid',
1249
+ lineType: "solid",
1244
1250
  lineWidth: 5,
1245
- lineColor: '#277ffa',
1251
+ lineColor: "#277ffa",
1246
1252
  lineOpacity: 1,
1247
- color: '#fff',
1253
+ color: "#fff",
1248
1254
  pellucidity: 0.5
1249
1255
  // isHidden: false //后期需要在加
1250
1256
  };
@@ -1273,9 +1279,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1273
1279
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1274
1280
  other: item
1275
1281
  }),
1276
- geometryType: 'circle',
1282
+ geometryType: "circle",
1277
1283
  geometry: {
1278
- type: 'circle',
1284
+ type: "circle",
1279
1285
  x: item.longitude,
1280
1286
  y: item.latitude,
1281
1287
  radius: item.radius
@@ -1297,9 +1303,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1297
1303
  // fix 飞地有多个区域的问题
1298
1304
  var arr = [];
1299
1305
  ary.boundaries.forEach(function (item) {
1300
- var id = 'boundary' + new Date().getTime() + Math.random();
1301
- var paths = item.split(';').map(function (item, index) {
1302
- return item.split(',');
1306
+ var id = "boundary" + new Date().getTime() + Math.random();
1307
+ var paths = item.split(";").map(function (item, index) {
1308
+ return item.split(",");
1303
1309
  });
1304
1310
  arr.push({
1305
1311
  id: id,
@@ -1331,7 +1337,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1331
1337
  })
1332
1338
  });
1333
1339
  removedBDIds.forEach(function (id) {
1334
- t.removeGraphic(id, 'polygon');
1340
+ t.removeGraphic(id, "polygon");
1335
1341
  });
1336
1342
  }
1337
1343
  //热力图
@@ -1388,7 +1394,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1388
1394
  if (d.config) {
1389
1395
  cg = _objectSpread(_objectSpread({}, cg), d.config);
1390
1396
  }
1391
- var sContent = document.createElement('div');
1397
+ var sContent = document.createElement("div");
1392
1398
  var infowindow = new BMap.InfoWindow(sContent);
1393
1399
  infowindow.setWidth(cg.width);
1394
1400
  infowindow.setHeight(cg.height);
@@ -1404,7 +1410,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1404
1410
  infowindow && t.state.gis.closeInfoWindow();
1405
1411
  }
1406
1412
  }
1407
- //添加海量点
1413
+ //添加海量点
1408
1414
  }, {
1409
1415
  key: "addPointCollection",
1410
1416
  value: function addPointCollection() {
@@ -1419,9 +1425,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1419
1425
  points.push(p);
1420
1426
  });
1421
1427
  var options = {
1422
- size: gisMapConstant[d.size] || gisMapConstant['normal'],
1423
- shape: gisMapConstant[d.shape] || gisMapConstant['circle'],
1424
- color: d.color || '#d340c3'
1428
+ size: gisMapConstant[d.size] || gisMapConstant["normal"],
1429
+ shape: gisMapConstant[d.shape] || gisMapConstant["circle"],
1430
+ color: d.color || "#d340c3"
1425
1431
  };
1426
1432
  // 初始化PointCollection
1427
1433
  var VotexpointCollection = new BMap.PointCollection(points, options);
@@ -1430,8 +1436,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1430
1436
  id: d.id,
1431
1437
  value: VotexpointCollection
1432
1438
  });
1433
- VotexpointCollection.addEventListener('click', function (e) {
1434
- if ('clickPointCollection' in t.props && typeof t.props.clickPointCollection == 'function') {
1439
+ VotexpointCollection.addEventListener("click", function (e) {
1440
+ if ("clickPointCollection" in t.props && typeof t.props.clickPointCollection == "function") {
1435
1441
  var obj = _objectSpread(_objectSpread({
1436
1442
  id: d.id
1437
1443
  }, e.point), {}, {
@@ -1459,9 +1465,9 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1459
1465
  });
1460
1466
  item.value.setPoints(points);
1461
1467
  item.value.setStyles({
1462
- size: gisMapConstant[ds.size] || gisMapConstant['normal'],
1463
- shape: gisMapConstant[ds.shape] || gisMapConstant['circle'],
1464
- color: ds.color || '#d340c3'
1468
+ size: gisMapConstant[ds.size] || gisMapConstant["normal"],
1469
+ shape: gisMapConstant[ds.shape] || gisMapConstant["circle"],
1470
+ color: ds.color || "#d340c3"
1465
1471
  });
1466
1472
  }
1467
1473
  });
@@ -1522,7 +1528,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1522
1528
  var t = this;
1523
1529
  //编辑中的图元关闭其他事件返回
1524
1530
  if (t.state.editId == id) return false;
1525
- if (typeof t.props.mouseOverGraphic === 'function') {
1531
+ if (typeof t.props.mouseOverGraphic === "function") {
1526
1532
  var obj = {
1527
1533
  e: e,
1528
1534
  id: id,
@@ -1560,7 +1566,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1560
1566
  value: function clickMap() {
1561
1567
  var t = this;
1562
1568
  if (typeof t.props.clickMap === "function") {
1563
- t.state.gis.addEventListener('click', function (e) {
1569
+ t.state.gis.addEventListener("click", function (e) {
1564
1570
  var obj = t.getMapExtent();
1565
1571
  obj.e = e;
1566
1572
  obj.clickLngLat = e.point;
@@ -1574,8 +1580,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1574
1580
  key: "dragMapStart",
1575
1581
  value: function dragMapStart() {
1576
1582
  var t = this;
1577
- if (typeof t.props.dragMapStart === 'function') {
1578
- t.state.gis.addEventListener('dragstart', function (e) {
1583
+ if (typeof t.props.dragMapStart === "function") {
1584
+ t.state.gis.addEventListener("dragstart", function (e) {
1579
1585
  var obj = t.getMapExtent();
1580
1586
  obj.e = e;
1581
1587
  t.props.dragMapStart(obj);
@@ -1587,8 +1593,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1587
1593
  key: "dragMapEnd",
1588
1594
  value: function dragMapEnd() {
1589
1595
  var t = this;
1590
- if (typeof t.props.dragMapEnd === 'function') {
1591
- t.state.gis.addEventListener('dragend', function (e) {
1596
+ if (typeof t.props.dragMapEnd === "function") {
1597
+ t.state.gis.addEventListener("dragend", function (e) {
1592
1598
  var obj = t.getMapExtent();
1593
1599
  obj.e = e;
1594
1600
  t.props.dragMapEnd(obj);
@@ -1600,8 +1606,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1600
1606
  key: "moveStart",
1601
1607
  value: function moveStart() {
1602
1608
  var t = this;
1603
- if (typeof t.props.moveStart === 'function') {
1604
- t.state.gis.addEventListener('movestart', function (e) {
1609
+ if (typeof t.props.moveStart === "function") {
1610
+ t.state.gis.addEventListener("movestart", function (e) {
1605
1611
  var obj = t.getMapExtent();
1606
1612
  obj.e = e;
1607
1613
  t.props.moveStart(obj);
@@ -1613,8 +1619,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1613
1619
  key: "moveEnd",
1614
1620
  value: function moveEnd() {
1615
1621
  var t = this;
1616
- if (typeof t.props.moveEnd === 'function') {
1617
- t.state.gis.addEventListener('moveend', function (e) {
1622
+ if (typeof t.props.moveEnd === "function") {
1623
+ t.state.gis.addEventListener("moveend", function (e) {
1618
1624
  var obj = t.getMapExtent();
1619
1625
  obj.e = e;
1620
1626
  t.props.moveEnd(obj);
@@ -1626,8 +1632,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1626
1632
  key: "zoomStart",
1627
1633
  value: function zoomStart() {
1628
1634
  var t = this;
1629
- if (typeof t.props.zoomStart === 'function') {
1630
- t.state.gis.addEventListener('zoomstart', function (e) {
1635
+ if (typeof t.props.zoomStart === "function") {
1636
+ t.state.gis.addEventListener("zoomstart", function (e) {
1631
1637
  var obj = t.getMapExtent();
1632
1638
  obj.e = e;
1633
1639
  t.props.zoomStart(obj);
@@ -1639,8 +1645,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1639
1645
  key: "zoomEnd",
1640
1646
  value: function zoomEnd() {
1641
1647
  var t = this;
1642
- if (typeof t.props.zoomEnd === 'function') {
1643
- t.state.gis.addEventListener('zoomend', function (e) {
1648
+ if (typeof t.props.zoomEnd === "function") {
1649
+ t.state.gis.addEventListener("zoomend", function (e) {
1644
1650
  var obj = t.getMapExtent();
1645
1651
  obj.e = e;
1646
1652
  t.props.zoomEnd(obj);
@@ -1686,11 +1692,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1686
1692
  t.state.gis.setZoom(zoom);
1687
1693
  }
1688
1694
  //将制定图元展示在视野内 (强制改变地图中心位置)
1689
- /*
1690
- 参数arg格式如下1,2
1691
- 1.string 格式如:'1,a,2,3,4'
1692
- 2.数组 ['1','2']
1693
- */
1695
+ /*
1696
+ 参数arg格式如下1,2
1697
+ 1.string 格式如:'1,a,2,3,4'
1698
+ 2.数组 ['1','2']
1699
+ */
1694
1700
  }, {
1695
1701
  key: "setVisiblePoints",
1696
1702
  value: function setVisiblePoints(mapVisiblePoints) {
@@ -1700,19 +1706,19 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1700
1706
  var ary = [];
1701
1707
  var obj = null;
1702
1708
  switch (mapVisiblePoints.fitView) {
1703
- case 'point':
1709
+ case "point":
1704
1710
  arg = this.state.pointIds;
1705
1711
  break;
1706
- case 'line':
1712
+ case "line":
1707
1713
  arg = this.state.lineIds;
1708
1714
  break;
1709
- case 'polygon':
1715
+ case "polygon":
1710
1716
  arg = this.state.polygonIds;
1711
1717
  break;
1712
- case 'circle':
1718
+ case "circle":
1713
1719
  arg = this.state.circleIds;
1714
1720
  break;
1715
- case 'all':
1721
+ case "all":
1716
1722
  arg = this.state.pointIds.concat(this.state.lineIds).concat(this.state.polygonIds).concat(this.state.circleIds);
1717
1723
  break;
1718
1724
  default:
@@ -1720,28 +1726,28 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1720
1726
  break;
1721
1727
  }
1722
1728
 
1723
- /**
1724
- * 用法
1725
- * map.setVisiblePoints('lng,lat;lng,lat')
1729
+ /**
1730
+ * 用法
1731
+ * map.setVisiblePoints('lng,lat;lng,lat')
1726
1732
  */
1727
- if (typeof arg === 'string') {
1728
- ary = arg.split(',');
1733
+ if (typeof arg === "string") {
1734
+ ary = arg.split(",");
1729
1735
  obj = t.getFitView(ary);
1730
1736
  } else if (arg instanceof Array) {
1731
- /**
1732
- * 用法
1733
- * map.setVisiblePoints([[lng,lat],[lng,lat]])
1734
- */
1737
+ /**
1738
+ * 用法
1739
+ * map.setVisiblePoints([[lng,lat],[lng,lat]])
1740
+ */
1735
1741
  if (arg[0] instanceof Array) {
1736
1742
  var a = [];
1737
1743
  for (var i = 0; i < arg.length; i++) {
1738
1744
  a.push(new BMap.Point(arg[i][0], arg[i][1]));
1739
1745
  }
1740
1746
  obj = t.state.gis.getViewport(a);
1741
- /**
1742
- * 用法
1743
- * map.setVisiblePoints(['lng,lat','lng,lat'])
1744
- */
1747
+ /**
1748
+ * 用法
1749
+ * map.setVisiblePoints(['lng,lat','lng,lat'])
1750
+ */
1745
1751
  } else {
1746
1752
  obj = t.getFitView(arg);
1747
1753
  }
@@ -1749,11 +1755,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1749
1755
  if (!obj) {
1750
1756
  return false;
1751
1757
  }
1752
- if (!type || type == 'all') {
1758
+ if (!type || type == "all") {
1753
1759
  t.state.gis.centerAndZoom(obj.center, obj.zoom);
1754
- } else if (type == 'zoom') {
1760
+ } else if (type == "zoom") {
1755
1761
  t.setZoomLevel(obj.zoom);
1756
- } else if (type == 'center') {
1762
+ } else if (type == "center") {
1757
1763
  t.setCenter([obj.center.lng, obj.center.lat]);
1758
1764
  }
1759
1765
  }
@@ -1781,18 +1787,18 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1781
1787
  var allLayers = [];
1782
1788
  for (var i = 0; i < ids.length; i++) {
1783
1789
  switch ((t.GM.getGraphicParam(ids[i]) || {}).geometryType) {
1784
- case 'point':
1790
+ case "point":
1785
1791
  if (t.GM.getGraphic(ids[i])) {
1786
1792
  allLayers.push(t.GM.getGraphic(ids[i]).getPosition());
1787
1793
  }
1788
1794
  break;
1789
- case 'polyline':
1790
- case 'polygon':
1795
+ case "polyline":
1796
+ case "polygon":
1791
1797
  if (t.GM.getGraphic(ids[i])) {
1792
1798
  allLayers = [].concat(_toConsumableArray(allLayers), _toConsumableArray(t.GM.getGraphic(ids[i]).getPath()));
1793
1799
  }
1794
1800
  break;
1795
- case 'circle':
1801
+ case "circle":
1796
1802
  if (t.GM.getGraphic(ids[i])) {
1797
1803
  allLayers.push(t.GM.getGraphic(ids[i]).getCenter());
1798
1804
  }
@@ -1837,7 +1843,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1837
1843
  lng = 0,
1838
1844
  lat = 0;
1839
1845
  switch (gp.geometryType) {
1840
- case 'point':
1846
+ case "point":
1841
1847
  lng = gg.getPosition().lng;
1842
1848
  lat = gg.getPosition().lat;
1843
1849
  p = _objectSpread(_objectSpread({}, gp), {}, {
@@ -1856,7 +1862,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1856
1862
  })
1857
1863
  });
1858
1864
  break;
1859
- case 'polyline':
1865
+ case "polyline":
1860
1866
  pts = gg.getPath().map(function (item, index) {
1861
1867
  return [item.lng, item.lat];
1862
1868
  });
@@ -1873,15 +1879,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1873
1879
  })
1874
1880
  });
1875
1881
  break;
1876
- case 'polygon':
1882
+ case "polygon":
1877
1883
  // fix: 编辑图元时面积计算不正确,需要过滤一下重复的经纬度
1878
- // pts = uniqBy(gg.getPath(), function(res){
1879
- // return res.lng && res.lat
1880
- // }).map((item)=>{
1881
- // return [item.lng,item.lat]
1882
- // });
1883
- // 不是很理解这段计算面积为啥需要过滤重复的经纬度--会导致点位丢失
1884
- pts = gg.getPath().map(function (item) {
1884
+ pts = (0, _unionBy.default)(gg.getPath(), function (res) {
1885
+ return res.lng && res.lat;
1886
+ }).map(function (item) {
1885
1887
  return [item.lng, item.lat];
1886
1888
  });
1887
1889
  p = _objectSpread(_objectSpread({}, gp), {}, {
@@ -1897,7 +1899,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1897
1899
  })
1898
1900
  });
1899
1901
  break;
1900
- case 'circle':
1902
+ case "circle":
1901
1903
  lng = gg.getCenter().lng;
1902
1904
  lat = gg.getCenter().lat;
1903
1905
  var radius = gg.getRadius();
@@ -1948,19 +1950,19 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1948
1950
  }
1949
1951
  var ids = [];
1950
1952
  switch (type) {
1951
- case 'point':
1953
+ case "point":
1952
1954
  ids = t.state.pointIds;
1953
1955
  break;
1954
- case 'line':
1956
+ case "line":
1955
1957
  ids = t.state.lineIds;
1956
1958
  break;
1957
- case 'polygon':
1959
+ case "polygon":
1958
1960
  ids = t.state.polygonIds;
1959
1961
  break;
1960
- case 'circle':
1962
+ case "circle":
1961
1963
  ids = t.state.circleIds;
1962
1964
  break;
1963
- case 'draw':
1965
+ case "draw":
1964
1966
  if (t.state.drawIds.point.indexOf(id) > -1) {
1965
1967
  t.state.drawIds.point.splice(t.state.drawIds.point.indexOf(id), 1);
1966
1968
  }
@@ -1993,7 +1995,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
1993
1995
  break;
1994
1996
  }
1995
1997
  if (id == t.state.editId) {
1996
- t.state.editId = '';
1998
+ t.state.editId = "";
1997
1999
  }
1998
2000
  if (ids.indexOf(id) != -1) {
1999
2001
  ids.splice(ids.indexOf(id), 1);
@@ -2023,18 +2025,17 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2023
2025
  id: id,
2024
2026
  geometry: param.geometry
2025
2027
  };
2026
- if (param.geometry.type == 'polygon') {
2028
+ if (param.geometry.type == "polygon") {
2027
2029
  // obj.area = BMapLib.GeoUtils.getPolygonArea(param.mapLayer);
2028
2030
  // fix: 只能是数组计算之前的计算因为重复的经纬度导致面积为NAN
2029
- // obj.area = BMapLib.GeoUtils.getPolygonArea(param.geometry.rings.map((item)=>{
2030
- // return new BMap.Point(item[0], item[1])
2031
- // }));
2032
- obj.area = t.getPolygonArea(param.geometry.rings);
2031
+ obj.area = BMapLib.GeoUtils.getPolygonArea(param.geometry.rings.map(function (item) {
2032
+ return new BMap.Point(item[0], item[1]);
2033
+ }));
2033
2034
  }
2034
- if (param.geometry.type == 'polyline') {
2035
+ if (param.geometry.type == "polyline") {
2035
2036
  obj.distance = t.calculateDistance(param.geometry.paths);
2036
2037
  }
2037
- if (param.geometry.type == 'circle') {
2038
+ if (param.geometry.type == "circle") {
2038
2039
  obj.area = Math.pow(param.geometry.radius, 2) * Math.PI;
2039
2040
  if (t.editTimeout) {
2040
2041
  clearTimeout(t.editTimeout);
@@ -2056,17 +2057,17 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2056
2057
  };
2057
2058
  }
2058
2059
  switch (gtp.geometryType) {
2059
- case 'point':
2060
+ case "point":
2060
2061
  graphic.enableDragging();
2061
2062
  graphic.addEventListener("dragend", t.editGraphicChange);
2062
2063
  break;
2063
- case 'polyline':
2064
- case 'polygon':
2065
- case 'rectangle':
2064
+ case "polyline":
2065
+ case "polygon":
2066
+ case "rectangle":
2066
2067
  graphic.enableEditing();
2067
2068
  graphic.addEventListener("lineupdate", t.editGraphicChange);
2068
2069
  break;
2069
- case 'circle':
2070
+ case "circle":
2070
2071
  graphic.enableEditing();
2071
2072
  graphic.addEventListener("lineupdate", t.editGraphicChange);
2072
2073
  break;
@@ -2085,25 +2086,25 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2085
2086
  var gtp = t.GM.getGraphicParam(t.state.editId);
2086
2087
  if (!graphic) return false;
2087
2088
  switch (gtp.geometryType) {
2088
- case 'point':
2089
+ case "point":
2089
2090
  graphic.disableDragging();
2090
2091
  graphic.removeEventListener("dragend", t.editGraphicChange);
2091
2092
  break;
2092
- case 'polyline':
2093
- case 'polygon':
2094
- case 'rectangle':
2093
+ case "polyline":
2094
+ case "polygon":
2095
+ case "rectangle":
2095
2096
  graphic.disableEditing();
2096
2097
  graphic.removeEventListener("lineupdate", t.editGraphicChange);
2097
2098
  break;
2098
- case 'circle':
2099
+ case "circle":
2099
2100
  graphic.disableEditing();
2100
2101
  graphic.removeEventListener("lineupdate", t.editGraphicChange);
2101
2102
  break;
2102
2103
  }
2103
2104
  var editGraphic = t.state.editGraphic;
2104
2105
  t.setState({
2105
- editId: '',
2106
- editGraphic: ''
2106
+ editId: "",
2107
+ editGraphic: ""
2107
2108
  }, function () {
2108
2109
  if (editGraphic) {
2109
2110
  t.props.editGraphicChange(editGraphic);
@@ -2119,7 +2120,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2119
2120
  //先关闭(防止连点)
2120
2121
  t._drawmanager.close();
2121
2122
  //初始化参数
2122
- drawParam.geometryType = obj.geometryType || 'point';
2123
+ drawParam.geometryType = obj.geometryType || "point";
2123
2124
  drawParam.parameter = obj.parameter ? _objectSpread({}, obj.parameter) : {};
2124
2125
  drawParam.data = obj.data ? _objectSpread({}, obj.data) : {};
2125
2126
  drawParam.data.id = (obj.data || {}).id || "draw".concat(new Date().getTime());
@@ -2132,7 +2133,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2132
2133
  }
2133
2134
  var param = {};
2134
2135
  var paramgcr = {};
2135
- if (drawParam.geometryType == 'polygon' || drawParam.geometryType == 'circle' || drawParam.geometryType == 'rectangle') {
2136
+ if (drawParam.geometryType == "polygon" || drawParam.geometryType == "circle" || drawParam.geometryType == "rectangle") {
2136
2137
  paramgcr.fillColor = drawParam.parameter.color;
2137
2138
  paramgcr.strokeColor = drawParam.parameter.lineColor;
2138
2139
  paramgcr.strokeOpacity = drawParam.parameter.lineOpacity;
@@ -2155,29 +2156,29 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2155
2156
  };
2156
2157
  }
2157
2158
  switch (drawParam.geometryType) {
2158
- case 'point':
2159
+ case "point":
2159
2160
  param.offset = new BMap.Size((drawParam.parameter.markerContentX || -15) + (drawParam.parameter.width || 30) / 2, (drawParam.parameter.markerContentY || -30) + (drawParam.parameter.height || 30) / 2);
2160
- var icon = new BMap.Icon(drawParam.parameter.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"), new BMap.Size(drawParam.parameter.width || 30, drawParam.parameter.height || 30));
2161
+ var icon = new BMap.Icon(drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"), new BMap.Size(drawParam.parameter.width || 30, drawParam.parameter.height || 30));
2161
2162
  icon.setImageSize(new BMap.Size(drawParam.parameter.width || 30, drawParam.parameter.height || 30));
2162
2163
  param.icon = icon;
2163
2164
  param.extData = {
2164
2165
  id: drawParam.data.id,
2165
2166
  attributes: {
2166
2167
  id: drawParam.data.id,
2167
- url: drawParam.parameter.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"),
2168
+ url: drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
2168
2169
  config: {
2169
2170
  width: drawParam.parameter.width || 36,
2170
2171
  height: drawParam.parameter.height || 36
2171
2172
  }
2172
2173
  },
2173
- type: 'point'
2174
+ type: "point"
2174
2175
  };
2175
- t._drawmanager.setDrawingMode('marker');
2176
+ t._drawmanager.setDrawingMode("marker");
2176
2177
  t._drawmanager.open({
2177
2178
  markerOptions: param
2178
2179
  });
2179
2180
  break;
2180
- case 'polyline':
2181
+ case "polyline":
2181
2182
  param.strokeColor = drawParam.parameter.color;
2182
2183
  param.strokeOpacity = drawParam.parameter.pellucidity;
2183
2184
  param.strokeWeight = drawParam.parameter.lineWidth;
@@ -2192,34 +2193,34 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2192
2193
  lineWidth: drawParam.parameter.lineWidth
2193
2194
  }
2194
2195
  },
2195
- type: 'polyline'
2196
+ type: "polyline"
2196
2197
  };
2197
2198
  t._drawmanager.open({
2198
2199
  polylineOptions: param,
2199
2200
  enableCalculate: true
2200
2201
  });
2201
- t._drawmanager.setDrawingMode('polyline');
2202
+ t._drawmanager.setDrawingMode("polyline");
2202
2203
  break;
2203
- case 'polygon':
2204
+ case "polygon":
2204
2205
  t._drawmanager.open({
2205
2206
  polygonOptions: paramgcr,
2206
2207
  enableCalculate: true
2207
2208
  });
2208
- t._drawmanager.setDrawingMode('polygon');
2209
+ t._drawmanager.setDrawingMode("polygon");
2209
2210
  break;
2210
- case 'circle':
2211
+ case "circle":
2211
2212
  t._drawmanager.open({
2212
2213
  circleOptions: paramgcr,
2213
2214
  enableCalculate: true
2214
2215
  });
2215
- t._drawmanager.setDrawingMode('circle');
2216
+ t._drawmanager.setDrawingMode("circle");
2216
2217
  break;
2217
- case 'rectangle':
2218
+ case "rectangle":
2218
2219
  t._drawmanager.open({
2219
2220
  rectangleOptions: paramgcr,
2220
2221
  enableCalculate: true
2221
2222
  });
2222
- t._drawmanager.setDrawingMode('rectangle');
2223
+ t._drawmanager.setDrawingMode("rectangle");
2223
2224
  break;
2224
2225
  }
2225
2226
  }
@@ -2307,10 +2308,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2307
2308
  var pointIds = t.state.pointIds;
2308
2309
  ary = pointIds;
2309
2310
  } else {
2310
- if (Object.prototype.toString.apply(arg) === '[object Array]') {
2311
+ if (Object.prototype.toString.apply(arg) === "[object Array]") {
2311
2312
  ary = arg;
2312
- } else if (typeof arg === 'string') {
2313
- ary = arg.split(',');
2313
+ } else if (typeof arg === "string") {
2314
+ ary = arg.split(",");
2314
2315
  }
2315
2316
  }
2316
2317
  //过滤moveTo的点位
@@ -2326,11 +2327,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2326
2327
  key: "vtxRangingTool",
2327
2328
  value: function vtxRangingTool(callback) {
2328
2329
  var t = this;
2329
- var _cb = function cb(e) {
2330
+ var cb = function cb(e) {
2330
2331
  //关闭测距
2331
2332
  t._rangingTool.close();
2332
2333
  //注销事件(避免重复)
2333
- t._rangingTool.removeEventListener('drawend', _cb);
2334
+ t._rangingTool.removeEventListener("drawend", cb);
2334
2335
  if (typeof callback === "function") {
2335
2336
  var obj = {
2336
2337
  distance: e.distance
@@ -2343,7 +2344,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2343
2344
  callback(obj);
2344
2345
  }
2345
2346
  };
2346
- t._rangingTool.addEventListener('drawend', _cb);
2347
+ t._rangingTool.addEventListener("drawend", cb);
2347
2348
  t._rangingTool.open(this.state.gis);
2348
2349
  }
2349
2350
  //开启路况
@@ -2365,8 +2366,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2365
2366
  key: "showControl",
2366
2367
  value: function showControl(props) {
2367
2368
  var t = this,
2368
- location = t.AnchorConstant['tr'],
2369
- type = '',
2369
+ location = t.AnchorConstant["tr"],
2370
+ type = "",
2370
2371
  offset = null,
2371
2372
  scaleOffset = null;
2372
2373
  var config = props || t.props;
@@ -2393,7 +2394,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2393
2394
  });
2394
2395
  t.state.gis.addControl(control);
2395
2396
  t.scaleControl = control;
2396
- if (type !== 'null') {
2397
+ if (type !== "null") {
2397
2398
  //右上角,仅包含平移和缩放按钮
2398
2399
  var navigation = new BMap.NavigationControl({
2399
2400
  anchor: location,
@@ -2423,7 +2424,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2423
2424
  key: "showMapTypeControl",
2424
2425
  value: function showMapTypeControl(props) {
2425
2426
  var t = this,
2426
- location = t.AnchorConstant['br'],
2427
+ location = t.AnchorConstant["br"],
2427
2428
  offset = null;
2428
2429
  var config = props || t.props;
2429
2430
  if (t.mapTypeControl) {
@@ -2468,11 +2469,11 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2468
2469
  value: function render() {
2469
2470
  var t = this;
2470
2471
  var _map = this.props;
2471
- return /*#__PURE__*/_react["default"].createElement("div", {
2472
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2472
2473
  id: _map.mapId,
2473
2474
  style: {
2474
- width: '100%',
2475
- height: '100%'
2475
+ width: "100%",
2476
+ height: "100%"
2476
2477
  }
2477
2478
  });
2478
2479
  }
@@ -2628,7 +2629,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2628
2629
  ymin: 0
2629
2630
  },
2630
2631
  path = [];
2631
- if ('getPath' in ms) {
2632
+ if ("getPath" in ms) {
2632
2633
  path = ms.getPath();
2633
2634
  path = path.map(function (item, index) {
2634
2635
  var lng = item.lng,
@@ -2730,7 +2731,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2730
2731
  }, {
2731
2732
  key: "deepEqual",
2732
2733
  value: function deepEqual(a, b) {
2733
- return _immutable["default"].is(_immutable["default"].fromJS(a), _immutable["default"].fromJS(b));
2734
+ return _immutable.default.is(_immutable.default.fromJS(a), _immutable.default.fromJS(b));
2734
2735
  }
2735
2736
  //数据解析(分析,新增,更新,删除对应的数据)
2736
2737
  }, {
@@ -2814,7 +2815,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2814
2815
  closeIconMargin: params.closeIconMargin || "1px 1px 0 0",
2815
2816
  enableAutoPan: true,
2816
2817
  align: 1,
2817
- closeIconUrl: params.closeIconUrl || "".concat(_default2["default"].mapServerURL, "/images/close.png")
2818
+ closeIconUrl: params.closeIconUrl || "".concat(_default2.default.mapServerURL, "/images/close.png")
2818
2819
  });
2819
2820
  var marker = new BMap.Marker(poi);
2820
2821
  t.popupWindow.open(marker);
@@ -2828,20 +2829,20 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2828
2829
  parameter = _ref$parameter === void 0 ? {} : _ref$parameter,
2829
2830
  _ref$data = _ref.data,
2830
2831
  data = _ref$data === void 0 ? {} : _ref$data;
2831
- if (!['polygon', 'circle', 'rectangle'].includes(geometryType)) {
2832
+ if (!["polygon", "circle", "rectangle"].includes(geometryType)) {
2832
2833
  _antd.message.warn("传入的类型不支持框选!");
2833
2834
  return false;
2834
2835
  }
2835
2836
  var t = this;
2836
2837
  var params = {},
2837
- type = geometryType || 'polygon',
2838
+ type = geometryType || "polygon",
2838
2839
  id = data.id || "frameSelectFeature_".concat(Math.random());
2839
- params.color = parameter.color || 'red';
2840
- params.lineColor = parameter.lineColor || 'red';
2840
+ params.color = parameter.color || "red";
2841
+ params.lineColor = parameter.lineColor || "red";
2841
2842
  params.lineOpacity = parameter.lineOpacity || 1;
2842
2843
  params.lineWidth = parameter.lineWidth || 2;
2843
2844
  params.pellucidity = parameter.pellucidity || 0.6;
2844
- params.lineType = parameter.lineType || 'solid';
2845
+ params.lineType = parameter.lineType || "solid";
2845
2846
  t.draw({
2846
2847
  geometryType: type,
2847
2848
  parameter: _objectSpread(_objectSpread({}, parameter), params),
@@ -2911,17 +2912,18 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2911
2912
  labelContent: r.title,
2912
2913
  labelPixelY: 27
2913
2914
  },
2914
- other: 'search'
2915
+ other: "search"
2915
2916
  };
2916
2917
  }));
2917
2918
  }
2918
- // console.log(result,result.getNumPages(),result.getPageIndex());
2919
+ // console.log(result,result.getNumPages(),result.getPageIndex());
2919
2920
  },
2920
2921
  pageCapacity: pageSize
2921
2922
  });
2922
2923
  psc.search(searchValue);
2923
2924
  });
2924
2925
  }
2926
+
2925
2927
  //初始化
2926
2928
  }, {
2927
2929
  key: "componentDidMount",
@@ -2997,7 +2999,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
2997
2999
  var props = t.props;
2998
3000
  // 设置地图地图样式
2999
3001
  if (mapStyle && !t.deepEqual(mapStyle, props.mapStyle)) {
3000
- if (typeof mapStyle === 'string') {
3002
+ if (typeof mapStyle === "string") {
3001
3003
  t.state.gis.setMapStyle({
3002
3004
  style: mapStyle
3003
3005
  });
@@ -3017,7 +3019,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3017
3019
 
3018
3020
  /*添加海量点*/
3019
3021
  if (mapPointCollection instanceof Array && props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, props.mapPointCollection)) {
3020
- var _t$dataMatch = t.dataMatch(props.mapPointCollection, mapPointCollection, 'id'),
3022
+ var _t$dataMatch = t.dataMatch(props.mapPointCollection, mapPointCollection, "id"),
3021
3023
  deletedDataIDs = _t$dataMatch.deletedDataIDs,
3022
3024
  addedData = _t$dataMatch.addedData,
3023
3025
  updatedData = _t$dataMatch.updatedData;
@@ -3025,14 +3027,14 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3025
3027
  t.addPointCollection(addedData);
3026
3028
  t.updatePointCollection(updatedData);
3027
3029
  }
3028
- if (typeof isclearAllPointCollection == 'boolean' && isclearAllPointCollection || isclearAllPointCollection && isclearAllPointCollection !== t.props.isclearAllPointCollection) {
3030
+ if (typeof isclearAllPointCollection == "boolean" && isclearAllPointCollection || isclearAllPointCollection && isclearAllPointCollection !== t.props.isclearAllPointCollection) {
3029
3031
  t.clearAllPointCollection();
3030
3032
  }
3031
- /*点数据处理
3032
- pointData[2]相同的点,执行刷新
3033
- pointData[1]的数据在idsForGraphicId中不存在的,执行新增
3034
- pointData[0]数据中多余的id,执行删除
3035
- */
3033
+ /*点数据处理
3034
+ pointData[2]相同的点,执行刷新
3035
+ pointData[1]的数据在idsForGraphicId中不存在的,执行新增
3036
+ pointData[0]数据中多余的id,执行删除
3037
+ */
3036
3038
  if (mapPoints instanceof Array && props.mapPoints instanceof Array && !t.deepEqual(mapPoints, props.mapPoints)) {
3037
3039
  var oldMapPoints = props.mapPoints;
3038
3040
  var newMapPoints = mapPoints;
@@ -3045,7 +3047,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3045
3047
  return item.id !== editGraphicId;
3046
3048
  });
3047
3049
  }
3048
- var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints, 'id'),
3050
+ var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints, "id"),
3049
3051
  _deletedDataIDs = _t$dataMatch2.deletedDataIDs,
3050
3052
  _addedData = _t$dataMatch2.addedData,
3051
3053
  _updatedData = _t$dataMatch2.updatedData;
@@ -3061,7 +3063,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3061
3063
  try {
3062
3064
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
3063
3065
  var id = _step.value;
3064
- t.removeGraphic(id, 'point');
3066
+ t.removeGraphic(id, "point");
3065
3067
  }
3066
3068
  //增加
3067
3069
  } catch (err) {
@@ -3073,10 +3075,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3073
3075
  //更新
3074
3076
  t.updatePoint([].concat(_toConsumableArray(upds), _toConsumableArray(otherupds)));
3075
3077
  }
3076
- /*
3077
- 面数据处理
3078
- 先全删除,再新增
3079
- */
3078
+ /*
3079
+ 面数据处理
3080
+ 先全删除,再新增
3081
+ */
3080
3082
  if (mapPolygons instanceof Array && props.mapPolygons instanceof Array && !t.deepEqual(mapPolygons, props.mapPolygons)) {
3081
3083
  var oldMapPolygons = props.mapPolygons;
3082
3084
  var newMapPolygons = mapPolygons;
@@ -3088,7 +3090,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3088
3090
  return item.id !== editGraphicId;
3089
3091
  });
3090
3092
  }
3091
- var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons, 'id'),
3093
+ var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons, "id"),
3092
3094
  _deletedDataIDs2 = _t$dataMatch3.deletedDataIDs,
3093
3095
  _addedData2 = _t$dataMatch3.addedData,
3094
3096
  _updatedData2 = _t$dataMatch3.updatedData;
@@ -3104,7 +3106,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3104
3106
  try {
3105
3107
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
3106
3108
  var _id = _step2.value;
3107
- t.removeGraphic(_id, 'polygon');
3109
+ t.removeGraphic(_id, "polygon");
3108
3110
  }
3109
3111
  //增加
3110
3112
  } catch (err) {
@@ -3116,10 +3118,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3116
3118
  //更新
3117
3119
  t.updatePolygon([].concat(_toConsumableArray(_upds), _toConsumableArray(_otherupds)));
3118
3120
  }
3119
- /*
3120
- 圆数据处理
3121
- 先全删除,再新增
3122
- */
3121
+ /*
3122
+ 圆数据处理
3123
+ 先全删除,再新增
3124
+ */
3123
3125
  if (mapCircles instanceof Array && props.mapCircles instanceof Array && !t.deepEqual(mapCircles, props.mapCircles)) {
3124
3126
  var oldMapCircles = props.mapCircles;
3125
3127
  var newMapCircles = mapCircles;
@@ -3131,7 +3133,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3131
3133
  return item.id !== editGraphicId;
3132
3134
  });
3133
3135
  }
3134
- var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles, 'id'),
3136
+ var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles, "id"),
3135
3137
  _deletedDataIDs3 = _t$dataMatch4.deletedDataIDs,
3136
3138
  _addedData3 = _t$dataMatch4.addedData,
3137
3139
  _updatedData3 = _t$dataMatch4.updatedData;
@@ -3147,7 +3149,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3147
3149
  try {
3148
3150
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
3149
3151
  var _id2 = _step3.value;
3150
- t.removeGraphic(_id2, 'circle');
3152
+ t.removeGraphic(_id2, "circle");
3151
3153
  }
3152
3154
  //增加
3153
3155
  } catch (err) {
@@ -3159,10 +3161,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3159
3161
  //更新
3160
3162
  t.updateCircle([].concat(_toConsumableArray(_upds2), _toConsumableArray(_otherupds2)));
3161
3163
  }
3162
- /*
3163
- 线数据处理
3164
- 先全删除,再新增
3165
- */
3164
+ /*
3165
+ 线数据处理
3166
+ 先全删除,再新增
3167
+ */
3166
3168
  if (mapLines instanceof Array && props.mapLines instanceof Array && !t.deepEqual(mapLines, props.mapLines)) {
3167
3169
  var oldMapLines = props.mapLines;
3168
3170
  var newMapLines = mapLines;
@@ -3174,7 +3176,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3174
3176
  return item.id !== editGraphicId;
3175
3177
  });
3176
3178
  }
3177
- var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines, 'id'),
3179
+ var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines, "id"),
3178
3180
  _deletedDataIDs4 = _t$dataMatch5.deletedDataIDs,
3179
3181
  _addedData4 = _t$dataMatch5.addedData,
3180
3182
  _updatedData4 = _t$dataMatch5.updatedData;
@@ -3190,7 +3192,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3190
3192
  try {
3191
3193
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
3192
3194
  var _id3 = _step4.value;
3193
- t.removeGraphic(_id3, 'line');
3195
+ t.removeGraphic(_id3, "line");
3194
3196
  }
3195
3197
  //增加
3196
3198
  } catch (err) {
@@ -3204,7 +3206,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3204
3206
  }
3205
3207
  //画其他特例线专用
3206
3208
  if (customizedBoundary instanceof Array && props.customizedBoundary instanceof Array && !t.deepEqual(customizedBoundary, props.customizedBoundary)) {
3207
- var _t$dataMatch6 = t.dataMatch(props.customizedBoundary, customizedBoundary, 'id'),
3209
+ var _t$dataMatch6 = t.dataMatch(props.customizedBoundary, customizedBoundary, "id"),
3208
3210
  _deletedDataIDs5 = _t$dataMatch6.deletedDataIDs,
3209
3211
  _addedData5 = _t$dataMatch6.addedData,
3210
3212
  _updatedData5 = _t$dataMatch6.updatedData;
@@ -3214,7 +3216,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3214
3216
  try {
3215
3217
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
3216
3218
  var _id4 = _step5.value;
3217
- t.removeGraphic(_id4, 'line');
3219
+ t.removeGraphic(_id4, "line");
3218
3220
  }
3219
3221
  } catch (err) {
3220
3222
  _iterator5.e(err);
@@ -3246,27 +3248,27 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3246
3248
  t.imageUrlOverlay(imageOverlays);
3247
3249
  }
3248
3250
  //图元编辑调用
3249
- if (typeof isDoEdit == 'boolean' && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
3251
+ if (typeof isDoEdit == "boolean" && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
3250
3252
  t.doEdit(editGraphicId);
3251
3253
  }
3252
3254
  //关闭图元编辑
3253
- if (typeof isEndEdit == 'boolean' && isEndEdit || isEndEdit && isEndEdit !== t.props.isEndEdit) {
3255
+ if (typeof isEndEdit == "boolean" && isEndEdit || isEndEdit && isEndEdit !== t.props.isEndEdit) {
3254
3256
  t.endEdit();
3255
3257
  }
3256
3258
  //开启图元绘制
3257
- if (typeof isDraw == 'boolean' && isDraw || isDraw && isDraw !== t.props.isDraw) {
3259
+ if (typeof isDraw == "boolean" && isDraw || isDraw && isDraw !== t.props.isDraw) {
3258
3260
  t.draw(mapDraw);
3259
3261
  }
3260
3262
  //关闭图元绘制
3261
- if (typeof isCloseDraw == 'boolean' && isCloseDraw || isCloseDraw && isCloseDraw !== t.props.isCloseDraw) {
3263
+ if (typeof isCloseDraw == "boolean" && isCloseDraw || isCloseDraw && isCloseDraw !== t.props.isCloseDraw) {
3262
3264
  t.closeDraw();
3263
3265
  }
3264
3266
  //设置中心点
3265
- if (typeof setCenter == 'boolean' && setCenter || setCenter && setCenter !== t.props.setCenter) {
3267
+ if (typeof setCenter == "boolean" && setCenter || setCenter && setCenter !== t.props.setCenter) {
3266
3268
  t.setCenter(mapCenter);
3267
3269
  }
3268
3270
  //设置点聚合
3269
- if (typeof setCluster == 'boolean' && setCluster || setCluster && setCluster !== t.props.setCluster) {
3271
+ if (typeof setCluster == "boolean" && setCluster || setCluster && setCluster !== t.props.setCluster) {
3270
3272
  t.cluster(mapCluster);
3271
3273
  }
3272
3274
  // 清除聚合
@@ -3274,15 +3276,15 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3274
3276
  t.removeCluster(mapCluster);
3275
3277
  }
3276
3278
  //设置比例尺
3277
- if (typeof setZoomLevel == 'boolean' && setZoomLevel || setZoomLevel && setZoomLevel !== t.props.setZoomLevel) {
3279
+ if (typeof setZoomLevel == "boolean" && setZoomLevel || setZoomLevel && setZoomLevel !== t.props.setZoomLevel) {
3278
3280
  t.setZoomLevel(mapZoomLevel);
3279
3281
  }
3280
3282
  //设置最优视野
3281
- if (typeof setVisiblePoints == 'boolean' && setVisiblePoints || setVisiblePoints && setVisiblePoints !== t.props.setVisiblePoints) {
3283
+ if (typeof setVisiblePoints == "boolean" && setVisiblePoints || setVisiblePoints && setVisiblePoints !== t.props.setVisiblePoints) {
3282
3284
  t.setVisiblePoints(mapVisiblePoints);
3283
3285
  }
3284
3286
  //测距工具调用
3285
- if (typeof isRangingTool == 'boolean' && isRangingTool || isRangingTool && isRangingTool !== t.props.isRangingTool) {
3287
+ if (typeof isRangingTool == "boolean" && isRangingTool || isRangingTool && isRangingTool !== t.props.isRangingTool) {
3286
3288
  t.vtxRangingTool(mapRangingTool);
3287
3289
  }
3288
3290
  //开关路况
@@ -3292,19 +3294,19 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3292
3294
  t.hideTrafficInfo();
3293
3295
  }
3294
3296
  //设置区域限制
3295
- if (typeof isSetAreaRestriction == 'boolean' && isSetAreaRestriction || isSetAreaRestriction && isSetAreaRestriction !== t.props.isSetAreaRestriction && areaRestriction && !!areaRestriction[0] && !!areaRestriction[1]) {
3297
+ if (typeof isSetAreaRestriction == "boolean" && isSetAreaRestriction || isSetAreaRestriction && isSetAreaRestriction !== t.props.isSetAreaRestriction && areaRestriction && !!areaRestriction[0] && !!areaRestriction[1]) {
3296
3298
  t.setAreaRestriction(areaRestriction);
3297
3299
  }
3298
3300
  //关闭区域限制
3299
- if (typeof isClearAreaRestriction == 'boolean' && isClearAreaRestriction || isClearAreaRestriction && isClearAreaRestriction !== t.props.isClearAreaRestriction) {
3301
+ if (typeof isClearAreaRestriction == "boolean" && isClearAreaRestriction || isClearAreaRestriction && isClearAreaRestriction !== t.props.isClearAreaRestriction) {
3300
3302
  t.clearAreaRestriction();
3301
3303
  }
3302
3304
  //清空地图
3303
- if (typeof isClearAll == 'boolean' && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
3305
+ if (typeof isClearAll == "boolean" && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
3304
3306
  t.clearAll();
3305
3307
  }
3306
3308
  //删除指定图元
3307
- if (typeof isRemove == 'boolean' && isRemove || isRemove && isRemove !== t.props.isRemove) {
3309
+ if (typeof isRemove == "boolean" && isRemove || isRemove && isRemove !== t.props.isRemove) {
3308
3310
  mapRemove.map(function (item, index) {
3309
3311
  t.removeGraphic(item.id, item.type);
3310
3312
  });
@@ -3375,7 +3377,6 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
3375
3377
  window.VtxMap && (window.VtxMap[t.state.mapId] = null);
3376
3378
  }
3377
3379
  }]);
3378
- }(_react["default"].Component);
3379
- var _default = exports["default"] = BaiduMap;
3380
- module.exports = exports["default"];
3381
- //# sourceMappingURL=Map.js.map
3380
+ return BaiduMap;
3381
+ }(_react.default.Component);
3382
+ var _default = exports.default = BaiduMap;