@vtx/map 1.1.42 → 1.1.43
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.
- package/lib/VtxMap/AMap/AMap.js +630 -1000
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +747 -1195
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/GMap/Map.js +1046 -1564
- package/lib/VtxMap/GMap/Map.js.map +1 -1
- package/lib/VtxMap/Map.js +8 -42
- package/lib/VtxMap/Map.js.map +1 -1
- package/lib/VtxMap/MapToolFunction.js +26 -63
- package/lib/VtxMap/MapToolFunction.js.map +1 -1
- package/lib/VtxMap/OMap/Map.js +867 -1361
- package/lib/VtxMap/OMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.js +696 -1204
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +651 -1058
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/lib/VtxMap/index.js +1 -8
- package/lib/VtxMap/index.js.map +1 -1
- package/lib/VtxMap/mapPlayer.js +67 -123
- package/lib/VtxMap/mapPlayer.js.map +1 -1
- package/lib/VtxMap/optimizingPointMap.js +21 -77
- package/lib/VtxMap/optimizingPointMap.js.map +1 -1
- package/lib/VtxMap/style/css.js +0 -6
- package/lib/VtxMap/style/css.js.map +1 -1
- package/lib/VtxMap/style/index.js +0 -6
- package/lib/VtxMap/style/index.js.map +1 -1
- package/lib/VtxMap/zoomMap.js +12 -41
- package/lib/VtxMap/zoomMap.js.map +1 -1
- package/lib/VtxModal/VtxModal.js +19 -63
- package/lib/VtxModal/VtxModal.js.map +1 -1
- package/lib/VtxModal/draggableModal.js +12 -48
- package/lib/VtxModal/draggableModal.js.map +1 -1
- package/lib/VtxModal/index.js +1 -6
- package/lib/VtxModal/index.js.map +1 -1
- package/lib/VtxModal/style/css.js +0 -6
- package/lib/VtxModal/style/css.js.map +1 -1
- package/lib/VtxModal/style/index.js +0 -6
- package/lib/VtxModal/style/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +105 -238
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
- package/lib/VtxSearchCheckMap/index.js +0 -2
- package/lib/VtxSearchCheckMap/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/mapping.js +1 -2
- package/lib/VtxSearchCheckMap/mapping.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/css.js +0 -19
- package/lib/VtxSearchCheckMap/style/css.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/index.js +0 -19
- package/lib/VtxSearchCheckMap/style/index.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.js +89 -220
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
- package/lib/VtxSearchMap/index.js +0 -2
- package/lib/VtxSearchMap/index.js.map +1 -1
- package/lib/VtxSearchMap/mapping.js +1 -2
- package/lib/VtxSearchMap/mapping.js.map +1 -1
- package/lib/VtxSearchMap/style/css.js +0 -19
- package/lib/VtxSearchMap/style/css.js.map +1 -1
- package/lib/VtxSearchMap/style/index.js +0 -19
- package/lib/VtxSearchMap/style/index.js.map +1 -1
- package/lib/default.js +4 -13
- package/lib/default.js.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,78 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
13
|
-
|
|
14
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
-
|
|
16
11
|
var _message = _interopRequireDefault(require("antd/lib/message"));
|
|
17
|
-
|
|
18
12
|
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
19
|
-
|
|
20
13
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
21
|
-
|
|
22
14
|
var _VtxModal = require("../VtxModal");
|
|
23
|
-
|
|
24
15
|
var _VtxMap = require("../VtxMap");
|
|
25
|
-
|
|
26
16
|
var _default2 = _interopRequireWildcard(require("../default"));
|
|
27
|
-
|
|
28
17
|
var _mapping = require("./mapping");
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
34
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
-
|
|
36
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
-
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
42
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
-
|
|
44
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
45
|
-
|
|
25
|
+
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); } }
|
|
46
26
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
47
|
-
|
|
48
27
|
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); }
|
|
49
|
-
|
|
50
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
51
|
-
|
|
52
29
|
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); }; }
|
|
53
|
-
|
|
54
30
|
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); }
|
|
55
|
-
|
|
56
31
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
57
|
-
|
|
58
32
|
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; } }
|
|
59
|
-
|
|
60
33
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
61
|
-
|
|
62
|
-
function
|
|
63
|
-
|
|
34
|
+
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; }
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
64
37
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
65
|
-
|
|
66
38
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
|
-
|
|
68
39
|
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); }
|
|
69
|
-
|
|
70
40
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
71
|
-
|
|
72
41
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
73
|
-
|
|
74
|
-
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; }
|
|
75
|
-
|
|
42
|
+
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; } //公共地址配置
|
|
76
43
|
var styles = {
|
|
77
44
|
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
78
45
|
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
@@ -94,18 +61,17 @@ var styles = {
|
|
|
94
61
|
hiddenLabel: 'vtx-ui-searchmap-hiddenlabel',
|
|
95
62
|
otherModal: 'vtx-ui-searchmap-othermodal',
|
|
96
63
|
mapTxt: 'vtx-ui-searchmap-mapTxt'
|
|
97
|
-
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// message.config({
|
|
98
67
|
// top: document.getElementById('root').offsetHeight/3,
|
|
99
68
|
// duration: 5,
|
|
100
69
|
// });
|
|
101
|
-
|
|
102
70
|
var warning = function warning() {
|
|
103
71
|
_message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
|
|
104
72
|
};
|
|
105
|
-
|
|
106
73
|
function distinct(ary) {
|
|
107
74
|
var pts = _toConsumableArray(ary);
|
|
108
|
-
|
|
109
75
|
if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
|
|
110
76
|
pts.pop();
|
|
111
77
|
return distinct(pts);
|
|
@@ -113,31 +79,24 @@ function distinct(ary) {
|
|
|
113
79
|
return pts;
|
|
114
80
|
}
|
|
115
81
|
}
|
|
116
|
-
|
|
117
82
|
var getIcon = function getIcon(type) {
|
|
118
83
|
return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
119
84
|
type: "icon-".concat(_mapping.iconMapping[type])
|
|
120
85
|
}) : type;
|
|
121
86
|
};
|
|
122
|
-
|
|
123
87
|
var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
124
88
|
_inherits(VtxSearchMap, _React$Component);
|
|
125
|
-
|
|
126
89
|
var _super = _createSuper(VtxSearchMap);
|
|
127
|
-
|
|
128
90
|
function VtxSearchMap(props) {
|
|
129
91
|
var _this;
|
|
130
|
-
|
|
131
92
|
_classCallCheck(this, VtxSearchMap);
|
|
132
|
-
|
|
133
93
|
_this = _super.call(this, props);
|
|
134
|
-
|
|
94
|
+
// 绘制多个图元时返回参数
|
|
135
95
|
_defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
|
|
136
96
|
var resData = [];
|
|
137
97
|
var _this$state = _this.state,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
98
|
+
graphicValue = _this$state.graphicValue,
|
|
99
|
+
editGraphic = _this$state.editGraphic;
|
|
141
100
|
switch (graphicType) {
|
|
142
101
|
case 'polygon':
|
|
143
102
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
@@ -147,7 +106,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
147
106
|
});
|
|
148
107
|
});
|
|
149
108
|
break;
|
|
150
|
-
|
|
151
109
|
case 'polyline':
|
|
152
110
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
153
111
|
resData.push({
|
|
@@ -155,25 +113,21 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
155
113
|
length: _this.map.calculateDistance(item.paths || item.geometry.paths)
|
|
156
114
|
});
|
|
157
115
|
});
|
|
158
|
-
|
|
159
116
|
default:
|
|
160
117
|
break;
|
|
161
118
|
}
|
|
162
|
-
|
|
163
119
|
return resData.length ? resData : null;
|
|
164
120
|
});
|
|
165
|
-
|
|
166
121
|
_this.map = null; //Map组件的ref对象
|
|
167
|
-
|
|
168
122
|
_this.mapLoaded = false;
|
|
169
123
|
_this.isDrawStatus = false;
|
|
170
124
|
_this.isClickMap = false;
|
|
171
125
|
_this.apid = []; //所有点id,除编辑点外
|
|
172
|
-
|
|
173
126
|
_this.loadExtent = null;
|
|
174
127
|
_this.mapId = "searchMap".concat(new Date().getTime());
|
|
175
128
|
_this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
|
|
176
|
-
_this.clickable = false,
|
|
129
|
+
_this.clickable = false,
|
|
130
|
+
// 多个面绘制时,是否可以点击面进行编辑
|
|
177
131
|
_this.state = {
|
|
178
132
|
//列表和地图宽度切换的动画需要
|
|
179
133
|
isShowList: false,
|
|
@@ -192,7 +146,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
192
146
|
graphicValue: _this.multiDraw ? [] : null,
|
|
193
147
|
// 绘制图元id集合
|
|
194
148
|
drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
|
|
195
|
-
|
|
196
149
|
/*地图Api参数*/
|
|
197
150
|
mapCenter: props.mapCenter || '',
|
|
198
151
|
maxZoom: props.maxZoom,
|
|
@@ -213,7 +166,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
213
166
|
editGraphic: _this.multiDraw ? [] : null,
|
|
214
167
|
mapZoomLevel: props.mapZoomLevel || 11,
|
|
215
168
|
setZoomLevel: false,
|
|
216
|
-
|
|
217
169
|
/*modal参数*/
|
|
218
170
|
modal1Visible: props.modal1Visible || false,
|
|
219
171
|
isShowOther: props.isShowOther || false,
|
|
@@ -227,35 +179,28 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
227
179
|
showControl: props.showControl || false
|
|
228
180
|
};
|
|
229
181
|
return _this;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
182
|
+
}
|
|
233
183
|
_createClass(VtxSearchMap, [{
|
|
234
184
|
key: "callback",
|
|
235
|
-
value:
|
|
185
|
+
value:
|
|
186
|
+
//经纬度回调
|
|
236
187
|
function callback() {
|
|
237
188
|
var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
|
|
238
|
-
|
|
239
189
|
if (fun in this.props && typeof this.props[fun] === 'function') {
|
|
240
190
|
var editGraphicId = this.state.editGraphicId;
|
|
241
|
-
|
|
242
191
|
switch (this.state.graphicType) {
|
|
243
192
|
case 'point':
|
|
244
193
|
var locationPoint = this.state.locationPoint;
|
|
245
|
-
|
|
246
194
|
if (this.map.getGraphic('locationPoint')) {
|
|
247
195
|
var p = this.map.getGraphic(locationPoint[0].id).geometry;
|
|
248
196
|
this.props[fun]([p.x, p.y]);
|
|
249
197
|
} else {
|
|
250
198
|
return [];
|
|
251
199
|
}
|
|
252
|
-
|
|
253
200
|
break;
|
|
254
|
-
|
|
255
201
|
case 'circle':
|
|
256
202
|
if (this.map.getGraphic(editGraphicId)) {
|
|
257
203
|
var _p = this.map.getGraphic(editGraphicId);
|
|
258
|
-
|
|
259
204
|
this.props[fun]({
|
|
260
205
|
x: _p.geometry.x,
|
|
261
206
|
y: _p.geometry.y,
|
|
@@ -270,18 +215,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
270
215
|
area: this.state.graphicValue.area
|
|
271
216
|
} : null);
|
|
272
217
|
}
|
|
273
|
-
|
|
274
218
|
break;
|
|
275
|
-
|
|
276
219
|
case 'polygon':
|
|
277
220
|
if (this.multiDraw) {
|
|
278
221
|
this.props[fun](this.getMultiRes('polygon'));
|
|
279
222
|
return;
|
|
280
223
|
}
|
|
281
|
-
|
|
282
224
|
if (this.map.getGraphic(editGraphicId)) {
|
|
283
225
|
var _p2 = this.map.getGraphic(editGraphicId);
|
|
284
|
-
|
|
285
226
|
this.props[fun]({
|
|
286
227
|
rings: distinct(_p2.geometry.rings),
|
|
287
228
|
area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
|
|
@@ -292,25 +233,20 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
292
233
|
area: this.state.graphicValue.area
|
|
293
234
|
} : null);
|
|
294
235
|
}
|
|
295
|
-
|
|
296
236
|
break;
|
|
297
|
-
|
|
298
237
|
case 'rectangle':
|
|
299
238
|
this.props[fun](this.state.graphicValue ? {
|
|
300
239
|
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
301
240
|
area: this.state.graphicValue.area
|
|
302
241
|
} : null);
|
|
303
242
|
break;
|
|
304
|
-
|
|
305
243
|
case 'polyline':
|
|
306
244
|
if (this.multiDraw) {
|
|
307
245
|
this.props[fun](this.getMultiRes('polyline'));
|
|
308
246
|
return;
|
|
309
247
|
}
|
|
310
|
-
|
|
311
248
|
if (this.map.getGraphic(editGraphicId)) {
|
|
312
249
|
var _p3 = this.map.getGraphic(editGraphicId);
|
|
313
|
-
|
|
314
250
|
this.props[fun]({
|
|
315
251
|
paths: _p3.geometry.paths,
|
|
316
252
|
length: this.map.calculateDistance(_p3.geometry.paths)
|
|
@@ -321,11 +257,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
321
257
|
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
322
258
|
} : null);
|
|
323
259
|
}
|
|
324
|
-
|
|
325
260
|
break;
|
|
326
261
|
}
|
|
327
262
|
}
|
|
328
|
-
|
|
329
263
|
if (this.props.clearDrawnGraph) {
|
|
330
264
|
this.clearDrawnGraph();
|
|
331
265
|
}
|
|
@@ -336,18 +270,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
336
270
|
this.setState({
|
|
337
271
|
isShowList: bealoon
|
|
338
272
|
});
|
|
339
|
-
}
|
|
340
|
-
|
|
273
|
+
}
|
|
274
|
+
//绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
|
|
341
275
|
}, {
|
|
342
276
|
key: "drawLocationPoint",
|
|
343
277
|
value: function drawLocationPoint() {
|
|
344
|
-
var t = this;
|
|
345
|
-
|
|
278
|
+
var t = this;
|
|
279
|
+
//判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
|
|
346
280
|
if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
|
|
347
281
|
var lglt = this.map.getMapExtent(),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
282
|
+
editGraphic = null,
|
|
283
|
+
editGraphicId = 'locationPoint';
|
|
351
284
|
if (!this.multiDraw && this.props.editParam) {
|
|
352
285
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
353
286
|
editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
|
|
@@ -355,7 +288,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
355
288
|
});
|
|
356
289
|
editGraphicId = 'drawnGraph';
|
|
357
290
|
}
|
|
358
|
-
|
|
359
291
|
if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
|
|
360
292
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
361
293
|
editGraphic = this.props.editParam.map(function (item, index) {
|
|
@@ -365,7 +297,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
365
297
|
});
|
|
366
298
|
editGraphicId = null;
|
|
367
299
|
}
|
|
368
|
-
|
|
369
300
|
this.isinit = false;
|
|
370
301
|
this.setState({
|
|
371
302
|
editGraphic: editGraphic,
|
|
@@ -396,13 +327,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
396
327
|
t.drawLocationPoint();
|
|
397
328
|
}, 50);
|
|
398
329
|
}
|
|
399
|
-
}
|
|
400
|
-
|
|
330
|
+
}
|
|
331
|
+
//校正定位的点位位置到当前的中心点
|
|
401
332
|
}, {
|
|
402
333
|
key: "correction",
|
|
403
334
|
value: function correction() {
|
|
404
|
-
var t = this;
|
|
405
|
-
|
|
335
|
+
var t = this;
|
|
336
|
+
//获取当前中心点经纬度
|
|
406
337
|
var lglt = this.map.getMapExtent();
|
|
407
338
|
var locationPoint = t.state.locationPoint;
|
|
408
339
|
locationPoint = locationPoint.map(function (item, index) {
|
|
@@ -412,16 +343,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
412
343
|
});
|
|
413
344
|
});
|
|
414
345
|
this.map.updatePoint(locationPoint);
|
|
415
|
-
}
|
|
416
|
-
|
|
346
|
+
}
|
|
347
|
+
//搜索关键字切换
|
|
417
348
|
}, {
|
|
418
349
|
key: "changeValue",
|
|
419
350
|
value: function changeValue(e) {
|
|
420
351
|
this.setState({
|
|
421
352
|
searchValue: e.target.value
|
|
422
353
|
});
|
|
423
|
-
}
|
|
424
|
-
|
|
354
|
+
}
|
|
355
|
+
//根据关键字搜索数据
|
|
425
356
|
}, {
|
|
426
357
|
key: "searchList",
|
|
427
358
|
value: function searchList() {
|
|
@@ -431,9 +362,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
431
362
|
searchPoints.then(function (results) {
|
|
432
363
|
if (results.length > 0) {
|
|
433
364
|
var lsp = [],
|
|
434
|
-
|
|
365
|
+
lsm = [];
|
|
435
366
|
t.apid = [];
|
|
436
|
-
|
|
437
367
|
for (var i = 0; i < results.length; i++) {
|
|
438
368
|
var r = results[i];
|
|
439
369
|
lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
|
|
@@ -448,7 +378,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
448
378
|
});
|
|
449
379
|
t.apid.push(r.id);
|
|
450
380
|
}
|
|
451
|
-
|
|
452
381
|
t.setState({
|
|
453
382
|
listPoint: lsp,
|
|
454
383
|
listMess: lsm,
|
|
@@ -459,13 +388,12 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
459
388
|
warning();
|
|
460
389
|
}
|
|
461
390
|
});
|
|
462
|
-
}
|
|
463
|
-
|
|
391
|
+
}
|
|
392
|
+
//返回最佳位置(zoom,center)
|
|
464
393
|
}, {
|
|
465
394
|
key: "setFitView",
|
|
466
395
|
value: function setFitView() {
|
|
467
396
|
var _this2 = this;
|
|
468
|
-
|
|
469
397
|
this.setState({
|
|
470
398
|
mapVisiblePoints: {
|
|
471
399
|
fitView: this.apid,
|
|
@@ -477,8 +405,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
477
405
|
setVisiblePoints: false
|
|
478
406
|
});
|
|
479
407
|
});
|
|
480
|
-
}
|
|
481
|
-
|
|
408
|
+
}
|
|
409
|
+
//清空列表的所有数据(包括点位)
|
|
482
410
|
}, {
|
|
483
411
|
key: "clearList",
|
|
484
412
|
value: function clearList() {
|
|
@@ -489,15 +417,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
489
417
|
listMess: [],
|
|
490
418
|
isShowList: false
|
|
491
419
|
});
|
|
492
|
-
}
|
|
493
|
-
|
|
420
|
+
}
|
|
421
|
+
//列表选中地址
|
|
494
422
|
}, {
|
|
495
423
|
key: "chooseAddress",
|
|
496
424
|
value: function chooseAddress(id) {
|
|
497
425
|
var t = this;
|
|
498
426
|
var _this$state2 = this.state,
|
|
499
|
-
|
|
500
|
-
|
|
427
|
+
listPoint = _this$state2.listPoint,
|
|
428
|
+
listMess = _this$state2.listMess;
|
|
501
429
|
var mapCenter = [];
|
|
502
430
|
listPoint = listPoint.map(function (item, index) {
|
|
503
431
|
if (item.id === id) {
|
|
@@ -533,7 +461,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
533
461
|
t.setState({
|
|
534
462
|
setCenter: false
|
|
535
463
|
});
|
|
536
|
-
|
|
537
464
|
if (t.state.graphicType == 'point') {
|
|
538
465
|
t.correction();
|
|
539
466
|
}
|
|
@@ -543,14 +470,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
543
470
|
key: "clickGraphic",
|
|
544
471
|
value: function clickGraphic(obj) {
|
|
545
472
|
var _this3 = this;
|
|
546
|
-
|
|
547
473
|
if (obj.type === 'point' && obj.attributes.other === 'search') {
|
|
548
474
|
this.chooseAddress(obj.attributes.id);
|
|
549
475
|
}
|
|
550
|
-
|
|
551
476
|
if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
|
|
552
477
|
var _obj$param$attributes;
|
|
553
|
-
|
|
554
478
|
// 开启编辑
|
|
555
479
|
this.setState({
|
|
556
480
|
editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
|
|
@@ -567,7 +491,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
567
491
|
value: function closeModal(e) {
|
|
568
492
|
this.isDrawStatus = false;
|
|
569
493
|
this.isClickMap = false;
|
|
570
|
-
|
|
571
494
|
if (this.isDrawStatus && this.isClickMap) {
|
|
572
495
|
_message["default"].warning('请双击结束图元编辑');
|
|
573
496
|
} else {
|
|
@@ -577,17 +500,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
577
500
|
this.setState({
|
|
578
501
|
modal1Visible: false
|
|
579
502
|
});
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
503
|
+
}
|
|
504
|
+
// if(this.props.clearDrawnGraph){
|
|
505
|
+
this.clearDrawnGraph();
|
|
506
|
+
// }
|
|
584
507
|
}
|
|
585
508
|
}
|
|
586
509
|
}, {
|
|
587
510
|
key: "clearDrawnGraph",
|
|
588
511
|
value: function clearDrawnGraph() {
|
|
589
512
|
var _this4 = this;
|
|
590
|
-
|
|
591
513
|
this.isDrawStatus = true;
|
|
592
514
|
this.setState({
|
|
593
515
|
isDraw: this.state.graphicType !== 'point',
|
|
@@ -603,7 +525,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
603
525
|
key: "continueDraw",
|
|
604
526
|
value: function continueDraw(func) {
|
|
605
527
|
var _this5 = this;
|
|
606
|
-
|
|
607
528
|
this.clickable = false;
|
|
608
529
|
this.setState({
|
|
609
530
|
isDraw: false,
|
|
@@ -626,15 +547,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
626
547
|
key: "editGraphic",
|
|
627
548
|
value: function editGraphic() {
|
|
628
549
|
var _this6 = this;
|
|
629
|
-
|
|
630
550
|
if (this.isDrawStatus && this.isClickMap) {
|
|
631
551
|
_message["default"].warning('请双击结束图元编辑');
|
|
632
|
-
|
|
633
552
|
return;
|
|
634
553
|
}
|
|
635
|
-
|
|
636
554
|
_message["default"].info('请点击图元进行编辑');
|
|
637
|
-
|
|
638
555
|
this.clickable = true;
|
|
639
556
|
this.isDrawStatus = false;
|
|
640
557
|
this.setState({
|
|
@@ -654,8 +571,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
654
571
|
value: function editGraphicChange(obj) {
|
|
655
572
|
if (!this.multiDraw) return;
|
|
656
573
|
var _this$state3 = this.state,
|
|
657
|
-
|
|
658
|
-
|
|
574
|
+
graphicValue = _this$state3.graphicValue,
|
|
575
|
+
editGraphic = _this$state3.editGraphic;
|
|
659
576
|
this.setState({
|
|
660
577
|
graphicValue: (graphicValue || []).map(function (item) {
|
|
661
578
|
return item.id === obj.id ? obj : item;
|
|
@@ -674,7 +591,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
674
591
|
currentMap: str
|
|
675
592
|
});
|
|
676
593
|
var layers = [];
|
|
677
|
-
|
|
678
594
|
switch (mapType) {
|
|
679
595
|
case 'amap':
|
|
680
596
|
case 'bmap':
|
|
@@ -684,12 +600,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
684
600
|
} else {
|
|
685
601
|
t.map.setMapType('wx');
|
|
686
602
|
}
|
|
687
|
-
|
|
688
603
|
break;
|
|
689
|
-
|
|
690
604
|
case 'gmap':
|
|
691
605
|
break;
|
|
692
|
-
|
|
693
606
|
default:
|
|
694
607
|
break;
|
|
695
608
|
}
|
|
@@ -698,41 +611,40 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
698
611
|
key: "render",
|
|
699
612
|
value: function render() {
|
|
700
613
|
var _this7 = this;
|
|
701
|
-
|
|
702
614
|
var t = this;
|
|
703
615
|
var _this$state4 = this.state,
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
616
|
+
isShowList = _this$state4.isShowList,
|
|
617
|
+
searchValue = _this$state4.searchValue,
|
|
618
|
+
locationPoint = _this$state4.locationPoint,
|
|
619
|
+
listPoint = _this$state4.listPoint,
|
|
620
|
+
listMess = _this$state4.listMess,
|
|
621
|
+
mapZoomLevel = _this$state4.mapZoomLevel,
|
|
622
|
+
setZoomLevel = _this$state4.setZoomLevel,
|
|
623
|
+
maxZoom = _this$state4.maxZoom,
|
|
624
|
+
minZoom = _this$state4.minZoom,
|
|
625
|
+
wkid = _this$state4.wkid,
|
|
626
|
+
mapServer = _this$state4.mapServer,
|
|
627
|
+
mapCenter = _this$state4.mapCenter,
|
|
628
|
+
setCenter = _this$state4.setCenter,
|
|
629
|
+
mapType = _this$state4.mapType,
|
|
630
|
+
mapStyle = _this$state4.mapStyle,
|
|
631
|
+
mapVisiblePoints = _this$state4.mapVisiblePoints,
|
|
632
|
+
setVisiblePoints = _this$state4.setVisiblePoints,
|
|
633
|
+
isDoEdit = _this$state4.isDoEdit,
|
|
634
|
+
editGraphicId = _this$state4.editGraphicId,
|
|
635
|
+
isEndEdit = _this$state4.isEndEdit,
|
|
636
|
+
modal1Visible = _this$state4.modal1Visible,
|
|
637
|
+
drawGraphID = _this$state4.drawGraphID,
|
|
638
|
+
isShowOther = _this$state4.isShowOther,
|
|
639
|
+
otherText = _this$state4.otherText,
|
|
640
|
+
isShowOtherGraph = _this$state4.isShowOtherGraph,
|
|
641
|
+
editGraphic = _this$state4.editGraphic,
|
|
642
|
+
graphicType = _this$state4.graphicType,
|
|
643
|
+
graphicValue = _this$state4.graphicValue,
|
|
644
|
+
olProps = _this$state4.olProps,
|
|
645
|
+
isChangeMapType = _this$state4.isChangeMapType,
|
|
646
|
+
currentMap = _this$state4.currentMap,
|
|
647
|
+
showControl = _this$state4.showControl;
|
|
736
648
|
var InputProps = {
|
|
737
649
|
style: {
|
|
738
650
|
'width': '200px'
|
|
@@ -757,11 +669,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
757
669
|
isDoEdit: !_this7.multiDraw,
|
|
758
670
|
isDraw: _this7.multiDraw
|
|
759
671
|
};
|
|
760
|
-
|
|
761
672
|
if (!_this7.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
|
|
762
673
|
objparam.editGraphicId = obj.id;
|
|
763
674
|
}
|
|
764
|
-
|
|
765
675
|
_this7.setState(objparam);
|
|
766
676
|
},
|
|
767
677
|
mapDraw: {
|
|
@@ -793,51 +703,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
793
703
|
}
|
|
794
704
|
};
|
|
795
705
|
var mapPoints = [],
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
706
|
+
mapLines = [],
|
|
707
|
+
mapPolygons = [],
|
|
708
|
+
mapCircles = [];
|
|
800
709
|
if (graphicType == 'point') {
|
|
801
710
|
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
802
711
|
} else {
|
|
803
712
|
mapPoints = _toConsumableArray(listPoint);
|
|
804
713
|
}
|
|
805
|
-
|
|
806
714
|
if (graphicType === 'polygon') {
|
|
807
715
|
if (editGraphic) {
|
|
808
716
|
var _mapPolygons;
|
|
809
|
-
|
|
810
717
|
Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
|
|
811
718
|
!this.multiDraw && (drawProps = null);
|
|
812
719
|
}
|
|
813
720
|
}
|
|
814
|
-
|
|
815
721
|
if (graphicType === 'polyline') {
|
|
816
722
|
if (editGraphic) {
|
|
817
723
|
var _mapLines;
|
|
818
|
-
|
|
819
724
|
Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
|
|
820
725
|
!this.multiDraw && (drawProps = null);
|
|
821
726
|
}
|
|
822
727
|
}
|
|
823
|
-
|
|
824
728
|
if (graphicType === 'rectangle') {
|
|
825
729
|
if (editGraphic) {
|
|
826
730
|
mapPolygons.push(editGraphic);
|
|
827
731
|
drawProps = null;
|
|
828
732
|
}
|
|
829
733
|
}
|
|
830
|
-
|
|
831
734
|
if (graphicType === 'circle') {
|
|
832
735
|
if (editGraphic) {
|
|
833
736
|
mapCircles.push(editGraphic);
|
|
834
737
|
drawProps = null;
|
|
835
738
|
}
|
|
836
739
|
}
|
|
837
|
-
|
|
838
740
|
if (isShowOtherGraph) {
|
|
839
741
|
var otherGraph = this.props.otherGraph;
|
|
840
|
-
|
|
841
742
|
if (otherGraph) {
|
|
842
743
|
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
843
744
|
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
@@ -845,7 +746,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
845
746
|
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
846
747
|
}
|
|
847
748
|
}
|
|
848
|
-
|
|
849
749
|
var mapTypeContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
850
750
|
style: {
|
|
851
751
|
width: '170px',
|
|
@@ -881,7 +781,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
881
781
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
882
782
|
src: "".concat(_default2["default"].mapServerURL, "/images/wx.png")
|
|
883
783
|
})));
|
|
884
|
-
|
|
885
784
|
return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
|
|
886
785
|
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
887
786
|
style: {
|
|
@@ -903,10 +802,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
903
802
|
onClick: function onClick() {
|
|
904
803
|
if (_this7.multiDraw && _this7.state.isDoEdit && !_this7.state.isEndEdit) {
|
|
905
804
|
_this7.continueDraw(_this7.callback.bind(_this7));
|
|
906
|
-
|
|
907
805
|
return;
|
|
908
806
|
}
|
|
909
|
-
|
|
910
807
|
_this7.callback();
|
|
911
808
|
},
|
|
912
809
|
icon: getIcon('check')
|
|
@@ -936,16 +833,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
936
833
|
disabled: this.isDrawStatus,
|
|
937
834
|
onClick: function onClick() {
|
|
938
835
|
_this7.isDrawStatus = true;
|
|
939
|
-
|
|
940
836
|
if (_this7.multiDraw) {
|
|
941
837
|
_this7.clickable = false;
|
|
942
|
-
graphicValue === null || graphicValue === void 0
|
|
838
|
+
graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
|
|
943
839
|
return t.map.removeGraphic(item.id, 'draw');
|
|
944
840
|
});
|
|
945
|
-
editGraphic === null || editGraphic === void 0
|
|
841
|
+
editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
|
|
946
842
|
return t.map.removeGraphic(item.id, 'draw');
|
|
947
843
|
});
|
|
948
|
-
|
|
949
844
|
_this7.setState({
|
|
950
845
|
isDraw: false,
|
|
951
846
|
isCloseDraw: true,
|
|
@@ -972,7 +867,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
972
867
|
});
|
|
973
868
|
});
|
|
974
869
|
}
|
|
975
|
-
|
|
976
870
|
_this7.callback('editDraw');
|
|
977
871
|
},
|
|
978
872
|
icon: getIcon('edit')
|
|
@@ -1077,15 +971,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1077
971
|
key: "initSearchMap",
|
|
1078
972
|
value: function initSearchMap() {
|
|
1079
973
|
var _this8 = this;
|
|
1080
|
-
|
|
1081
|
-
if (this.props.modal1Visible
|
|
1082
|
-
/*&& !this.state.locationPoint[0]*/
|
|
1083
|
-
) {
|
|
974
|
+
if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
|
|
1084
975
|
if (this.map) {
|
|
1085
976
|
this.map.loadMapComplete.then(function () {
|
|
1086
977
|
if (!_this8.mapLoaded) {
|
|
1087
978
|
_this8.mapLoaded = true;
|
|
1088
|
-
|
|
1089
979
|
_this8.drawLocationPoint();
|
|
1090
980
|
}
|
|
1091
981
|
});
|
|
@@ -1108,20 +998,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1108
998
|
key: "componentWillReceiveProps",
|
|
1109
999
|
value: function componentWillReceiveProps(nextProps) {
|
|
1110
1000
|
var _this9 = this;
|
|
1111
|
-
|
|
1112
1001
|
var t = this;
|
|
1113
1002
|
this.isClickMap = false;
|
|
1114
|
-
|
|
1115
1003
|
if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
|
|
1116
1004
|
this.map.clearAll();
|
|
1117
1005
|
t.mapLoaded = false;
|
|
1118
1006
|
t.isinit = true;
|
|
1119
1007
|
}
|
|
1120
|
-
|
|
1121
1008
|
if (nextProps.editParam) {
|
|
1122
1009
|
t.mapLoaded = false;
|
|
1123
1010
|
}
|
|
1124
|
-
|
|
1125
1011
|
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
1126
1012
|
this.setState({
|
|
1127
1013
|
modal1Visible: nextProps.modal1Visible,
|
|
@@ -1146,7 +1032,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1146
1032
|
//实现2+次进入时,清理数据
|
|
1147
1033
|
if (nextProps.modal1Visible) {
|
|
1148
1034
|
_this9.clearList();
|
|
1149
|
-
|
|
1150
1035
|
_this9.setState({
|
|
1151
1036
|
setZoomLevel: true
|
|
1152
1037
|
}, function () {
|
|
@@ -1154,39 +1039,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1154
1039
|
setZoomLevel: false
|
|
1155
1040
|
});
|
|
1156
1041
|
});
|
|
1157
|
-
|
|
1158
1042
|
if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
1159
1043
|
if (_this9.map.getGraphic('locationPoint')) {
|
|
1160
1044
|
switch (nextProps.mapType) {
|
|
1161
1045
|
case 'bmap':
|
|
1162
1046
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1163
|
-
|
|
1164
1047
|
break;
|
|
1165
|
-
|
|
1166
1048
|
case 'amap':
|
|
1167
1049
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1168
|
-
|
|
1169
1050
|
break;
|
|
1170
|
-
|
|
1171
1051
|
case 'tmap':
|
|
1172
1052
|
_this9.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1173
|
-
|
|
1174
1053
|
break;
|
|
1175
|
-
|
|
1176
1054
|
case 'gmap':
|
|
1177
1055
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
1178
|
-
|
|
1179
1056
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
1180
|
-
|
|
1181
1057
|
_this9.map.state.gis.graphics.refresh();
|
|
1182
|
-
|
|
1183
1058
|
case 'olMap':
|
|
1184
1059
|
_this9.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
1185
|
-
|
|
1186
1060
|
break;
|
|
1187
1061
|
}
|
|
1188
1062
|
}
|
|
1189
|
-
|
|
1190
1063
|
_this9.map.setCenter(nextProps.mapCenter);
|
|
1191
1064
|
}
|
|
1192
1065
|
}
|
|
@@ -1197,17 +1070,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1197
1070
|
value: function componentWillUnmount() {
|
|
1198
1071
|
//关闭moveTo定时
|
|
1199
1072
|
var t = this;
|
|
1200
|
-
|
|
1201
1073
|
if (t.loadExtent) {
|
|
1202
1074
|
clearInterval(t.loadExtent);
|
|
1203
1075
|
}
|
|
1204
1076
|
}
|
|
1205
1077
|
}]);
|
|
1206
|
-
|
|
1207
1078
|
return VtxSearchMap;
|
|
1208
1079
|
}(_react["default"].Component);
|
|
1209
|
-
|
|
1210
|
-
var _default = VtxSearchMap;
|
|
1211
|
-
exports["default"] = _default;
|
|
1080
|
+
var _default = exports["default"] = VtxSearchMap;
|
|
1212
1081
|
module.exports = exports["default"];
|
|
1213
1082
|
//# sourceMappingURL=VtxSearchMap.js.map
|