@vtx/map 1.2.29 → 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 -20
  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,47 +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
12
  var _default2 = _interopRequireWildcard(require("../../default"));
13
- 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); }
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
15
- 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; } } }; }
16
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ 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); }
15
+ 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; }
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ 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; } } }; }
18
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
17
19
  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."); }
18
- 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; } }
19
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
20
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
21
- 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; }
20
+ 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); }
21
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+ 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; }
22
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
- function _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; }
25
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
26
- 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); } }
27
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
28
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ 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; }
27
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28
+ 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); } }
29
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
29
31
  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); }
30
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
31
- 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); }
32
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
33
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
34
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
35
- 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); }
36
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
37
- var Set = _immutable["default"].Set;
32
+ 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); }
33
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ 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); }; }
35
+ 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); }
36
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
+ 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; } }
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+ var Set = _immutable.default.Set;
38
40
  //公共地址配置
39
41
  var TMap = /*#__PURE__*/function (_React$Component) {
42
+ _inherits(TMap, _React$Component);
43
+ var _super = _createSuper(TMap);
40
44
  function TMap(props) {
41
45
  var _this;
42
46
  _classCallCheck(this, TMap);
43
- _this = _callSuper(this, TMap, [props]);
47
+ _this = _super.call(this, props);
44
48
  //初始化 图元管理方法
45
49
  _this.GM = new _MapToolFunction.graphicManage();
46
50
  _this.getPolygonArea = _MapToolFunction.getPolygonArea;
47
- _this.pointCollectionId = 'vtx_gmap_html_pointCollection'; //海量点canvas点位容器id class管理
51
+ _this.pointCollectionId = "vtx_gmap_html_pointCollection"; //海量点canvas点位容器id class管理
48
52
  _this.isNotClickMap = false; //阻止点击事件冒泡到地图
49
53
  _this.isZoom = false; //阻止 zoom事件后触发的移动事件
50
54
  _this.mapLeft = 0; //地图offset的Left值
@@ -80,9 +84,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
80
84
  //地图上面的ids
81
85
  circleIds: [],
82
86
  //地图上圆的ids
83
- editId: '',
87
+ editId: "",
84
88
  //当前编辑的图元id
85
- editGraphic: '',
89
+ editGraphic: "",
86
90
  //当前编辑完后图元所有数据
87
91
  // center: props.mapCenter,
88
92
  mapZoomLevel: props.mapZoomLevel,
@@ -96,64 +100,65 @@ var TMap = /*#__PURE__*/function (_React$Component) {
96
100
  circle: [],
97
101
  rectangle: []
98
102
  },
99
- controlStyle: 'lt'
103
+ controlStyle: "lt"
100
104
  };
101
105
  _this.frameSelectProps = {};
102
106
  _this.loadMapJs();
103
107
  return _this;
104
108
  }
105
- _inherits(TMap, _React$Component);
106
- return _createClass(TMap, [{
109
+ _createClass(TMap, [{
107
110
  key: "loadMapJs",
108
111
  value: function loadMapJs() {
109
112
  var t = this;
110
113
  this.loadMapComplete = new Promise(function (resolve, reject) {
111
- if (window.T) {
112
- resolve(window.T);
113
- } else {
114
- $.getScript("".concat(_default2["default"].mapServerURL, "/T_content.js"), function () {
115
- $.getScript(_default2["default"].tmapScriptUrl, function () {
116
- var Heatmap = new Promise(function (resolve, reject) {
117
- //对象问题 和arcgis使用不同的热力图
118
- $.getScript("".concat(_default2["default"].mapServerURL, "/Theatmap.js"), function () {
119
- resolve();
114
+ (0, _default2.ensurejQuery)().then(function () {
115
+ if (window.T) {
116
+ resolve(window.T);
117
+ } else {
118
+ $.getScript("".concat(_default2.default.mapServerURL, "/T_content.js"), function () {
119
+ $.getScript(_default2.default.tmapScriptUrl, function () {
120
+ var Heatmap = new Promise(function (resolve, reject) {
121
+ //对象问题 和arcgis使用不同的热力图
122
+ $.getScript("".concat(_default2.default.mapServerURL, "/Theatmap.js"), function () {
123
+ resolve();
124
+ });
120
125
  });
121
- });
122
- var HeatmapNew = new Promise(function (resolve, reject) {
123
- //新版的热力图--老的暂不废弃,但是有问题
124
- $.getScript("".concat(_default2["default"].mapServerURL, "/HeatmapOverlay.js"), function () {
125
- resolve();
126
+ var HeatmapNew = new Promise(function (resolve, reject) {
127
+ //新版的热力图--老的暂不废弃,但是有问题
128
+ $.getScript("".concat(_default2.default.mapServerURL, "/HeatmapOverlay.js"), function () {
129
+ resolve();
130
+ });
126
131
  });
127
- });
128
- var PointCollection = new Promise(function (resolve, reject) {
129
- $.getScript("".concat(_default2["default"].mapServerURL, "/GPointCollection.js"), function () {
130
- resolve();
132
+ var PointCollection = new Promise(function (resolve, reject) {
133
+ $.getScript("".concat(_default2.default.mapServerURL, "/GPointCollection.js"), function () {
134
+ resolve();
135
+ });
131
136
  });
132
- });
133
- var ImageOverlays = new Promise(function (resolve, reject) {
134
- $.getScript("".concat(_default2["default"].mapServerURL, "/TImageOverlay.js"), function () {
135
- resolve();
137
+ var ImageOverlays = new Promise(function (resolve, reject) {
138
+ $.getScript("".concat(_default2.default.mapServerURL, "/TImageOverlay.js"), function () {
139
+ resolve();
140
+ });
136
141
  });
137
- });
138
- // let components = new Promise((resolve,reject)=>{
139
- // $.getScript(`${configUrl.mapServerURL}/T_toolComponents.js`,()=>{
140
- // resolve();
141
- // })
142
- // });
143
- Promise.all([Heatmap, PointCollection, ImageOverlays, HeatmapNew /*,components*/]).then(function () {
144
- if (t.waitInit) {
145
- clearInterval(t.waitInit);
146
- }
147
- t.waitInit = setInterval(function () {
148
- if (T.Tool) {
142
+ // let components = new Promise((resolve,reject)=>{
143
+ // $.getScript(`${configUrl.mapServerURL}/T_toolComponents.js`,()=>{
144
+ // resolve();
145
+ // })
146
+ // });
147
+ Promise.all([Heatmap, PointCollection, ImageOverlays, HeatmapNew /*,components*/]).then(function () {
148
+ if (t.waitInit) {
149
149
  clearInterval(t.waitInit);
150
- resolve(window.T);
151
150
  }
152
- }, 50);
151
+ t.waitInit = setInterval(function () {
152
+ if (T.Tool) {
153
+ clearInterval(t.waitInit);
154
+ resolve(window.T);
155
+ }
156
+ }, 50);
157
+ });
153
158
  });
154
159
  });
155
- });
156
- }
160
+ }
161
+ });
157
162
  });
158
163
  }
159
164
  }, {
@@ -298,10 +303,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
298
303
  }
299
304
  //海量点图元容器
300
305
  t.pointCollectionId = "".concat(mapId, "_").concat(t.pointCollectionId);
301
- var pointCollectionDiv = document.createElement('div');
306
+ var pointCollectionDiv = document.createElement("div");
302
307
  pointCollectionDiv.id = t.pointCollectionId;
303
- pointCollectionDiv["class"] = 'vtx_gmap_html_pointCollection_t';
304
- pointCollectionDiv.className = 'vtx_gmap_html_pointCollection_t';
308
+ pointCollectionDiv.class = "vtx_gmap_html_pointCollection_t";
309
+ pointCollectionDiv.className = "vtx_gmap_html_pointCollection_t";
305
310
  $(t.state.gis.getPanes().mapPane.children[0]).before(pointCollectionDiv);
306
311
  t.initPropsForUser();
307
312
  }
@@ -340,20 +345,20 @@ var TMap = /*#__PURE__*/function (_React$Component) {
340
345
  parameter = _ref$parameter === void 0 ? {} : _ref$parameter,
341
346
  _ref$data = _ref.data,
342
347
  data = _ref$data === void 0 ? {} : _ref$data;
343
- if (!['polygon', 'circle', 'rectangle'].includes(geometryType)) {
348
+ if (!["polygon", "circle", "rectangle"].includes(geometryType)) {
344
349
  message.warn("传入的类型不支持框选!");
345
350
  return false;
346
351
  }
347
352
  var t = this;
348
353
  var params = {},
349
- type = geometryType || 'polygon',
354
+ type = geometryType || "polygon",
350
355
  id = data.id || "frameSelectFeature_".concat(Math.random());
351
- params.color = parameter.color || 'red';
352
- params.lineColor = parameter.lineColor || 'red';
356
+ params.color = parameter.color || "red";
357
+ params.lineColor = parameter.lineColor || "red";
353
358
  params.lineOpacity = parameter.lineOpacity || 1;
354
359
  params.lineWidth = parameter.lineWidth || 2;
355
360
  params.pellucidity = parameter.pellucidity || 0.6;
356
- params.lineType = parameter.lineType || 'solid';
361
+ params.lineType = parameter.lineType || "solid";
357
362
  t.draw({
358
363
  geometryType: type,
359
364
  parameter: _objectSpread(_objectSpread({}, parameter), params),
@@ -388,10 +393,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
388
393
  key: "setMapType",
389
394
  value: function setMapType(type) {
390
395
  switch (type) {
391
- case 'sl':
396
+ case "sl":
392
397
  this.state.gis.setMapType(TMAP_NORMAL_MAP);
393
398
  break;
394
- case 'wx':
399
+ case "wx":
395
400
  this.state.gis.setMapType(TMAP_HYBRID_MAP);
396
401
  break;
397
402
  }
@@ -414,11 +419,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
414
419
  }
415
420
  if (sw && ne && Array.isArray(sw) && Array.isArray(ne) && sw[0] && sw[1] && ne[0] && ne[1]) {
416
421
  var swnep = new T.LngLatBounds(new T.LngLat(sw[0], sw[1]), new T.LngLat(ne[0], ne[1])),
417
- _imageUrlOverlay = new T.ImageOverlay(url, swnep, {
422
+ imageUrlOverlay = new T.ImageOverlay(url, swnep, {
418
423
  minZoom: displayOnMinLevel || 3,
419
424
  maxZoom: displayOnMaxLevel || 18
420
425
  });
421
- t.state.gis.addOverLay(_imageUrlOverlay);
426
+ t.state.gis.addOverLay(imageUrlOverlay);
422
427
  } else {
423
428
  console.warn("\u533A\u57DF\u7ECF\u7EAC\u5EA6sw/ne\u6570\u636E\u9519\u8BEF");
424
429
  return false;
@@ -526,27 +531,27 @@ var TMap = /*#__PURE__*/function (_React$Component) {
526
531
  };
527
532
  //算出 要展示的图元点位
528
533
  switch (obj.fitView) {
529
- case 'point':
534
+ case "point":
530
535
  ls = getLngLats(pointIds);
531
536
  break;
532
- case 'line':
537
+ case "line":
533
538
  ls = getLngLats(lineIds);
534
539
  break;
535
- case 'polygon':
540
+ case "polygon":
536
541
  ls = getLngLats(polygonIds);
537
542
  break;
538
- case 'circle':
543
+ case "circle":
539
544
  ls = getLngLats(circleIds);
540
545
  break;
541
- case 'all':
546
+ case "all":
542
547
  ls = getLngLats([].concat(_toConsumableArray(pointIds), _toConsumableArray(lineIds), _toConsumableArray(polygonIds), _toConsumableArray(circleIds)));
543
548
  break;
544
549
  default:
545
550
  var ids = [];
546
551
  if (obj.fitView instanceof Array) {
547
552
  ids = obj.fitView;
548
- } else if (typeof obj.fitView === 'string') {
549
- ids = obj.fitView.split(',');
553
+ } else if (typeof obj.fitView === "string") {
554
+ ids = obj.fitView.split(",");
550
555
  }
551
556
  if (ids[0] instanceof Array) {
552
557
  ls = ids.map(function (item) {
@@ -561,9 +566,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
561
566
  var _t$state$gis$getViewp = t.state.gis.getViewport(ls),
562
567
  center = _t$state$gis$getViewp.center,
563
568
  zoom = _t$state$gis$getViewp.zoom;
564
- if (obj.type == 'zoom') {
569
+ if (obj.type == "zoom") {
565
570
  t.setZoomLevel(zoom);
566
- } else if (obj.type == 'center') {
571
+ } else if (obj.type == "center") {
567
572
  t.setCenter([center.lng, center.lat]);
568
573
  } else {
569
574
  t.state.gis.centerAndZoom(center, zoom);
@@ -643,10 +648,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
643
648
  var pointIds = t.state.pointIds;
644
649
  ary = pointIds;
645
650
  } else {
646
- if (Object.prototype.toString.apply(arg) === '[object Array]') {
651
+ if (Object.prototype.toString.apply(arg) === "[object Array]") {
647
652
  ary = arg;
648
- } else if (typeof arg === 'string') {
649
- ary = arg.split(',');
653
+ } else if (typeof arg === "string") {
654
+ ary = arg.split(",");
650
655
  }
651
656
  }
652
657
  var ms = this.GM.getMoreGraphic(ary).filter(function (item, index) {
@@ -678,7 +683,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
678
683
  key: "showControl",
679
684
  value: function showControl(props) {
680
685
  var t = this,
681
- location = t.AnchorConstant['tr'],
686
+ location = t.AnchorConstant["tr"],
682
687
  offset = null,
683
688
  scaleOffset = null;
684
689
  var config = props || t.props;
@@ -709,22 +714,22 @@ var TMap = /*#__PURE__*/function (_React$Component) {
709
714
  // TODO不支持偏移,手动偏移
710
715
  if (config.showControl.offset && config.showControl.offset.length > 0) {
711
716
  if (location == "topright") {
712
- $('div.tdt-top.tdt-right').css({
717
+ $("div.tdt-top.tdt-right").css({
713
718
  right: config.showControl.offset[0],
714
719
  top: config.showControl.offset[1]
715
720
  });
716
721
  } else if (location == "topleft") {
717
- $('div.tdt-top.tdt-left').css({
722
+ $("div.tdt-top.tdt-left").css({
718
723
  left: config.showControl.offset[0],
719
724
  top: config.showControl.offset[1]
720
725
  });
721
726
  } else if (location == "bottomleft") {
722
- $('div.tdt-bottom.tdt-left').css({
727
+ $("div.tdt-bottom.tdt-left").css({
723
728
  left: config.showControl.offset[0],
724
729
  bottom: config.showControl.offset[1]
725
730
  });
726
731
  } else if (location == "bottomright") {
727
- $('div.tdt-bottom.tdt-right').css({
732
+ $("div.tdt-bottom.tdt-right").css({
728
733
  right: config.showControl.offset[0],
729
734
  bottom: config.showControl.offset[1]
730
735
  });
@@ -752,7 +757,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
752
757
  key: "showMapTypeControl",
753
758
  value: function showMapTypeControl(props) {
754
759
  var t = this,
755
- location = t.AnchorConstant['br'],
760
+ location = t.AnchorConstant["br"],
756
761
  offset = null;
757
762
  var config = props || t.props;
758
763
  if (t.mapTypeControl) {
@@ -772,22 +777,22 @@ var TMap = /*#__PURE__*/function (_React$Component) {
772
777
  // TODO不支持偏移,手动偏移
773
778
  if (config.satelliteSwitch.offset && config.satelliteSwitch.offset.length > 0) {
774
779
  if (location == "topright") {
775
- $('div.tdt-top.tdt-right').css({
780
+ $("div.tdt-top.tdt-right").css({
776
781
  right: config.satelliteSwitch.offset[0],
777
782
  top: config.satelliteSwitch.offset[1]
778
783
  });
779
784
  } else if (location == "topleft") {
780
- $('div.tdt-top.tdt-left').css({
785
+ $("div.tdt-top.tdt-left").css({
781
786
  left: config.satelliteSwitch.offset[0],
782
787
  top: config.satelliteSwitch.offset[1]
783
788
  });
784
789
  } else if (location == "bottomleft") {
785
- $('div.tdt-bottom.tdt-left').css({
790
+ $("div.tdt-bottom.tdt-left").css({
786
791
  left: config.satelliteSwitch.offset[0],
787
792
  bottom: config.satelliteSwitch.offset[1]
788
793
  });
789
794
  } else if (location == "bottomright") {
790
- $('div.tdt-bottom.tdt-right').css({
795
+ $("div.tdt-bottom.tdt-right").css({
791
796
  right: config.satelliteSwitch.offset[0],
792
797
  bottom: config.satelliteSwitch.offset[1]
793
798
  });
@@ -809,11 +814,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
809
814
  lineTool.open();
810
815
  this.isNotClickMap = true;
811
816
  //监听每次点击事件,阻止地图点击事件冒泡
812
- lineTool.addEventListener('addpoint', function () {
817
+ lineTool.addEventListener("addpoint", function () {
813
818
  _this2.isNotClickMap = true;
814
819
  });
815
- lineTool.addEventListener('draw', function (obj) {
816
- if ('mapRangingTool' in t.props) {
820
+ lineTool.addEventListener("draw", function (obj) {
821
+ if ("mapRangingTool" in t.props) {
817
822
  t.props.mapRangingTool({
818
823
  distance: obj.currentDistance,
819
824
  lnglats: obj.currentLnglats.map(function (item, index) {
@@ -841,7 +846,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
841
846
  lng = 0,
842
847
  lat = 0;
843
848
  switch (gp.geometryType) {
844
- case 'point':
849
+ case "point":
845
850
  lng = gg.getLngLat().getLng();
846
851
  lat = gg.getLngLat().getLat();
847
852
  p = _objectSpread(_objectSpread({}, gp), {}, {
@@ -860,7 +865,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
860
865
  })
861
866
  });
862
867
  break;
863
- case 'polyline':
868
+ case "polyline":
864
869
  pts = gg.getLngLats().map(function (item, index) {
865
870
  return [item.lng, item.lat];
866
871
  });
@@ -877,7 +882,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
877
882
  })
878
883
  });
879
884
  break;
880
- case 'polygon':
885
+ case "polygon":
881
886
  pts = gg.getLngLats()[0].map(function (item, index) {
882
887
  return [item.lng, item.lat];
883
888
  });
@@ -894,7 +899,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
894
899
  })
895
900
  });
896
901
  break;
897
- case 'circle':
902
+ case "circle":
898
903
  lng = gg.getCenter().getLng();
899
904
  lat = gg.getCenter().getLat();
900
905
  var radius = gg.getRadius();
@@ -931,7 +936,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
931
936
  var cg = {
932
937
  width: 33,
933
938
  height: 33,
934
- labelContent: '',
939
+ labelContent: "",
935
940
  labelPixelX: 0,
936
941
  labelPixelY: 33,
937
942
  markerContentX: -16.5,
@@ -970,7 +975,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
970
975
  //判断html还是图片
971
976
  if (!!item.markerContent) {
972
977
  markerOption.icon = new T.Icon({
973
- iconUrl: item.url || "".concat(_default2["default"].mapServerURL, "/images/touming.png"),
978
+ iconUrl: item.url || "".concat(_default2.default.mapServerURL, "/images/touming.png"),
974
979
  iconSize: new T.Point(cg.width, cg.height),
975
980
  iconAnchor: new T.Point(-cg.markerContentX, -cg.markerContentY)
976
981
  });
@@ -989,7 +994,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
989
994
  //统一加点
990
995
  } else {
991
996
  markerOption.icon = new T.Icon({
992
- iconUrl: item.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"),
997
+ iconUrl: item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
993
998
  iconSize: new T.Point(cg.width, cg.height),
994
999
  iconAnchor: new T.Point(-cg.markerContentX, -cg.markerContentY)
995
1000
  });
@@ -1003,7 +1008,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1003
1008
  t.state.gis.addOverLay(marker);
1004
1009
  //是否展示label
1005
1010
  if (item.canShowLabel) {
1006
- var labelClass = item.labelClass || 'label-content';
1011
+ var labelClass = item.labelClass || "label-content";
1007
1012
  marker.label = new T.Label({
1008
1013
  text: "<div class='".concat(labelClass, "'>").concat(cg.labelContent, "</div>"),
1009
1014
  offset: new T.Point(cg.labelPixelX - cg.width / 2, cg.labelPixelY + (cg.markerContentY + cg.height / 2))
@@ -1019,15 +1024,15 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1019
1024
  }
1020
1025
  if (cg.deg) {
1021
1026
  marker.getElement().style.transform = marker.getElement().style.transform + " rotate(".concat(cg.deg, "deg)");
1022
- marker.getElement().style['-ms-transform'] = " rotate(".concat(cg.deg, "deg)");
1027
+ marker.getElement().style["-ms-transform"] = " rotate(".concat(cg.deg, "deg)");
1023
1028
  }
1024
- marker.addEventListener('click', function (e) {
1029
+ marker.addEventListener("click", function (e) {
1025
1030
  t.clickGraphic(item.id, e);
1026
1031
  });
1027
- marker.addEventListener('mouseover', function (e) {
1032
+ marker.addEventListener("mouseover", function (e) {
1028
1033
  t.mouseOverGraphic(item.id, e);
1029
1034
  });
1030
- marker.addEventListener('mouseout', function (e) {
1035
+ marker.addEventListener("mouseout", function (e) {
1031
1036
  t.mouseOutGraphic(item.id, e);
1032
1037
  });
1033
1038
  psids.push(item.id);
@@ -1036,16 +1041,16 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1036
1041
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1037
1042
  other: item
1038
1043
  }),
1039
- geometryType: 'point',
1044
+ geometryType: "point",
1040
1045
  geometry: {
1041
- type: 'point',
1046
+ type: "point",
1042
1047
  x: item.longitude,
1043
1048
  y: item.latitude
1044
1049
  },
1045
1050
  deg: cg.deg
1046
1051
  });
1047
1052
  });
1048
- if (type !== 'defined') {
1053
+ if (type !== "defined") {
1049
1054
  t.state.pointIds = psids;
1050
1055
  // t.setState({
1051
1056
  // pointIds: psids
@@ -1101,14 +1106,14 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1101
1106
  //暂时不设置旋转角度,后期维护设置吧
1102
1107
  deg: (item.config || {}).deg,
1103
1108
  zIndex: (item.config || {}).zIndex || 100,
1104
- labelClass: (item.config || {}).labelContent || 'label-content',
1105
- labelContent: '',
1109
+ labelClass: (item.config || {}).labelContent || "label-content",
1110
+ labelContent: "",
1106
1111
  BAnimationType: (item.config || {}).BAnimationType,
1107
1112
  labelPixelX: 0,
1108
1113
  labelPixelY: 33
1109
1114
  };
1110
1115
  gc.setIcon(new T.Icon({
1111
- iconUrl: item.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"),
1116
+ iconUrl: item.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
1112
1117
  iconSize: new T.Point(cg.width, cg.height),
1113
1118
  iconAnchor: new T.Point(-cg.markerContentX, -cg.markerContentY)
1114
1119
  }));
@@ -1126,8 +1131,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1126
1131
  // cg.labelContent= (item.config || {}).labelContent || gc.getLabel().options.text;
1127
1132
  cg.labelPixelX = (item.config || {}).labelPixelX ? (item.config || {}).labelPixelX - cg.width / 2 : cg.labelPixelX - cg.width / 2;
1128
1133
  cg.labelPixelY = (item.config || {}).labelPixelY ? (item.config || {}).labelPixelY + (cg.markerContentY + cg.height / 2) : cg.labelPixelY + (cg.markerContentY + cg.height / 2);
1129
- cg.labelContent = (item.config || {}).labelContent || '';
1130
- var labelClass = item.labelClass || 'label-content';
1134
+ cg.labelContent = (item.config || {}).labelContent || "";
1135
+ var labelClass = item.labelClass || "label-content";
1131
1136
  //更新label
1132
1137
  gc.label = new T.Label({
1133
1138
  text: "<div class='".concat(labelClass, "'>").concat(cg.labelContent, "</div>"),
@@ -1146,7 +1151,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1146
1151
  }
1147
1152
  if (cg.deg) {
1148
1153
  gc.getElement().style.transform = gc.getElement().style.transform + " rotate(".concat(cg.deg, "deg)");
1149
- gc.getElement().style['-ms-transform'] = " rotate(".concat(cg.deg, "deg)");
1154
+ gc.getElement().style["-ms-transform"] = " rotate(".concat(cg.deg, "deg)");
1150
1155
  }
1151
1156
  //动画效果会延迟执行经纬度的切换
1152
1157
  if ((item.config || {}).isAnimation) {
@@ -1156,9 +1161,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1156
1161
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1157
1162
  other: item
1158
1163
  }),
1159
- geometryType: 'point',
1164
+ geometryType: "point",
1160
1165
  geometry: {
1161
- type: 'point',
1166
+ type: "point",
1162
1167
  x: item.longitude,
1163
1168
  y: item.latitude
1164
1169
  },
@@ -1181,10 +1186,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1181
1186
  //遍历添加线(图元)
1182
1187
  mapLines.map(function (item, index) {
1183
1188
  var cg = {
1184
- color: '#277ffa',
1189
+ color: "#277ffa",
1185
1190
  pellucidity: 0.9,
1186
1191
  lineWidth: 5,
1187
- lineType: 'solid',
1192
+ lineType: "solid",
1188
1193
  isHidden: false
1189
1194
  };
1190
1195
  //如果id重复,直接跳过不执行.
@@ -1217,14 +1222,14 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1217
1222
  var polyline = new T.Polyline(p, lineOption);
1218
1223
  t.state.gis.addOverLay(polyline);
1219
1224
  // 添加点击事件
1220
- polyline.addEventListener('click', function (e) {
1225
+ polyline.addEventListener("click", function (e) {
1221
1226
  t.isNotClickMap = true;
1222
1227
  t.clickGraphic(item.id, e);
1223
1228
  });
1224
- polyline.addEventListener('mouseover', function (e) {
1229
+ polyline.addEventListener("mouseover", function (e) {
1225
1230
  t.mouseOverGraphic(item.id, e);
1226
1231
  });
1227
- polyline.addEventListener('mouseout', function (e) {
1232
+ polyline.addEventListener("mouseout", function (e) {
1228
1233
  t.mouseOutGraphic(item.id, e);
1229
1234
  });
1230
1235
  //缓存图元的数据,便于后期操作
@@ -1236,9 +1241,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1236
1241
  paths: [pts],
1237
1242
  other: item
1238
1243
  }),
1239
- geometryType: 'polyline',
1244
+ geometryType: "polyline",
1240
1245
  geometry: {
1241
- type: 'polyline',
1246
+ type: "polyline",
1242
1247
  paths: [pts]
1243
1248
  }
1244
1249
  });
@@ -1246,7 +1251,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1246
1251
  //state中缓存 line的id...用于数据判断
1247
1252
  t.state.lineIds.push(item.id);
1248
1253
  });
1249
- if (type !== 'defined') {
1254
+ if (type !== "defined") {
1250
1255
  t.state.lineIds = lsids;
1251
1256
  // t.setState({
1252
1257
  // lineIds: lsids
@@ -1304,9 +1309,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1304
1309
  paths: [pts],
1305
1310
  other: item
1306
1311
  }),
1307
- geometryType: 'polyline',
1312
+ geometryType: "polyline",
1308
1313
  geometry: {
1309
- type: 'polyline',
1314
+ type: "polyline",
1310
1315
  paths: [pts]
1311
1316
  }
1312
1317
  });
@@ -1326,11 +1331,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1326
1331
  //遍历添加面(图元)
1327
1332
  mapPolygons.map(function (item, index) {
1328
1333
  var cg = {
1329
- lineType: 'solid',
1334
+ lineType: "solid",
1330
1335
  lineWidth: 5,
1331
- lineColor: '#277ffa',
1336
+ lineColor: "#277ffa",
1332
1337
  lineOpacity: 1,
1333
- color: '#fff',
1338
+ color: "#fff",
1334
1339
  pellucidity: 0.5
1335
1340
  // isHidden: false //后期跟百度一起加
1336
1341
  };
@@ -1362,14 +1367,14 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1362
1367
  var polygon = new T.Polygon(r, polygonOption);
1363
1368
  _this7.state.gis.addOverLay(polygon);
1364
1369
  //添加点击事件
1365
- polygon.on('click', function (e) {
1370
+ polygon.on("click", function (e) {
1366
1371
  t.isNotClickMap = true;
1367
1372
  t.clickGraphic(item.id, e);
1368
1373
  });
1369
- polygon.on('mouseover', function (e) {
1374
+ polygon.on("mouseover", function (e) {
1370
1375
  t.mouseOverGraphic(item.id, e);
1371
1376
  });
1372
- polygon.on('mouseout', function (e) {
1377
+ polygon.on("mouseout", function (e) {
1373
1378
  t.mouseOutGraphic(item.id, e);
1374
1379
  });
1375
1380
  //缓存图元的数据,便于后期操作
@@ -1381,9 +1386,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1381
1386
  rings: pts,
1382
1387
  other: item
1383
1388
  }),
1384
- geometryType: 'polygon',
1389
+ geometryType: "polygon",
1385
1390
  geometry: {
1386
- type: 'polygon',
1391
+ type: "polygon",
1387
1392
  rings: pts
1388
1393
  }
1389
1394
  });
@@ -1441,9 +1446,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1441
1446
  rings: pts,
1442
1447
  other: item
1443
1448
  }),
1444
- geometryType: 'polygon',
1449
+ geometryType: "polygon",
1445
1450
  geometry: {
1446
- type: 'polygon',
1451
+ type: "polygon",
1447
1452
  rings: pts
1448
1453
  }
1449
1454
  });
@@ -1462,11 +1467,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1462
1467
  var ccsids = _toConsumableArray(t.state.circleIds);
1463
1468
  mapCircles.map(function (item, index) {
1464
1469
  var cg = {
1465
- lineType: 'solid',
1470
+ lineType: "solid",
1466
1471
  lineWidth: 5,
1467
- lineColor: '#277ffa',
1472
+ lineColor: "#277ffa",
1468
1473
  lineOpacity: 1,
1469
- color: '#fff',
1474
+ color: "#fff",
1470
1475
  pellucidity: 0.5
1471
1476
  // isHidden: false //后期跟百度一起加
1472
1477
  };
@@ -1496,14 +1501,14 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1496
1501
  var circle = new T.Circle(new T.LngLat(item.longitude, item.latitude), item.radius, circleOption);
1497
1502
  _this9.state.gis.addOverLay(circle);
1498
1503
  //添加点击事件
1499
- circle.on('click', function (e) {
1504
+ circle.on("click", function (e) {
1500
1505
  t.isNotClickMap = true;
1501
1506
  t.clickGraphic(item.id, e);
1502
1507
  });
1503
- circle.on('mouseover', function (e) {
1508
+ circle.on("mouseover", function (e) {
1504
1509
  t.mouseOverGraphic(item.id, e);
1505
1510
  });
1506
- circle.on('mouseout', function (e) {
1511
+ circle.on("mouseout", function (e) {
1507
1512
  t.mouseOutGraphic(item.id, e);
1508
1513
  });
1509
1514
  //缓存图元的数据,便于后期操作
@@ -1511,9 +1516,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1511
1516
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1512
1517
  other: item
1513
1518
  }),
1514
- geometryType: 'circle',
1519
+ geometryType: "circle",
1515
1520
  geometry: {
1516
- type: 'circle',
1521
+ type: "circle",
1517
1522
  x: item.longitude,
1518
1523
  y: item.latitude,
1519
1524
  radius: item.radius
@@ -1530,18 +1535,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1530
1535
  }, {
1531
1536
  key: "updateCircle",
1532
1537
  value: function updateCircle(mapCircles) {
1533
- var _this0 = this;
1538
+ var _this10 = this;
1534
1539
  var t = this;
1535
1540
  mapCircles.map(function (item, index) {
1536
1541
  //判断图元是否存在.
1537
- if (_this0.GM.isRepetition(item.id)) {
1542
+ if (_this10.GM.isRepetition(item.id)) {
1538
1543
  //圆 点位数据不符合,直接跳过
1539
1544
  if (!item.longitude || !item.latitude) {
1540
1545
  console.warn("\u5706 \u7ECF\u7EAC\u5EA6 \u6570\u636E\u9519\u8BEF");
1541
1546
  return false;
1542
1547
  }
1543
1548
  //获取原有的图元
1544
- var gc = _this0.GM.getGraphic(item.id);
1549
+ var gc = _this10.GM.getGraphic(item.id);
1545
1550
  //获取原有的面属性,转换key值
1546
1551
  var cg = {
1547
1552
  lineType: gc.getLineStyle(),
@@ -1565,13 +1570,13 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1565
1570
  gc.setCenter(new T.LngLat(item.longitude, item.latitude));
1566
1571
 
1567
1572
  //缓存图元的数据,便于后期操作
1568
- _this0.GM.setGraphicParam(item.id, {
1573
+ _this10.GM.setGraphicParam(item.id, {
1569
1574
  attributes: _objectSpread(_objectSpread({}, item), {}, {
1570
1575
  other: item
1571
1576
  }),
1572
- geometryType: 'circle',
1577
+ geometryType: "circle",
1573
1578
  geometry: {
1574
- type: 'circle',
1579
+ type: "circle",
1575
1580
  x: item.longitude,
1576
1581
  y: item.latitude,
1577
1582
  radius: item.radius
@@ -1724,7 +1729,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1724
1729
  if (d.config) {
1725
1730
  cg = _objectSpread(_objectSpread({}, cg), d.config);
1726
1731
  }
1727
- var sContent = document.createElement('div');
1732
+ var sContent = document.createElement("div");
1728
1733
  var infowindow = new T.InfoWindow();
1729
1734
  infowindow.setMinWidth(cg.width);
1730
1735
  infowindow.setMaxHeight(cg.height);
@@ -1753,7 +1758,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1753
1758
  if (t.popupWindow) {
1754
1759
  t.hideInfoWindow();
1755
1760
  }
1756
- var sContent = document.createElement('div');
1761
+ var sContent = document.createElement("div");
1757
1762
  t.popupWindow = new T.InfoWindow();
1758
1763
  t.popupWindow.setMinWidth(width);
1759
1764
  t.popupWindow.setMaxHeight(height);
@@ -1770,19 +1775,19 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1770
1775
  }
1771
1776
  t.popupWindow = null;
1772
1777
  }
1773
- /*
1774
- 参数
1775
- geometryType:point/polyline/polygon/circle/rectangle 默认point
1776
- parameter 样式 默认null 对象{}写入方式跟add方法一样(对应点线圆面)
1777
- data //初始化数据 默认{id:'add'}
1778
- */
1778
+ /*
1779
+ 参数
1780
+ geometryType:point/polyline/polygon/circle/rectangle 默认point
1781
+ parameter 样式 默认null 对象{}写入方式跟add方法一样(对应点线圆面)
1782
+ data //初始化数据 默认{id:'add'}
1783
+ */
1779
1784
  }, {
1780
1785
  key: "draw",
1781
1786
  value: function draw(obj) {
1782
1787
  var t = this,
1783
1788
  drawParam = {};
1784
1789
  //初始化参数
1785
- drawParam.geometryType = obj.geometryType || 'point';
1790
+ drawParam.geometryType = obj.geometryType || "point";
1786
1791
  drawParam.parameter = obj.parameter ? _objectSpread({}, obj.parameter) : {};
1787
1792
  drawParam.data = obj.data ? _objectSpread({}, obj.data) : {};
1788
1793
  drawParam.data.id = (obj.data || {}).id || "draw".concat(new Date().getTime());
@@ -1791,19 +1796,19 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1791
1796
  if (len > -1) {
1792
1797
  //如果id存在 删除存在的图元,清除drawId中的id数据
1793
1798
  switch (drawParam.geometryType) {
1794
- case 'point':
1799
+ case "point":
1795
1800
  this.markerTool.clear();
1796
1801
  break;
1797
- case 'polyline':
1802
+ case "polyline":
1798
1803
  this.polylineTool.clear();
1799
1804
  break;
1800
- case 'polygon':
1805
+ case "polygon":
1801
1806
  this.polygonTool.clear();
1802
1807
  break;
1803
- case 'circle':
1808
+ case "circle":
1804
1809
  this.circleTool.clear();
1805
1810
  break;
1806
- case 'rectangle':
1811
+ case "rectangle":
1807
1812
  this.rectangleTool.clear();
1808
1813
  break;
1809
1814
  }
@@ -1812,7 +1817,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1812
1817
  var param = {};
1813
1818
  var paramgcr = {};
1814
1819
  window.map = this.state.gis;
1815
- if (drawParam.geometryType == 'polygon' || drawParam.geometryType == 'circle' || drawParam.geometryType == 'rectangle') {
1820
+ if (drawParam.geometryType == "polygon" || drawParam.geometryType == "circle" || drawParam.geometryType == "rectangle") {
1816
1821
  paramgcr.fillColor = drawParam.parameter.color;
1817
1822
  paramgcr.color = drawParam.parameter.lineColor;
1818
1823
  paramgcr.opacity = drawParam.parameter.lineOpacity;
@@ -1834,9 +1839,9 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1834
1839
  };
1835
1840
  }
1836
1841
  switch (drawParam.geometryType) {
1837
- case 'point':
1842
+ case "point":
1838
1843
  param.icon = new T.Icon({
1839
- iconUrl: drawParam.parameter.url || "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"),
1844
+ iconUrl: drawParam.parameter.url || "".concat(_default2.default.mapServerURL, "/images/defaultMarker.png"),
1840
1845
  iconSize: new T.Point(drawParam.parameter.width || 33, drawParam.parameter.height || 33),
1841
1846
  iconAnchor: new T.Point(drawParam.parameter.width ? drawParam.parameter.width / 2 : 16.5, drawParam.parameter.height ? drawParam.parameter.height : 33)
1842
1847
  });
@@ -1844,7 +1849,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1844
1849
  if (this.markerTool) this.markerTool.close();
1845
1850
  this.markerTool = new T.MarkTool(this.state.gis, param);
1846
1851
  this.markerTool.open();
1847
- this.markerTool.addEventListener('mouseup', function (ob) {
1852
+ this.markerTool.addEventListener("mouseup", function (ob) {
1848
1853
  var type = ob.type,
1849
1854
  target = ob.target,
1850
1855
  currentLnglat = ob.currentLnglat,
@@ -1862,38 +1867,38 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1862
1867
  }
1863
1868
  },
1864
1869
  geometry: {
1865
- type: 'point',
1870
+ type: "point",
1866
1871
  x: currentLnglat.lng,
1867
1872
  y: currentLnglat.lat
1868
1873
  },
1869
- geometryType: 'point',
1874
+ geometryType: "point",
1870
1875
  mapLayer: currentMarker
1871
1876
  };
1872
1877
  //添加点击事件
1873
- currentMarker.on('click', function (e) {
1878
+ currentMarker.on("click", function (e) {
1874
1879
  t.isNotClickMap = true;
1875
1880
  t.clickGraphic(drawParam.data.id, e);
1876
1881
  });
1877
- currentMarker.on('mouseover', function (e) {
1882
+ currentMarker.on("mouseover", function (e) {
1878
1883
  t.mouseOverGraphic(drawParam.data.id, e);
1879
1884
  });
1880
- currentMarker.on('mouseout', function (e) {
1885
+ currentMarker.on("mouseout", function (e) {
1881
1886
  t.mouseOutGraphic(drawParam.data.id, e);
1882
1887
  });
1883
1888
  t.GM.setGraphicParam(drawParam.data.id, backobj);
1884
- if ('drawEnd' in t.props) {
1889
+ if ("drawEnd" in t.props) {
1885
1890
  t.props.drawEnd(backobj);
1886
1891
  }
1887
1892
  });
1888
1893
  break;
1889
- case 'polyline':
1894
+ case "polyline":
1890
1895
  param.color = drawParam.parameter.color;
1891
1896
  param.opacity = drawParam.parameter.pellucidity;
1892
1897
  param.weight = drawParam.parameter.lineWidth;
1893
1898
  if (this.polylineTool) this.polylineTool.close();
1894
1899
  this.polylineTool = new T.PolylineTool(this.state.gis, param);
1895
1900
  this.polylineTool.open();
1896
- this.polylineTool.addEventListener('draw', function (ob) {
1901
+ this.polylineTool.addEventListener("draw", function (ob) {
1897
1902
  var type = ob.type,
1898
1903
  target = ob.target,
1899
1904
  currentLnglats = ob.currentLnglats,
@@ -1908,7 +1913,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1908
1913
  });
1909
1914
  t.GM.setGraphic(drawParam.data.id, currentPolyline);
1910
1915
  var backobj = {
1911
- geometryType: 'polyline',
1916
+ geometryType: "polyline",
1912
1917
  distance: currentDistance,
1913
1918
  id: drawParam.data.id,
1914
1919
  attributes: {
@@ -1921,34 +1926,34 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1921
1926
  },
1922
1927
  mapLayer: currentPolyline,
1923
1928
  geometry: {
1924
- type: 'polyline',
1929
+ type: "polyline",
1925
1930
  lnglatAry: lnglatAry,
1926
1931
  paths: (0, _MapToolFunction.getMaxMin)(currentLnglats).path
1927
1932
  },
1928
1933
  lnglatAry: lnglatAry
1929
1934
  };
1930
1935
  //添加点击事件
1931
- currentPolyline.on('click', function (e) {
1936
+ currentPolyline.on("click", function (e) {
1932
1937
  t.isNotClickMap = true;
1933
1938
  t.clickGraphic(drawParam.data.id, e);
1934
1939
  });
1935
- currentPolyline.on('mouseover', function (e) {
1940
+ currentPolyline.on("mouseover", function (e) {
1936
1941
  t.mouseOverGraphic(drawParam.data.id, e);
1937
1942
  });
1938
- currentPolyline.on('mouseout', function (e) {
1943
+ currentPolyline.on("mouseout", function (e) {
1939
1944
  t.mouseOutGraphic(drawParam.data.id, e);
1940
1945
  });
1941
1946
  t.GM.setGraphicParam(drawParam.data.id, backobj);
1942
- if ('drawEnd' in t.props) {
1947
+ if ("drawEnd" in t.props) {
1943
1948
  t.props.drawEnd(backobj);
1944
1949
  }
1945
1950
  });
1946
1951
  break;
1947
- case 'polygon':
1952
+ case "polygon":
1948
1953
  if (this.polygonTool) this.polygonTool.close();
1949
1954
  this.polygonTool = new T.PolygonTool(this.state.gis, paramgcr);
1950
1955
  this.polygonTool.open();
1951
- this.polygonTool.addEventListener('draw', function (ob) {
1956
+ this.polygonTool.addEventListener("draw", function (ob) {
1952
1957
  var _t$frameSelectProps$b;
1953
1958
  var type = ob.type,
1954
1959
  target = ob.target,
@@ -1964,7 +1969,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1964
1969
  };
1965
1970
  });
1966
1971
  var backobj = {
1967
- geometryType: 'polygon',
1972
+ geometryType: "polygon",
1968
1973
  id: drawParam.data.id,
1969
1974
  attributes: {
1970
1975
  id: drawParam.data.id,
@@ -1978,7 +1983,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1978
1983
  },
1979
1984
  mapLayer: currentPolygon,
1980
1985
  geometry: {
1981
- type: 'polygon',
1986
+ type: "polygon",
1982
1987
  lnglatAry: lnglatAry,
1983
1988
  rings: (0, _MapToolFunction.getMaxMin)(currentLnglats).path,
1984
1989
  _extent: (0, _MapToolFunction.getMaxMin)(currentLnglats)._extent,
@@ -1988,18 +1993,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
1988
1993
  area: currentArea
1989
1994
  };
1990
1995
  //添加点击事件
1991
- currentPolygon.on('click', function (e) {
1996
+ currentPolygon.on("click", function (e) {
1992
1997
  t.isNotClickMap = true;
1993
1998
  t.clickGraphic(drawParam.data.id, e);
1994
1999
  });
1995
- currentPolygon.on('mouseover', function (e) {
2000
+ currentPolygon.on("mouseover", function (e) {
1996
2001
  t.mouseOverGraphic(drawParam.data.id, e);
1997
2002
  });
1998
- currentPolygon.on('mouseout', function (e) {
2003
+ currentPolygon.on("mouseout", function (e) {
1999
2004
  t.mouseOutGraphic(drawParam.data.id, e);
2000
2005
  });
2001
2006
  t.GM.setGraphicParam(drawParam.data.id, backobj);
2002
- if ('drawEnd' in t.props) {
2007
+ if ("drawEnd" in t.props) {
2003
2008
  t.props.drawEnd(backobj);
2004
2009
  }
2005
2010
  if (((_t$frameSelectProps$b = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b === void 0 ? void 0 : _t$frameSelectProps$b.callback) instanceof Function) {
@@ -2007,11 +2012,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2007
2012
  }
2008
2013
  });
2009
2014
  break;
2010
- case 'circle':
2015
+ case "circle":
2011
2016
  if (this.circleTool) this.circleTool.close();
2012
2017
  this.circleTool = new T.CircleTool(this.state.gis, paramgcr);
2013
2018
  this.circleTool.open();
2014
- this.circleTool.addEventListener('drawend', function (ob) {
2019
+ this.circleTool.addEventListener("drawend", function (ob) {
2015
2020
  var _t$frameSelectProps$b2;
2016
2021
  var type = ob.type,
2017
2022
  target = ob.target,
@@ -2022,7 +2027,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2022
2027
  t.GM.setGraphic(drawParam.data.id, currentCircle);
2023
2028
  var area = Math.PI * Math.pow(currentRadius, 2);
2024
2029
  var backobj = {
2025
- geometryType: 'circle',
2030
+ geometryType: "circle",
2026
2031
  id: drawParam.data.id,
2027
2032
  attributes: {
2028
2033
  id: drawParam.data.id,
@@ -2036,7 +2041,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2036
2041
  },
2037
2042
  mapLayer: currentCircle,
2038
2043
  geometry: {
2039
- type: 'circle',
2044
+ type: "circle",
2040
2045
  x: currentCenter.lng,
2041
2046
  y: currentCenter.lat,
2042
2047
  radius: currentRadius,
@@ -2045,18 +2050,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2045
2050
  area: area
2046
2051
  };
2047
2052
  //添加点击事件
2048
- currentCircle.on('click', function (e) {
2053
+ currentCircle.on("click", function (e) {
2049
2054
  t.isNotClickMap = true;
2050
2055
  t.clickGraphic(drawParam.data.id, e);
2051
2056
  });
2052
- currentCircle.on('mouseover', function (e) {
2057
+ currentCircle.on("mouseover", function (e) {
2053
2058
  t.mouseOverGraphic(drawParam.data.id, e);
2054
2059
  });
2055
- currentCircle.on('mouseout', function (e) {
2060
+ currentCircle.on("mouseout", function (e) {
2056
2061
  t.mouseOutGraphic(drawParam.data.id, e);
2057
2062
  });
2058
2063
  t.GM.setGraphicParam(drawParam.data.id, backobj);
2059
- if ('drawEnd' in t.props) {
2064
+ if ("drawEnd" in t.props) {
2060
2065
  t.props.drawEnd(backobj);
2061
2066
  }
2062
2067
  if (((_t$frameSelectProps$b2 = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b2 === void 0 ? void 0 : _t$frameSelectProps$b2.callback) instanceof Function) {
@@ -2064,11 +2069,11 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2064
2069
  }
2065
2070
  });
2066
2071
  break;
2067
- case 'rectangle':
2072
+ case "rectangle":
2068
2073
  if (this.rectangleTool) this.rectangleTool.close();
2069
2074
  this.rectangleTool = new T.RectangleTool(this.state.gis, paramgcr);
2070
2075
  this.rectangleTool.open();
2071
- this.rectangleTool.addEventListener('draw', function (ob) {
2076
+ this.rectangleTool.addEventListener("draw", function (ob) {
2072
2077
  var _t$frameSelectProps$b3;
2073
2078
  var type = ob.type,
2074
2079
  target = ob.target,
@@ -2091,7 +2096,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2091
2096
  });
2092
2097
  var area = currentBounds.getNorthEast().distanceTo(new T.LngLat(currentBounds.getNorthEast().lng, currentBounds.getSouthWest().lat)) * currentBounds.getNorthEast().distanceTo(new T.LngLat(currentBounds.getSouthWest().lng, currentBounds.getNorthEast().lat));
2093
2098
  var backobj = {
2094
- geometryType: 'polygon',
2099
+ geometryType: "polygon",
2095
2100
  id: drawParam.data.id,
2096
2101
  attributes: {
2097
2102
  id: drawParam.data.id,
@@ -2105,7 +2110,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2105
2110
  },
2106
2111
  mapLayer: currentRectangle,
2107
2112
  geometry: {
2108
- type: 'polygon',
2113
+ type: "polygon",
2109
2114
  lnglatAry: lnglatAry,
2110
2115
  rings: (0, _MapToolFunction.getMaxMin)(currentLnglats).path,
2111
2116
  _extent: (0, _MapToolFunction.getMaxMin)(currentLnglats)._extent,
@@ -2115,18 +2120,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2115
2120
  area: area
2116
2121
  };
2117
2122
  //添加点击事件
2118
- currentRectangle.on('click', function (e) {
2123
+ currentRectangle.on("click", function (e) {
2119
2124
  t.isNotClickMap = true;
2120
2125
  t.clickGraphic(drawParam.data.id, e);
2121
2126
  });
2122
- currentRectangle.on('mouseover', function (e) {
2127
+ currentRectangle.on("mouseover", function (e) {
2123
2128
  t.mouseOverGraphic(drawParam.data.id, e);
2124
2129
  });
2125
- currentRectangle.on('mouseout', function (e) {
2130
+ currentRectangle.on("mouseout", function (e) {
2126
2131
  t.mouseOutGraphic(drawParam.data.id, e);
2127
2132
  });
2128
2133
  t.GM.setGraphicParam(drawParam.data.id, backobj);
2129
- if ('drawEnd' in t.props) {
2134
+ if ("drawEnd" in t.props) {
2130
2135
  t.props.drawEnd(backobj);
2131
2136
  }
2132
2137
  if (((_t$frameSelectProps$b3 = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b3 === void 0 ? void 0 : _t$frameSelectProps$b3.callback) instanceof Function) {
@@ -2176,17 +2181,17 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2176
2181
  }
2177
2182
  this.isEditId = id;
2178
2183
  switch (ms.geometryType) {
2179
- case 'point':
2184
+ case "point":
2180
2185
  ms.mapLayer.enableDragging();
2181
2186
  // ms.mapLayer.addEventListener('dragend',t.editGraphicChange);
2182
2187
  if (ms.mapLayer.label) {
2183
- ms.mapLayer.addEventListener('drag', t.showLabel);
2188
+ ms.mapLayer.addEventListener("drag", t.showLabel);
2184
2189
  }
2185
2190
  break;
2186
- case 'polyline':
2187
- case 'polygon':
2188
- case 'rectangle':
2189
- case 'circle':
2191
+ case "polyline":
2192
+ case "polygon":
2193
+ case "rectangle":
2194
+ case "circle":
2190
2195
  ms.mapLayer.enableEdit();
2191
2196
  break;
2192
2197
  }
@@ -2202,17 +2207,17 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2202
2207
  var ms = t.getGraphic(t.state.editId);
2203
2208
  this.isEditId = null;
2204
2209
  switch (ms.geometryType) {
2205
- case 'point':
2210
+ case "point":
2206
2211
  ms.mapLayer.disableDragging();
2207
2212
  // ms.mapLayer.removeEventListener('dragend',t.editGraphicChange);
2208
2213
  if (ms.mapLayer.label) {
2209
- ms.mapLayer.removeEventListener('drag', t.showLabel);
2214
+ ms.mapLayer.removeEventListener("drag", t.showLabel);
2210
2215
  }
2211
2216
  break;
2212
- case 'polyline':
2213
- case 'polygon':
2214
- case 'rectangle':
2215
- case 'circle':
2217
+ case "polyline":
2218
+ case "polygon":
2219
+ case "rectangle":
2220
+ case "circle":
2216
2221
  ms.mapLayer.disableEdit();
2217
2222
  break;
2218
2223
  }
@@ -2222,8 +2227,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2222
2227
  t.lastGraphic = JSON.stringify(ms.geometry);
2223
2228
  }
2224
2229
  t.setState({
2225
- editId: '',
2226
- editGraphic: ''
2230
+ editId: "",
2231
+ editGraphic: ""
2227
2232
  });
2228
2233
  }
2229
2234
  }, {
@@ -2243,18 +2248,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2243
2248
  id: id
2244
2249
  };
2245
2250
  switch (ms.geometryType) {
2246
- case 'point':
2251
+ case "point":
2247
2252
  obj.geometry = ms.geometry;
2248
2253
  obj.param = ms;
2249
2254
  break;
2250
- case 'polyline':
2255
+ case "polyline":
2251
2256
  ms.geometry._extent = (0, _MapToolFunction.getMaxMin)(ms.mapLayer.getLngLats())._extent;
2252
2257
  obj.geometry = ms.geometry;
2253
2258
  obj.param = ms;
2254
2259
  obj.distance = t.calculateDistance(ms.mapLayer.getLngLats());
2255
2260
  break;
2256
- case 'polygon':
2257
- case 'rectangle':
2261
+ case "polygon":
2262
+ case "rectangle":
2258
2263
  ms.geometry._extent = (0, _MapToolFunction.getMaxMin)(ms.mapLayer.getLngLats()[0])._extent;
2259
2264
  obj.geometry = ms.geometry;
2260
2265
  obj.param = ms;
@@ -2262,7 +2267,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2262
2267
  // obj.area = t.polygonTool.getArea(ms.mapLayer.getLngLats()[0]);
2263
2268
  // 关闭多边形多个听绘制后,回显报错
2264
2269
  break;
2265
- case 'circle':
2270
+ case "circle":
2266
2271
  obj.geometry = ms.geometry;
2267
2272
  obj.param = ms;
2268
2273
  obj.area = Math.PI * Math.pow(ms.geometry.radius, 2);
@@ -2283,7 +2288,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2283
2288
  //清除地图中图元
2284
2289
  this.state.gis.removeOverLay(this.GM.getGraphic(id));
2285
2290
  //删除含 label点的label(天地图的坑)
2286
- if (type === 'point' && this.GM.getGraphic(id).label) {
2291
+ if (type === "point" && this.GM.getGraphic(id).label) {
2287
2292
  this.state.gis.removeOverLay(this.GM.getGraphic(id).getLabel());
2288
2293
  }
2289
2294
  //清除对应id的图元数据缓存
@@ -2301,19 +2306,19 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2301
2306
  //清除 state中id的缓存
2302
2307
  var ids = [];
2303
2308
  switch (type) {
2304
- case 'point':
2309
+ case "point":
2305
2310
  ids = t.state.pointIds;
2306
2311
  break;
2307
- case 'line':
2312
+ case "line":
2308
2313
  ids = t.state.lineIds;
2309
2314
  break;
2310
- case 'polygon':
2315
+ case "polygon":
2311
2316
  ids = t.state.polygonIds;
2312
2317
  break;
2313
- case 'circle':
2318
+ case "circle":
2314
2319
  ids = t.state.circleIds;
2315
2320
  break;
2316
- case 'draw':
2321
+ case "draw":
2317
2322
  if (t.state.drawIds.point.indexOf(id) > -1) {
2318
2323
  t.state.drawIds.point.splice(t.state.drawIds.point.indexOf(id), 1);
2319
2324
  }
@@ -2346,7 +2351,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2346
2351
  break;
2347
2352
  }
2348
2353
  if (id == t.state.editId) {
2349
- t.state.editId = '';
2354
+ t.state.editId = "";
2350
2355
  }
2351
2356
  if (ids.indexOf(id) != -1) {
2352
2357
  ids.splice(ids.indexOf(id), 1);
@@ -2380,7 +2385,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2380
2385
  key: "mouseOverGraphic",
2381
2386
  value: function mouseOverGraphic(id, e) {
2382
2387
  var t = this;
2383
- if (typeof t.props.mouseOverGraphic === 'function') {
2388
+ if (typeof t.props.mouseOverGraphic === "function") {
2384
2389
  if (id === t.isEditId) {
2385
2390
  return false;
2386
2391
  }
@@ -2421,7 +2426,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2421
2426
  value: function dragMapStart() {
2422
2427
  var t = this;
2423
2428
  if (typeof t.props.dragMapStart === "function") {
2424
- t.state.gis.addEventListener('dragstart', function (e) {
2429
+ t.state.gis.addEventListener("dragstart", function (e) {
2425
2430
  var obj = t.getMapExtent();
2426
2431
  obj.e = e;
2427
2432
  //处理下数据,符合拖拽事件
@@ -2435,7 +2440,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2435
2440
  value: function dragMapEnd() {
2436
2441
  var t = this;
2437
2442
  if (typeof t.props.dragMapEnd === "function") {
2438
- t.state.gis.addEventListener('dragend', function (e) {
2443
+ t.state.gis.addEventListener("dragend", function (e) {
2439
2444
  var obj = t.getMapExtent();
2440
2445
  obj.e = e;
2441
2446
  //处理下数据,符合拖拽事件
@@ -2449,7 +2454,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2449
2454
  value: function moveStart() {
2450
2455
  var t = this;
2451
2456
  if (typeof t.props.moveStart === "function") {
2452
- t.state.gis.addEventListener('movestart', function (e) {
2457
+ t.state.gis.addEventListener("movestart", function (e) {
2453
2458
  if (!t.isZoom) {
2454
2459
  var obj = t.getMapExtent();
2455
2460
  obj.e = e;
@@ -2465,7 +2470,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2465
2470
  value: function moveEnd() {
2466
2471
  var t = this;
2467
2472
  if (typeof t.props.moveEnd === "function") {
2468
- t.state.gis.addEventListener('moveend', function (e) {
2473
+ t.state.gis.addEventListener("moveend", function (e) {
2469
2474
  var xylist = [],
2470
2475
  mapPane = t.state.gis.getPanes().mapPane;
2471
2476
  if (mapPane.style.top) {
@@ -2499,12 +2504,12 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2499
2504
  value: function zoomStart() {
2500
2505
  var t = this;
2501
2506
  if (typeof t.props.zoomStart === "function") {
2502
- t.state.gis.addEventListener('zoomstart', function (e) {
2507
+ t.state.gis.addEventListener("zoomstart", function (e) {
2503
2508
  if (t.heatmap && !t.isHideHeatMap) {
2504
2509
  t.heatmap.hide();
2505
2510
  }
2506
2511
  $("#".concat(t.pointCollectionId)).css({
2507
- display: 'none'
2512
+ display: "none"
2508
2513
  });
2509
2514
  t.isZoom = true;
2510
2515
  var obj = t.getMapExtent();
@@ -2519,7 +2524,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2519
2524
  value: function zoomEnd() {
2520
2525
  var t = this;
2521
2526
  if (typeof t.props.zoomEnd === "function") {
2522
- t.state.gis.addEventListener('zoomend', function (e) {
2527
+ t.state.gis.addEventListener("zoomend", function (e) {
2523
2528
  //重画热力图
2524
2529
  if (t.heatmap && !t.isHideHeatMap) {
2525
2530
  t.heatmap.show();
@@ -2527,14 +2532,14 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2527
2532
  }
2528
2533
  //重画海量点
2529
2534
  $("#".concat(t.pointCollectionId)).css({
2530
- display: 'inline-block'
2535
+ display: "inline-block"
2531
2536
  });
2532
2537
  if (t.morepoints.length > 0) {
2533
2538
  t.updatePointCollection(t.props.mapPointCollection);
2534
2539
  }
2535
2540
  //避免zoom切换后,chrome的旋转角度被替换
2536
2541
  for (var i in t.GM.allParam) {
2537
- if (t.GM.allParam[i].geometryType == 'point' && t.GM.allParam[i].deg) {
2542
+ if (t.GM.allParam[i].geometryType == "point" && t.GM.allParam[i].deg) {
2538
2543
  t.GM.getGraphic(i).getElement().style.transform = t.GM.getGraphic(i).getElement().style.transform + " rotate(".concat(t.GM.allParam[i].deg, "deg)");
2539
2544
  }
2540
2545
  }
@@ -2550,7 +2555,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2550
2555
  value: function clickMap() {
2551
2556
  var t = this;
2552
2557
  if (typeof t.props.clickMap === "function") {
2553
- t.state.gis.addEventListener('click', function (e) {
2558
+ t.state.gis.addEventListener("click", function (e) {
2554
2559
  if (t.isNotClickMap) {
2555
2560
  t.isNotClickMap = false;
2556
2561
  } else {
@@ -2602,15 +2607,15 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2602
2607
  }, {
2603
2608
  key: "moveAnimation",
2604
2609
  value: function moveAnimation() {
2605
- var _this1 = this;
2610
+ var _this11 = this;
2606
2611
  var t = this;
2607
2612
  if (t.moveToTimer) {
2608
2613
  clearInterval(t.moveToTimer);
2609
2614
  }
2610
2615
  t.moveToTimer = setInterval(function () {
2611
2616
  for (var i = 0; i < t.movePoints.length; i++) {
2612
- t.movePoints[i].waitTime += _this1.timer;
2613
- t.movePoints[i].deleteTime -= _this1.timer;
2617
+ t.movePoints[i].waitTime += _this11.timer;
2618
+ t.movePoints[i].deleteTime -= _this11.timer;
2614
2619
  }
2615
2620
  t.movePoints.sort(function (x, y) {
2616
2621
  return y.waitTime - x.waitTime;
@@ -2631,8 +2636,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2631
2636
  if (!gc) {
2632
2637
  clearInterval(t.moveToTimer[id]);
2633
2638
  } else {
2634
- var tx = oleLng + rx * ((totalTime - deleteTime) / _this1.timer),
2635
- ty = oldLat + ry * ((totalTime - deleteTime) / _this1.timer);
2639
+ var tx = oleLng + rx * ((totalTime - deleteTime) / _this11.timer),
2640
+ ty = oldLat + ry * ((totalTime - deleteTime) / _this11.timer);
2636
2641
  var lglt = new T.LngLat(tx, ty);
2637
2642
  if (t.movePoints[_i].url) {
2638
2643
  gc.getIcon().setIconUrl(t.movePoints[_i].url);
@@ -2643,7 +2648,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2643
2648
  }));
2644
2649
  //旋转角度
2645
2650
  gc.getElement().style.transform = gc.getElement().style.transform + " rotate(".concat(ddeg, "deg)");
2646
- gc.getElement().style['-ms-transform'] = " rotate(".concat(ddeg, "deg)");
2651
+ gc.getElement().style["-ms-transform"] = " rotate(".concat(ddeg, "deg)");
2647
2652
  if (gc.label) {
2648
2653
  gc.showLabel();
2649
2654
  }
@@ -2766,7 +2771,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2766
2771
  }, {
2767
2772
  key: "deepEqual",
2768
2773
  value: function deepEqual(a, b) {
2769
- return _immutable["default"].is(_immutable["default"].fromJS(a), _immutable["default"].fromJS(b));
2774
+ return _immutable.default.is(_immutable.default.fromJS(a), _immutable.default.fromJS(b));
2770
2775
  }
2771
2776
  //计算2点间距离 单位m 精确到个位
2772
2777
  }, {
@@ -2786,7 +2791,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2786
2791
  }
2787
2792
  for (var i = 0; i < ps.length; i++) {
2788
2793
  if (i < ps.length - 1) {
2789
- if ('distanceTo' in ps[i]) {
2794
+ if ("distanceTo" in ps[i]) {
2790
2795
  totalDistance += ps[i].distanceTo(ps[i + 1]);
2791
2796
  } else {
2792
2797
  totalDistance += new T.LngLat(ps[i][0], ps[i][1]).distanceTo(new T.LngLat(ps[i + 1][0], ps[i + 1][1]));
@@ -2877,19 +2882,18 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2877
2882
  onSearchComplete: function onSearchComplete(result) {
2878
2883
  if (!result.pois) {
2879
2884
  resolve([]);
2880
- ;
2881
2885
  } else {
2882
2886
  var list = result.pois.map(function (r) {
2883
2887
  var lnglat = {};
2884
2888
  if (r.lonlat.indexOf(",") > -1) {
2885
2889
  lnglat = {
2886
- longitude: r.lonlat.split(',')[0],
2887
- latitude: r.lonlat.split(',')[1]
2890
+ longitude: r.lonlat.split(",")[0],
2891
+ latitude: r.lonlat.split(",")[1]
2888
2892
  };
2889
2893
  } else {
2890
2894
  lnglat = {
2891
- longitude: r.lonlat.split(' ')[0],
2892
- latitude: r.lonlat.split(' ')[1]
2895
+ longitude: r.lonlat.split(" ")[0],
2896
+ latitude: r.lonlat.split(" ")[1]
2893
2897
  };
2894
2898
  }
2895
2899
  return _objectSpread(_objectSpread({
@@ -2900,7 +2904,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2900
2904
  labelContent: r.name,
2901
2905
  labelPixelY: 27
2902
2906
  },
2903
- other: 'search'
2907
+ other: "search"
2904
2908
  });
2905
2909
  });
2906
2910
  resolve(list);
@@ -2916,12 +2920,12 @@ var TMap = /*#__PURE__*/function (_React$Component) {
2916
2920
  key: "render",
2917
2921
  value: function render() {
2918
2922
  var t = this;
2919
- return /*#__PURE__*/_react["default"].createElement("div", {
2923
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2920
2924
  id: t.props.mapId,
2921
2925
  style: {
2922
- width: '100%',
2923
- height: '100%',
2924
- zIndex: '1'
2926
+ width: "100%",
2927
+ height: "100%",
2928
+ zIndex: "1"
2925
2929
  }
2926
2930
  });
2927
2931
  }
@@ -3020,7 +3024,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3020
3024
  }
3021
3025
  /*添加海量点*/
3022
3026
  if (mapPointCollection instanceof Array && t.props.mapPointCollection instanceof Array && !t.deepEqual(mapPointCollection, t.props.mapPointCollection)) {
3023
- var _t$dataMatch = t.dataMatch(t.props.mapPointCollection, mapPointCollection, 'id'),
3027
+ var _t$dataMatch = t.dataMatch(t.props.mapPointCollection, mapPointCollection, "id"),
3024
3028
  deletedDataIDs = _t$dataMatch.deletedDataIDs,
3025
3029
  addedData = _t$dataMatch.addedData,
3026
3030
  updatedData = _t$dataMatch.updatedData;
@@ -3028,15 +3032,15 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3028
3032
  t.addPointCollection(addedData);
3029
3033
  t.updatePointCollection(updatedData);
3030
3034
  }
3031
- if (typeof isclearAllPointCollection == 'boolean' && isclearAllPointCollection || isclearAllPointCollection && isclearAllPointCollection !== t.props.isclearAllPointCollection) {
3035
+ if (typeof isclearAllPointCollection == "boolean" && isclearAllPointCollection || isclearAllPointCollection && isclearAllPointCollection !== t.props.isclearAllPointCollection) {
3032
3036
  t.clearAllPointCollection();
3033
3037
  }
3034
3038
 
3035
- /*点数据处理
3036
- pointData[2]相同的点,执行刷新
3037
- pointData[1]的数据在idsForGraphicId中不存在的,执行新增
3038
- pointData[0]数据中多余的id,执行删除
3039
- */
3039
+ /*点数据处理
3040
+ pointData[2]相同的点,执行刷新
3041
+ pointData[1]的数据在idsForGraphicId中不存在的,执行新增
3042
+ pointData[0]数据中多余的id,执行删除
3043
+ */
3040
3044
  if (mapPoints instanceof Array && t.props.mapPoints instanceof Array && !t.deepEqual(mapPoints, t.props.mapPoints)) {
3041
3045
  var oldMapPoints = t.props.mapPoints;
3042
3046
  var newMapPoints = mapPoints;
@@ -3049,7 +3053,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3049
3053
  return item.id !== editGraphicId;
3050
3054
  });
3051
3055
  }
3052
- var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints, 'id'),
3056
+ var _t$dataMatch2 = t.dataMatch(oldMapPoints, newMapPoints, "id"),
3053
3057
  _deletedDataIDs = _t$dataMatch2.deletedDataIDs,
3054
3058
  _addedData = _t$dataMatch2.addedData,
3055
3059
  _updatedData = _t$dataMatch2.updatedData;
@@ -3065,7 +3069,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3065
3069
  try {
3066
3070
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
3067
3071
  var id = _step.value;
3068
- t.removeGraphic(id, 'point');
3072
+ t.removeGraphic(id, "point");
3069
3073
  }
3070
3074
  //增加
3071
3075
  } catch (err) {
@@ -3077,10 +3081,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3077
3081
  //更新
3078
3082
  t.updatePoint([].concat(_toConsumableArray(upds), _toConsumableArray(otherupds)));
3079
3083
  }
3080
- /*
3081
- 面数据处理
3082
- 先全删除,再新增
3083
- */
3084
+ /*
3085
+ 面数据处理
3086
+ 先全删除,再新增
3087
+ */
3084
3088
  if (mapPolygons instanceof Array && t.props.mapPolygons instanceof Array && !t.deepEqual(mapPolygons, t.props.mapPolygons)) {
3085
3089
  var oldMapPolygons = t.props.mapPolygons;
3086
3090
  var newMapPolygons = mapPolygons;
@@ -3092,7 +3096,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3092
3096
  return item.id !== editGraphicId;
3093
3097
  });
3094
3098
  }
3095
- var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons, 'id'),
3099
+ var _t$dataMatch3 = t.dataMatch(oldMapPolygons, newMapPolygons, "id"),
3096
3100
  _deletedDataIDs2 = _t$dataMatch3.deletedDataIDs,
3097
3101
  _addedData2 = _t$dataMatch3.addedData,
3098
3102
  _updatedData2 = _t$dataMatch3.updatedData;
@@ -3108,7 +3112,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3108
3112
  try {
3109
3113
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
3110
3114
  var _id = _step2.value;
3111
- t.removeGraphic(_id, 'polygon');
3115
+ t.removeGraphic(_id, "polygon");
3112
3116
  }
3113
3117
  //增加
3114
3118
  } catch (err) {
@@ -3120,10 +3124,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3120
3124
  //更新
3121
3125
  t.updatePolygon([].concat(_toConsumableArray(_upds), _toConsumableArray(_otherupds)));
3122
3126
  }
3123
- /*
3124
- 圆数据处理
3125
- 先全删除,再新增
3126
- */
3127
+ /*
3128
+ 圆数据处理
3129
+ 先全删除,再新增
3130
+ */
3127
3131
  if (mapCircles instanceof Array && t.props.mapCircles instanceof Array && !t.deepEqual(mapCircles, t.props.mapCircles)) {
3128
3132
  var oldMapCircles = t.props.mapCircles;
3129
3133
  var newMapCircles = mapCircles;
@@ -3135,7 +3139,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3135
3139
  return item.id !== editGraphicId;
3136
3140
  });
3137
3141
  }
3138
- var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles, 'id'),
3142
+ var _t$dataMatch4 = t.dataMatch(oldMapCircles, newMapCircles, "id"),
3139
3143
  _deletedDataIDs3 = _t$dataMatch4.deletedDataIDs,
3140
3144
  _addedData3 = _t$dataMatch4.addedData,
3141
3145
  _updatedData3 = _t$dataMatch4.updatedData;
@@ -3151,7 +3155,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3151
3155
  try {
3152
3156
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
3153
3157
  var _id2 = _step3.value;
3154
- t.removeGraphic(_id2, 'circle');
3158
+ t.removeGraphic(_id2, "circle");
3155
3159
  }
3156
3160
  //增加
3157
3161
  } catch (err) {
@@ -3163,10 +3167,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3163
3167
  //更新
3164
3168
  t.updateCircle([].concat(_toConsumableArray(_upds2), _toConsumableArray(_otherupds2)));
3165
3169
  }
3166
- /*
3167
- 线数据处理
3168
- 先全删除,再新增
3169
- */
3170
+ /*
3171
+ 线数据处理
3172
+ 先全删除,再新增
3173
+ */
3170
3174
  if (mapLines instanceof Array && t.props.mapLines instanceof Array && !t.deepEqual(mapLines, t.props.mapLines)) {
3171
3175
  var oldMapLines = t.props.mapLines;
3172
3176
  var newMapLines = mapLines;
@@ -3178,7 +3182,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3178
3182
  return item.id !== editGraphicId;
3179
3183
  });
3180
3184
  }
3181
- var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines, 'id'),
3185
+ var _t$dataMatch5 = t.dataMatch(oldMapLines, newMapLines, "id"),
3182
3186
  _deletedDataIDs4 = _t$dataMatch5.deletedDataIDs,
3183
3187
  _addedData4 = _t$dataMatch5.addedData,
3184
3188
  _updatedData4 = _t$dataMatch5.updatedData;
@@ -3194,7 +3198,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3194
3198
  try {
3195
3199
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
3196
3200
  var _id3 = _step4.value;
3197
- t.removeGraphic(_id3, 'line');
3201
+ t.removeGraphic(_id3, "line");
3198
3202
  }
3199
3203
  //增加
3200
3204
  } catch (err) {
@@ -3208,7 +3212,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3208
3212
  }
3209
3213
  //画其他特例线专用
3210
3214
  if (customizedBoundary instanceof Array && t.props.customizedBoundary instanceof Array && !t.deepEqual(customizedBoundary, t.props.customizedBoundary)) {
3211
- var _t$dataMatch6 = t.dataMatch(t.props.customizedBoundary, customizedBoundary, 'id'),
3215
+ var _t$dataMatch6 = t.dataMatch(t.props.customizedBoundary, customizedBoundary, "id"),
3212
3216
  _deletedDataIDs5 = _t$dataMatch6.deletedDataIDs,
3213
3217
  _addedData5 = _t$dataMatch6.addedData,
3214
3218
  _updatedData5 = _t$dataMatch6.updatedData;
@@ -3218,7 +3222,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3218
3222
  try {
3219
3223
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
3220
3224
  var _id4 = _step5.value;
3221
- t.removeGraphic(_id4, 'line');
3225
+ t.removeGraphic(_id4, "line");
3222
3226
  }
3223
3227
  } catch (err) {
3224
3228
  _iterator5.e(err);
@@ -3250,37 +3254,37 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3250
3254
  t.imageUrlOverlay(imageOverlays);
3251
3255
  }
3252
3256
  //图元编辑调用
3253
- if (typeof isDoEdit == 'boolean' && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
3257
+ if (typeof isDoEdit == "boolean" && isDoEdit || isDoEdit && isDoEdit !== t.props.isDoEdit) {
3254
3258
  t.doEdit(editGraphicId);
3255
3259
  }
3256
3260
  //是否关闭图元编辑
3257
- if (typeof isEndEdit == 'boolean' && isEndEdit || isEndEdit && isEndEdit !== t.props.isEndEdit) {
3261
+ if (typeof isEndEdit == "boolean" && isEndEdit || isEndEdit && isEndEdit !== t.props.isEndEdit) {
3258
3262
  t.endEdit();
3259
3263
  }
3260
3264
  /*设置指定图元展示*/
3261
- if (typeof setVisiblePoints == 'boolean' && setVisiblePoints || setVisiblePoints && setVisiblePoints !== t.props.setVisiblePoints) {
3265
+ if (typeof setVisiblePoints == "boolean" && setVisiblePoints || setVisiblePoints && setVisiblePoints !== t.props.setVisiblePoints) {
3262
3266
  t.setVisiblePoints(mapVisiblePoints);
3263
3267
  }
3264
3268
  //绘制图元
3265
- if (typeof isDraw == 'boolean' && isDraw || isDraw && isDraw !== t.props.isDraw) {
3269
+ if (typeof isDraw == "boolean" && isDraw || isDraw && isDraw !== t.props.isDraw) {
3266
3270
  t.draw(mapDraw);
3267
3271
  }
3268
3272
  //关闭绘制
3269
- if (typeof isCloseDraw == 'boolean' && isCloseDraw || isCloseDraw && isCloseDraw !== t.props.isCloseDraw) {
3273
+ if (typeof isCloseDraw == "boolean" && isCloseDraw || isCloseDraw && isCloseDraw !== t.props.isCloseDraw) {
3270
3274
  t.closeDraw();
3271
3275
  }
3272
3276
  //清空地图
3273
- if (typeof isClearAll == 'boolean' && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
3277
+ if (typeof isClearAll == "boolean" && isClearAll || isClearAll && isClearAll !== t.props.isClearAll) {
3274
3278
  t.clearAll();
3275
3279
  }
3276
3280
  //设置中心点
3277
- if (typeof setCenter == 'boolean' && setCenter || setCenter && setCenter !== t.props.setCenter) {
3281
+ if (typeof setCenter == "boolean" && setCenter || setCenter && setCenter !== t.props.setCenter) {
3278
3282
  if (!(t.getCurrentCenter().lng == mapCenter[0] && t.getCurrentCenter().lat == mapCenter[1])) {
3279
3283
  t.setCenter(mapCenter);
3280
3284
  }
3281
3285
  }
3282
3286
  //设置比例尺
3283
- if (typeof setZoomLevel == 'boolean' && setZoomLevel || setZoomLevel && setZoomLevel !== t.props.setZoomLevel) {
3287
+ if (typeof setZoomLevel == "boolean" && setZoomLevel || setZoomLevel && setZoomLevel !== t.props.setZoomLevel) {
3284
3288
  if (!(t.getZoomLevel() == mapZoomLevel)) {
3285
3289
  t.setZoomLevel(mapZoomLevel);
3286
3290
  }
@@ -3292,7 +3296,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3292
3296
  // t.hideTrafficInfo();
3293
3297
  // }
3294
3298
  //设置点聚合
3295
- if (typeof setCluster == 'boolean' && setCluster || setCluster && setCluster !== t.props.setCluster) {
3299
+ if (typeof setCluster == "boolean" && setCluster || setCluster && setCluster !== t.props.setCluster) {
3296
3300
  t.cluster(mapCluster);
3297
3301
  }
3298
3302
  // 清除聚合
@@ -3300,21 +3304,21 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3300
3304
  t.removeCluster(mapCluster);
3301
3305
  }
3302
3306
  //测距工具调用
3303
- if (typeof isRangingTool == 'boolean' && isRangingTool || isRangingTool && isRangingTool !== t.props.isRangingTool) {
3307
+ if (typeof isRangingTool == "boolean" && isRangingTool || isRangingTool && isRangingTool !== t.props.isRangingTool) {
3304
3308
  t.vtxRangingTool();
3305
3309
  }
3306
3310
  //单独删除操作
3307
- if (typeof isRemove == 'boolean' && isRemove || isRemove && isRemove !== t.props.isRemove) {
3311
+ if (typeof isRemove == "boolean" && isRemove || isRemove && isRemove !== t.props.isRemove) {
3308
3312
  mapRemove.map(function (item, index) {
3309
3313
  t.removeGraphic(item.id, item.type);
3310
3314
  });
3311
3315
  }
3312
3316
  //设置区域限制
3313
- if (typeof isSetAreaRestriction == 'boolean' && isSetAreaRestriction || isSetAreaRestriction && isSetAreaRestriction !== t.props.isSetAreaRestriction && areaRestriction && !!areaRestriction[0] && !!areaRestriction[1]) {
3317
+ if (typeof isSetAreaRestriction == "boolean" && isSetAreaRestriction || isSetAreaRestriction && isSetAreaRestriction !== t.props.isSetAreaRestriction && areaRestriction && !!areaRestriction[0] && !!areaRestriction[1]) {
3314
3318
  t.setAreaRestriction(areaRestriction);
3315
3319
  }
3316
3320
  //关闭区域限制
3317
- if (typeof isClearAreaRestriction == 'boolean' && isClearAreaRestriction || isClearAreaRestriction && isClearAreaRestriction !== t.props.isClearAreaRestriction) {
3321
+ if (typeof isClearAreaRestriction == "boolean" && isClearAreaRestriction || isClearAreaRestriction && isClearAreaRestriction !== t.props.isClearAreaRestriction) {
3318
3322
  t.clearAreaRestriction();
3319
3323
  }
3320
3324
  };
@@ -3369,7 +3373,6 @@ var TMap = /*#__PURE__*/function (_React$Component) {
3369
3373
  if (window.VtxMap && window.VtxMap[t.state.mapId]) window.VtxMap[t.state.mapId] = null;
3370
3374
  }
3371
3375
  }]);
3372
- }(_react["default"].Component);
3373
- var _default = exports["default"] = TMap;
3374
- module.exports = exports["default"];
3375
- //# sourceMappingURL=TMap.js.map
3376
+ return TMap;
3377
+ }(_react.default.Component);
3378
+ var _default = exports.default = TMap;