@vtx/map 1.1.48 → 1.1.50
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 +1007 -639
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +1201 -755
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/GMap/Map.js +1569 -1053
- package/lib/VtxMap/GMap/Map.js.map +1 -1
- package/lib/VtxMap/Map.js +42 -8
- package/lib/VtxMap/Map.js.map +1 -1
- package/lib/VtxMap/MapToolFunction.js +63 -26
- package/lib/VtxMap/MapToolFunction.js.map +1 -1
- package/lib/VtxMap/OMap/Map.js +1365 -873
- package/lib/VtxMap/OMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.js +1280 -760
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +1063 -658
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/lib/VtxMap/index.js +8 -1
- package/lib/VtxMap/index.js.map +1 -1
- package/lib/VtxMap/mapPlayer.js +123 -67
- package/lib/VtxMap/mapPlayer.js.map +1 -1
- package/lib/VtxMap/optimizingPointMap.js +79 -23
- package/lib/VtxMap/optimizingPointMap.js.map +1 -1
- package/lib/VtxMap/style/css.js +6 -0
- package/lib/VtxMap/style/css.js.map +1 -1
- package/lib/VtxMap/style/index.js +6 -0
- package/lib/VtxMap/style/index.js.map +1 -1
- package/lib/VtxMap/zoomMap.js +43 -14
- package/lib/VtxMap/zoomMap.js.map +1 -1
- package/lib/VtxModal/VtxModal.js +65 -21
- package/lib/VtxModal/VtxModal.js.map +1 -1
- package/lib/VtxModal/draggableModal.js +50 -14
- package/lib/VtxModal/draggableModal.js.map +1 -1
- package/lib/VtxModal/index.js +6 -1
- package/lib/VtxModal/index.js.map +1 -1
- package/lib/VtxModal/style/css.js +6 -0
- package/lib/VtxModal/style/css.js.map +1 -1
- package/lib/VtxModal/style/index.js +6 -0
- package/lib/VtxModal/style/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +240 -107
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
- package/lib/VtxSearchCheckMap/index.js +2 -0
- package/lib/VtxSearchCheckMap/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/mapping.js +2 -1
- package/lib/VtxSearchCheckMap/mapping.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/css.js +19 -0
- package/lib/VtxSearchCheckMap/style/css.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/index.js +19 -0
- package/lib/VtxSearchCheckMap/style/index.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.js +234 -95
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
- package/lib/VtxSearchMap/index.js +2 -0
- package/lib/VtxSearchMap/index.js.map +1 -1
- package/lib/VtxSearchMap/mapping.js +2 -1
- package/lib/VtxSearchMap/mapping.js.map +1 -1
- package/lib/VtxSearchMap/style/css.js +19 -0
- package/lib/VtxSearchMap/style/css.js.map +1 -1
- package/lib/VtxSearchMap/style/index.js +19 -0
- package/lib/VtxSearchMap/style/index.js.map +1 -1
- package/lib/default.js +19 -4
- package/lib/default.js.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/util.js +17 -5
- package/lib/utils/util.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,48 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
9
12
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
13
|
+
|
|
10
14
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
+
|
|
11
16
|
var _message = _interopRequireDefault(require("antd/lib/message"));
|
|
17
|
+
|
|
12
18
|
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
19
|
+
|
|
13
20
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
21
|
+
|
|
14
22
|
var _VtxModal = require("../VtxModal");
|
|
23
|
+
|
|
15
24
|
var _VtxMap = require("../VtxMap");
|
|
25
|
+
|
|
16
26
|
var _default2 = _interopRequireWildcard(require("../default"));
|
|
27
|
+
|
|
17
28
|
var _mapping = require("./mapping");
|
|
29
|
+
|
|
18
30
|
var _util = require("../utils/util");
|
|
31
|
+
|
|
19
32
|
var _antd = require("antd");
|
|
33
|
+
|
|
20
34
|
var _DownOutlined = _interopRequireDefault(require("@ant-design/icons/DownOutlined"));
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
|
|
36
|
+
var _defaultMarker = _interopRequireDefault(require("../VtxMap/images/defaultMarker.png"));
|
|
37
|
+
|
|
38
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
23
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
|
+
|
|
24
44
|
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); }
|
|
25
|
-
|
|
26
|
-
function
|
|
45
|
+
|
|
46
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
27
50
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
51
|
+
|
|
52
|
+
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); } }
|
|
53
|
+
|
|
29
54
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
55
|
+
|
|
30
56
|
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); }
|
|
57
|
+
|
|
31
58
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
59
|
+
|
|
32
60
|
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); }; }
|
|
61
|
+
|
|
33
62
|
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); }
|
|
63
|
+
|
|
34
64
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
65
|
+
|
|
35
66
|
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; } }
|
|
67
|
+
|
|
36
68
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
69
|
+
|
|
70
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
71
|
+
|
|
40
72
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
73
|
+
|
|
41
74
|
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."); }
|
|
75
|
+
|
|
42
76
|
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); }
|
|
77
|
+
|
|
43
78
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
79
|
+
|
|
44
80
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
45
|
-
|
|
81
|
+
|
|
82
|
+
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; }
|
|
83
|
+
|
|
46
84
|
var styles = {
|
|
47
85
|
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
48
86
|
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
@@ -74,17 +112,18 @@ var CoverageTypes = [{
|
|
|
74
112
|
}, {
|
|
75
113
|
name: '卫星底图',
|
|
76
114
|
key: 'wx'
|
|
77
|
-
}];
|
|
78
|
-
|
|
79
|
-
// message.config({
|
|
115
|
+
}]; // message.config({
|
|
80
116
|
// top: document.getElementById('root').offsetHeight/3,
|
|
81
117
|
// duration: 5,
|
|
82
118
|
// });
|
|
119
|
+
|
|
83
120
|
var warning = function warning() {
|
|
84
121
|
_message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
|
|
85
122
|
};
|
|
123
|
+
|
|
86
124
|
function distinct(ary) {
|
|
87
125
|
var pts = _toConsumableArray(ary);
|
|
126
|
+
|
|
88
127
|
if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
|
|
89
128
|
pts.pop();
|
|
90
129
|
return distinct(pts);
|
|
@@ -92,24 +131,31 @@ function distinct(ary) {
|
|
|
92
131
|
return pts;
|
|
93
132
|
}
|
|
94
133
|
}
|
|
134
|
+
|
|
95
135
|
var getIcon = function getIcon(type) {
|
|
96
136
|
return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
97
137
|
type: "icon-".concat(_mapping.iconMapping[type])
|
|
98
138
|
}) : type;
|
|
99
139
|
};
|
|
140
|
+
|
|
100
141
|
var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
101
142
|
_inherits(VtxSearchMap, _React$Component);
|
|
143
|
+
|
|
102
144
|
var _super = _createSuper(VtxSearchMap);
|
|
145
|
+
|
|
103
146
|
function VtxSearchMap(props) {
|
|
104
147
|
var _this;
|
|
148
|
+
|
|
105
149
|
_classCallCheck(this, VtxSearchMap);
|
|
150
|
+
|
|
106
151
|
_this = _super.call(this, props);
|
|
107
|
-
|
|
152
|
+
|
|
108
153
|
_defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
|
|
109
154
|
var resData = [];
|
|
110
155
|
var _this$state = _this.state,
|
|
111
|
-
|
|
112
|
-
|
|
156
|
+
graphicValue = _this$state.graphicValue,
|
|
157
|
+
editGraphic = _this$state.editGraphic;
|
|
158
|
+
|
|
113
159
|
switch (graphicType) {
|
|
114
160
|
case 'polygon':
|
|
115
161
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
@@ -120,6 +166,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
120
166
|
});
|
|
121
167
|
});
|
|
122
168
|
break;
|
|
169
|
+
|
|
123
170
|
case 'polyline':
|
|
124
171
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
125
172
|
resData.push({
|
|
@@ -128,21 +175,25 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
128
175
|
length: _this.map.calculateDistance(item.paths || item.geometry.paths)
|
|
129
176
|
});
|
|
130
177
|
});
|
|
178
|
+
|
|
131
179
|
default:
|
|
132
180
|
break;
|
|
133
181
|
}
|
|
182
|
+
|
|
134
183
|
return resData.length ? resData : null;
|
|
135
184
|
});
|
|
185
|
+
|
|
136
186
|
_this.map = null; //Map组件的ref对象
|
|
187
|
+
|
|
137
188
|
_this.mapLoaded = false;
|
|
138
189
|
_this.isDrawStatus = false;
|
|
139
190
|
_this.isClickMap = false;
|
|
140
191
|
_this.apid = []; //所有点id,除编辑点外
|
|
192
|
+
|
|
141
193
|
_this.loadExtent = null;
|
|
142
194
|
_this.mapId = "searchMap".concat(new Date().getTime());
|
|
143
195
|
_this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
|
|
144
|
-
_this.clickable = false,
|
|
145
|
-
// 多个面绘制时,是否可以点击面进行编辑
|
|
196
|
+
_this.clickable = false, // 多个面绘制时,是否可以点击面进行编辑
|
|
146
197
|
_this.state = {
|
|
147
198
|
//列表和地图宽度切换的动画需要
|
|
148
199
|
isShowList: false,
|
|
@@ -161,6 +212,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
161
212
|
graphicValue: _this.multiDraw ? [] : null,
|
|
162
213
|
// 绘制图元id集合
|
|
163
214
|
drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
|
|
215
|
+
|
|
164
216
|
/*地图Api参数*/
|
|
165
217
|
mapCenter: props.mapCenter || '',
|
|
166
218
|
maxZoom: props.maxZoom,
|
|
@@ -181,6 +233,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
181
233
|
editGraphic: _this.multiDraw ? [] : null,
|
|
182
234
|
mapZoomLevel: props.mapZoomLevel || 11,
|
|
183
235
|
setZoomLevel: false,
|
|
236
|
+
|
|
184
237
|
/*modal参数*/
|
|
185
238
|
modal1Visible: props.modal1Visible || false,
|
|
186
239
|
isShowOther: props.isShowOther || false,
|
|
@@ -197,28 +250,35 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
197
250
|
customNodes: props.customNodes || null
|
|
198
251
|
};
|
|
199
252
|
return _this;
|
|
200
|
-
}
|
|
253
|
+
} // 绘制多个图元时返回参数
|
|
254
|
+
|
|
255
|
+
|
|
201
256
|
_createClass(VtxSearchMap, [{
|
|
202
257
|
key: "callback",
|
|
203
|
-
value:
|
|
204
|
-
//经纬度回调
|
|
258
|
+
value: //经纬度回调
|
|
205
259
|
function callback() {
|
|
206
260
|
var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
|
|
261
|
+
|
|
207
262
|
if (fun in this.props && typeof this.props[fun] === 'function') {
|
|
208
263
|
var editGraphicId = this.state.editGraphicId;
|
|
264
|
+
|
|
209
265
|
switch (this.state.graphicType) {
|
|
210
266
|
case 'point':
|
|
211
267
|
var locationPoint = this.state.locationPoint;
|
|
268
|
+
|
|
212
269
|
if (this.map.getGraphic('locationPoint')) {
|
|
213
270
|
var p = this.map.getGraphic(locationPoint[0].id).geometry;
|
|
214
271
|
this.props[fun]([p.x, p.y]);
|
|
215
272
|
} else {
|
|
216
273
|
return [];
|
|
217
274
|
}
|
|
275
|
+
|
|
218
276
|
break;
|
|
277
|
+
|
|
219
278
|
case 'circle':
|
|
220
279
|
if (this.map.getGraphic(editGraphicId)) {
|
|
221
280
|
var _p = this.map.getGraphic(editGraphicId);
|
|
281
|
+
|
|
222
282
|
this.props[fun]({
|
|
223
283
|
x: _p.geometry.x,
|
|
224
284
|
y: _p.geometry.y,
|
|
@@ -233,14 +293,18 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
233
293
|
area: this.state.graphicValue.area
|
|
234
294
|
} : null);
|
|
235
295
|
}
|
|
296
|
+
|
|
236
297
|
break;
|
|
298
|
+
|
|
237
299
|
case 'polygon':
|
|
238
300
|
if (this.multiDraw) {
|
|
239
301
|
this.props[fun](this.getMultiRes('polygon'));
|
|
240
302
|
return;
|
|
241
303
|
}
|
|
304
|
+
|
|
242
305
|
if (this.map.getGraphic(editGraphicId)) {
|
|
243
306
|
var _p2 = this.map.getGraphic(editGraphicId);
|
|
307
|
+
|
|
244
308
|
this.props[fun]({
|
|
245
309
|
rings: distinct(_p2.geometry.rings),
|
|
246
310
|
area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
|
|
@@ -251,20 +315,25 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
251
315
|
area: this.state.graphicValue.area
|
|
252
316
|
} : null);
|
|
253
317
|
}
|
|
318
|
+
|
|
254
319
|
break;
|
|
320
|
+
|
|
255
321
|
case 'rectangle':
|
|
256
322
|
this.props[fun](this.state.graphicValue ? {
|
|
257
323
|
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
258
324
|
area: this.state.graphicValue.area
|
|
259
325
|
} : null);
|
|
260
326
|
break;
|
|
327
|
+
|
|
261
328
|
case 'polyline':
|
|
262
329
|
if (this.multiDraw) {
|
|
263
330
|
this.props[fun](this.getMultiRes('polyline'));
|
|
264
331
|
return;
|
|
265
332
|
}
|
|
333
|
+
|
|
266
334
|
if (this.map.getGraphic(editGraphicId)) {
|
|
267
335
|
var _p3 = this.map.getGraphic(editGraphicId);
|
|
336
|
+
|
|
268
337
|
this.props[fun]({
|
|
269
338
|
paths: _p3.geometry.paths,
|
|
270
339
|
length: this.map.calculateDistance(_p3.geometry.paths)
|
|
@@ -275,9 +344,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
275
344
|
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
276
345
|
} : null);
|
|
277
346
|
}
|
|
347
|
+
|
|
278
348
|
break;
|
|
279
349
|
}
|
|
280
350
|
}
|
|
351
|
+
|
|
281
352
|
if (this.props.clearDrawnGraph) {
|
|
282
353
|
this.clearDrawnGraph();
|
|
283
354
|
}
|
|
@@ -288,17 +359,18 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
288
359
|
this.setState({
|
|
289
360
|
isShowList: bealoon
|
|
290
361
|
});
|
|
291
|
-
}
|
|
292
|
-
|
|
362
|
+
} //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
|
|
363
|
+
|
|
293
364
|
}, {
|
|
294
365
|
key: "drawLocationPoint",
|
|
295
366
|
value: function drawLocationPoint() {
|
|
296
|
-
var t = this;
|
|
297
|
-
|
|
367
|
+
var t = this; //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
|
|
368
|
+
|
|
298
369
|
if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
|
|
299
370
|
var lglt = this.map.getMapExtent(),
|
|
300
|
-
|
|
301
|
-
|
|
371
|
+
editGraphic = null,
|
|
372
|
+
editGraphicId = 'locationPoint';
|
|
373
|
+
|
|
302
374
|
if (!this.multiDraw && this.props.editParam) {
|
|
303
375
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
304
376
|
editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
|
|
@@ -306,6 +378,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
306
378
|
});
|
|
307
379
|
editGraphicId = 'drawnGraph';
|
|
308
380
|
}
|
|
381
|
+
|
|
309
382
|
if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
|
|
310
383
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
311
384
|
editGraphic = this.props.editParam.map(function (item, index) {
|
|
@@ -315,6 +388,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
315
388
|
});
|
|
316
389
|
editGraphicId = null;
|
|
317
390
|
}
|
|
391
|
+
|
|
318
392
|
this.isinit = false;
|
|
319
393
|
this.setState({
|
|
320
394
|
editGraphic: editGraphic,
|
|
@@ -323,7 +397,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
323
397
|
longitude: (t.props.mapCenter || [])[0] || lglt.nowCenter.lng,
|
|
324
398
|
latitude: (t.props.mapCenter || [])[1] || lglt.nowCenter.lat,
|
|
325
399
|
// url: `${configUrl.mapServerURL}/images/defaultMarker.png`,
|
|
326
|
-
url:
|
|
400
|
+
url: _defaultMarker["default"],
|
|
327
401
|
config: {
|
|
328
402
|
zIndex: 1000
|
|
329
403
|
}
|
|
@@ -345,13 +419,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
345
419
|
t.drawLocationPoint();
|
|
346
420
|
}, 50);
|
|
347
421
|
}
|
|
348
|
-
}
|
|
349
|
-
|
|
422
|
+
} //校正定位的点位位置到当前的中心点
|
|
423
|
+
|
|
350
424
|
}, {
|
|
351
425
|
key: "correction",
|
|
352
426
|
value: function correction() {
|
|
353
|
-
var t = this;
|
|
354
|
-
|
|
427
|
+
var t = this; //获取当前中心点经纬度
|
|
428
|
+
|
|
355
429
|
var lglt = this.map.getMapExtent();
|
|
356
430
|
var locationPoint = t.state.locationPoint;
|
|
357
431
|
locationPoint = locationPoint.map(function (item, index) {
|
|
@@ -361,24 +435,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
361
435
|
});
|
|
362
436
|
});
|
|
363
437
|
this.map.updatePoint(locationPoint);
|
|
364
|
-
}
|
|
365
|
-
|
|
438
|
+
} //搜索关键字切换
|
|
439
|
+
|
|
366
440
|
}, {
|
|
367
441
|
key: "changeValue",
|
|
368
442
|
value: function changeValue(e) {
|
|
369
443
|
this.setState({
|
|
370
444
|
searchValue: e.target.value
|
|
371
445
|
});
|
|
372
|
-
}
|
|
373
|
-
|
|
446
|
+
} //根据关键字搜索数据
|
|
447
|
+
|
|
374
448
|
}, {
|
|
375
449
|
key: "searchList",
|
|
376
450
|
value: function searchList() {
|
|
377
451
|
var t = this;
|
|
452
|
+
|
|
378
453
|
if (!t.state.searchValue) {
|
|
379
454
|
_message["default"].warn("请输入搜索关键字");
|
|
455
|
+
|
|
380
456
|
return;
|
|
381
457
|
}
|
|
458
|
+
|
|
382
459
|
if (window.AMap) {
|
|
383
460
|
t.searchPoints();
|
|
384
461
|
} else {
|
|
@@ -417,10 +494,12 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
417
494
|
key: "handleSearch",
|
|
418
495
|
value: function handleSearch(results) {
|
|
419
496
|
var t = this;
|
|
497
|
+
|
|
420
498
|
if (results.length > 0) {
|
|
421
499
|
var lsp = [],
|
|
422
|
-
|
|
500
|
+
lsm = [];
|
|
423
501
|
t.apid = [];
|
|
502
|
+
|
|
424
503
|
for (var i = 0; i < results.length; i++) {
|
|
425
504
|
var r = results[i];
|
|
426
505
|
lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
|
|
@@ -435,6 +514,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
435
514
|
});
|
|
436
515
|
t.apid.push(r.id);
|
|
437
516
|
}
|
|
517
|
+
|
|
438
518
|
t.setState({
|
|
439
519
|
listPoint: lsp,
|
|
440
520
|
listMess: lsm,
|
|
@@ -444,13 +524,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
444
524
|
} else {
|
|
445
525
|
warning();
|
|
446
526
|
}
|
|
447
|
-
}
|
|
527
|
+
} //返回最佳位置(zoom,center)
|
|
448
528
|
|
|
449
|
-
//返回最佳位置(zoom,center)
|
|
450
529
|
}, {
|
|
451
530
|
key: "setFitView",
|
|
452
531
|
value: function setFitView() {
|
|
453
532
|
var _this2 = this;
|
|
533
|
+
|
|
454
534
|
this.setState({
|
|
455
535
|
mapVisiblePoints: {
|
|
456
536
|
fitView: this.apid,
|
|
@@ -462,8 +542,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
462
542
|
setVisiblePoints: false
|
|
463
543
|
});
|
|
464
544
|
});
|
|
465
|
-
}
|
|
466
|
-
|
|
545
|
+
} //清空列表的所有数据(包括点位)
|
|
546
|
+
|
|
467
547
|
}, {
|
|
468
548
|
key: "clearList",
|
|
469
549
|
value: function clearList() {
|
|
@@ -474,21 +554,21 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
474
554
|
listMess: [],
|
|
475
555
|
isShowList: false
|
|
476
556
|
});
|
|
477
|
-
}
|
|
478
|
-
|
|
557
|
+
} //列表选中地址
|
|
558
|
+
|
|
479
559
|
}, {
|
|
480
560
|
key: "chooseAddress",
|
|
481
561
|
value: function chooseAddress(id) {
|
|
482
562
|
var t = this;
|
|
483
563
|
var _this$state2 = this.state,
|
|
484
|
-
|
|
485
|
-
|
|
564
|
+
listPoint = _this$state2.listPoint,
|
|
565
|
+
listMess = _this$state2.listMess;
|
|
486
566
|
var mapCenter = [];
|
|
487
567
|
listPoint = listPoint.map(function (item, index) {
|
|
488
568
|
if (item.id === id) {
|
|
489
569
|
mapCenter = [item.longitude, item.latitude];
|
|
490
570
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
491
|
-
url:
|
|
571
|
+
url: _defaultMarker["default"],
|
|
492
572
|
labelClass: styles.showLabel
|
|
493
573
|
});
|
|
494
574
|
} else {
|
|
@@ -518,6 +598,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
518
598
|
t.setState({
|
|
519
599
|
setCenter: false
|
|
520
600
|
});
|
|
601
|
+
|
|
521
602
|
if (t.state.graphicType == 'point') {
|
|
522
603
|
t.correction();
|
|
523
604
|
}
|
|
@@ -527,11 +608,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
527
608
|
key: "clickGraphic",
|
|
528
609
|
value: function clickGraphic(obj) {
|
|
529
610
|
var _this3 = this;
|
|
611
|
+
|
|
530
612
|
if (obj.type === 'point' && obj.attributes.other === 'search') {
|
|
531
613
|
this.chooseAddress(obj.attributes.id);
|
|
532
614
|
}
|
|
615
|
+
|
|
533
616
|
if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
|
|
534
617
|
var _obj$param$attributes;
|
|
618
|
+
|
|
535
619
|
// 开启编辑
|
|
536
620
|
this.setState({
|
|
537
621
|
editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
|
|
@@ -548,6 +632,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
548
632
|
value: function closeModal(e) {
|
|
549
633
|
this.isDrawStatus = false;
|
|
550
634
|
this.isClickMap = false;
|
|
635
|
+
|
|
551
636
|
if (this.isDrawStatus && this.isClickMap) {
|
|
552
637
|
_message["default"].warning('请双击结束图元编辑');
|
|
553
638
|
} else {
|
|
@@ -557,16 +642,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
557
642
|
this.setState({
|
|
558
643
|
modal1Visible: false
|
|
559
644
|
});
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
// }
|
|
645
|
+
} // if(this.props.clearDrawnGraph){
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
this.clearDrawnGraph(); // }
|
|
564
649
|
}
|
|
565
650
|
}
|
|
566
651
|
}, {
|
|
567
652
|
key: "clearDrawnGraph",
|
|
568
653
|
value: function clearDrawnGraph() {
|
|
569
654
|
var _this4 = this;
|
|
655
|
+
|
|
570
656
|
this.isDrawStatus = true;
|
|
571
657
|
this.setState({
|
|
572
658
|
isDraw: this.state.graphicType !== 'point',
|
|
@@ -582,6 +668,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
582
668
|
key: "continueDraw",
|
|
583
669
|
value: function continueDraw(func) {
|
|
584
670
|
var _this5 = this;
|
|
671
|
+
|
|
585
672
|
this.clickable = false;
|
|
586
673
|
this.setState({
|
|
587
674
|
isDraw: false,
|
|
@@ -604,11 +691,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
604
691
|
key: "editGraphic",
|
|
605
692
|
value: function editGraphic() {
|
|
606
693
|
var _this6 = this;
|
|
694
|
+
|
|
607
695
|
if (this.isDrawStatus && this.isClickMap) {
|
|
608
696
|
_message["default"].warning('请双击结束图元编辑');
|
|
697
|
+
|
|
609
698
|
return;
|
|
610
699
|
}
|
|
700
|
+
|
|
611
701
|
_message["default"].info('请点击图元进行编辑');
|
|
702
|
+
|
|
612
703
|
this.clickable = true;
|
|
613
704
|
this.isDrawStatus = false;
|
|
614
705
|
this.setState({
|
|
@@ -628,8 +719,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
628
719
|
value: function editGraphicChange(obj) {
|
|
629
720
|
if (!this.multiDraw) return;
|
|
630
721
|
var _this$state3 = this.state,
|
|
631
|
-
|
|
632
|
-
|
|
722
|
+
graphicValue = _this$state3.graphicValue,
|
|
723
|
+
editGraphic = _this$state3.editGraphic;
|
|
633
724
|
this.setState({
|
|
634
725
|
graphicValue: (graphicValue || []).map(function (item) {
|
|
635
726
|
return item.id === obj.id ? obj : item;
|
|
@@ -648,6 +739,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
648
739
|
currentMap: str
|
|
649
740
|
});
|
|
650
741
|
var layers = [];
|
|
742
|
+
|
|
651
743
|
switch (mapType) {
|
|
652
744
|
case 'amap':
|
|
653
745
|
case 'bmap':
|
|
@@ -657,9 +749,12 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
657
749
|
} else {
|
|
658
750
|
t.map.setMapType('wx');
|
|
659
751
|
}
|
|
752
|
+
|
|
660
753
|
break;
|
|
754
|
+
|
|
661
755
|
case 'gmap':
|
|
662
756
|
break;
|
|
757
|
+
|
|
663
758
|
default:
|
|
664
759
|
break;
|
|
665
760
|
}
|
|
@@ -668,42 +763,43 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
668
763
|
key: "render",
|
|
669
764
|
value: function render() {
|
|
670
765
|
var _this7 = this;
|
|
766
|
+
|
|
671
767
|
var t = this;
|
|
672
768
|
var _this$state4 = this.state,
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
769
|
+
isShowList = _this$state4.isShowList,
|
|
770
|
+
searchValue = _this$state4.searchValue,
|
|
771
|
+
locationPoint = _this$state4.locationPoint,
|
|
772
|
+
listPoint = _this$state4.listPoint,
|
|
773
|
+
listMess = _this$state4.listMess,
|
|
774
|
+
mapZoomLevel = _this$state4.mapZoomLevel,
|
|
775
|
+
setZoomLevel = _this$state4.setZoomLevel,
|
|
776
|
+
maxZoom = _this$state4.maxZoom,
|
|
777
|
+
minZoom = _this$state4.minZoom,
|
|
778
|
+
wkid = _this$state4.wkid,
|
|
779
|
+
mapServer = _this$state4.mapServer,
|
|
780
|
+
mapCenter = _this$state4.mapCenter,
|
|
781
|
+
setCenter = _this$state4.setCenter,
|
|
782
|
+
mapType = _this$state4.mapType,
|
|
783
|
+
mapStyle = _this$state4.mapStyle,
|
|
784
|
+
mapVisiblePoints = _this$state4.mapVisiblePoints,
|
|
785
|
+
setVisiblePoints = _this$state4.setVisiblePoints,
|
|
786
|
+
isDoEdit = _this$state4.isDoEdit,
|
|
787
|
+
editGraphicId = _this$state4.editGraphicId,
|
|
788
|
+
isEndEdit = _this$state4.isEndEdit,
|
|
789
|
+
modal1Visible = _this$state4.modal1Visible,
|
|
790
|
+
drawGraphID = _this$state4.drawGraphID,
|
|
791
|
+
isShowOther = _this$state4.isShowOther,
|
|
792
|
+
otherText = _this$state4.otherText,
|
|
793
|
+
isShowOtherGraph = _this$state4.isShowOtherGraph,
|
|
794
|
+
editGraphic = _this$state4.editGraphic,
|
|
795
|
+
graphicType = _this$state4.graphicType,
|
|
796
|
+
graphicValue = _this$state4.graphicValue,
|
|
797
|
+
olProps = _this$state4.olProps,
|
|
798
|
+
isChangeMapType = _this$state4.isChangeMapType,
|
|
799
|
+
currentMap = _this$state4.currentMap,
|
|
800
|
+
showControl = _this$state4.showControl,
|
|
801
|
+
coverageType = _this$state4.coverageType,
|
|
802
|
+
customNodes = _this$state4.customNodes;
|
|
707
803
|
var InputProps = {
|
|
708
804
|
style: {
|
|
709
805
|
'width': '200px'
|
|
@@ -728,9 +824,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
728
824
|
isDoEdit: !_this7.multiDraw,
|
|
729
825
|
isDraw: _this7.multiDraw
|
|
730
826
|
};
|
|
827
|
+
|
|
731
828
|
if (!_this7.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
|
|
732
829
|
objparam.editGraphicId = obj.id;
|
|
733
830
|
}
|
|
831
|
+
|
|
734
832
|
_this7.setState(objparam);
|
|
735
833
|
},
|
|
736
834
|
mapDraw: {
|
|
@@ -762,42 +860,51 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
762
860
|
}
|
|
763
861
|
};
|
|
764
862
|
var mapPoints = [],
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
863
|
+
mapLines = [],
|
|
864
|
+
mapPolygons = [],
|
|
865
|
+
mapCircles = [];
|
|
866
|
+
|
|
768
867
|
if (graphicType == 'point') {
|
|
769
868
|
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
770
869
|
} else {
|
|
771
870
|
mapPoints = _toConsumableArray(listPoint);
|
|
772
871
|
}
|
|
872
|
+
|
|
773
873
|
if (graphicType === 'polygon') {
|
|
774
874
|
if (editGraphic) {
|
|
775
875
|
var _mapPolygons;
|
|
876
|
+
|
|
776
877
|
Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
|
|
777
878
|
!this.multiDraw && (drawProps = null);
|
|
778
879
|
}
|
|
779
880
|
}
|
|
881
|
+
|
|
780
882
|
if (graphicType === 'polyline') {
|
|
781
883
|
if (editGraphic) {
|
|
782
884
|
var _mapLines;
|
|
885
|
+
|
|
783
886
|
Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
|
|
784
887
|
!this.multiDraw && (drawProps = null);
|
|
785
888
|
}
|
|
786
889
|
}
|
|
890
|
+
|
|
787
891
|
if (graphicType === 'rectangle') {
|
|
788
892
|
if (editGraphic) {
|
|
789
893
|
mapPolygons.push(editGraphic);
|
|
790
894
|
drawProps = null;
|
|
791
895
|
}
|
|
792
896
|
}
|
|
897
|
+
|
|
793
898
|
if (graphicType === 'circle') {
|
|
794
899
|
if (editGraphic) {
|
|
795
900
|
mapCircles.push(editGraphic);
|
|
796
901
|
drawProps = null;
|
|
797
902
|
}
|
|
798
903
|
}
|
|
904
|
+
|
|
799
905
|
if (isShowOtherGraph) {
|
|
800
906
|
var otherGraph = this.props.otherGraph;
|
|
907
|
+
|
|
801
908
|
if (otherGraph) {
|
|
802
909
|
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
803
910
|
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
@@ -805,6 +912,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
805
912
|
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
806
913
|
}
|
|
807
914
|
}
|
|
915
|
+
|
|
808
916
|
return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
|
|
809
917
|
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
810
918
|
style: {
|
|
@@ -826,8 +934,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
826
934
|
onClick: function onClick() {
|
|
827
935
|
if (_this7.multiDraw && _this7.state.isDoEdit && !_this7.state.isEndEdit) {
|
|
828
936
|
_this7.continueDraw(_this7.callback.bind(_this7));
|
|
937
|
+
|
|
829
938
|
return;
|
|
830
939
|
}
|
|
940
|
+
|
|
831
941
|
_this7.callback();
|
|
832
942
|
},
|
|
833
943
|
icon: getIcon('check')
|
|
@@ -859,14 +969,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
859
969
|
disabled: this.isDrawStatus,
|
|
860
970
|
onClick: function onClick() {
|
|
861
971
|
_this7.isDrawStatus = true;
|
|
972
|
+
|
|
862
973
|
if (_this7.multiDraw) {
|
|
863
974
|
_this7.clickable = false;
|
|
864
|
-
graphicValue === null || graphicValue === void 0
|
|
975
|
+
graphicValue === null || graphicValue === void 0 ? void 0 : graphicValue.forEach(function (item) {
|
|
865
976
|
return t.map.removeGraphic(item.id, 'draw');
|
|
866
977
|
});
|
|
867
|
-
editGraphic === null || editGraphic === void 0
|
|
978
|
+
editGraphic === null || editGraphic === void 0 ? void 0 : editGraphic.forEach(function (item) {
|
|
868
979
|
return t.map.removeGraphic(item.id, 'draw');
|
|
869
980
|
});
|
|
981
|
+
|
|
870
982
|
_this7.setState({
|
|
871
983
|
isDraw: false,
|
|
872
984
|
isCloseDraw: true,
|
|
@@ -893,6 +1005,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
893
1005
|
});
|
|
894
1006
|
});
|
|
895
1007
|
}
|
|
1008
|
+
|
|
896
1009
|
_this7.callback('editDraw');
|
|
897
1010
|
},
|
|
898
1011
|
icon: getIcon('edit')
|
|
@@ -922,6 +1035,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
922
1035
|
onClick: function onClick(_ref) {
|
|
923
1036
|
var key = _ref.key;
|
|
924
1037
|
console.log(key);
|
|
1038
|
+
|
|
925
1039
|
_this7.setState({
|
|
926
1040
|
coverageType: key
|
|
927
1041
|
});
|
|
@@ -1016,11 +1130,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1016
1130
|
key: "initSearchMap",
|
|
1017
1131
|
value: function initSearchMap() {
|
|
1018
1132
|
var _this8 = this;
|
|
1019
|
-
|
|
1133
|
+
|
|
1134
|
+
if (this.props.modal1Visible
|
|
1135
|
+
/*&& !this.state.locationPoint[0]*/
|
|
1136
|
+
) {
|
|
1020
1137
|
if (this.map) {
|
|
1021
1138
|
this.map.loadMapComplete.then(function () {
|
|
1022
1139
|
if (!_this8.mapLoaded) {
|
|
1023
1140
|
_this8.mapLoaded = true;
|
|
1141
|
+
|
|
1024
1142
|
_this8.drawLocationPoint();
|
|
1025
1143
|
}
|
|
1026
1144
|
});
|
|
@@ -1040,19 +1158,23 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1040
1158
|
this.initSearchMap();
|
|
1041
1159
|
}
|
|
1042
1160
|
}, {
|
|
1043
|
-
key: "
|
|
1044
|
-
value: function
|
|
1161
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
1162
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
1045
1163
|
var _this9 = this;
|
|
1164
|
+
|
|
1046
1165
|
var t = this;
|
|
1047
1166
|
this.isClickMap = false;
|
|
1167
|
+
|
|
1048
1168
|
if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
|
|
1049
1169
|
this.map.clearAll();
|
|
1050
1170
|
t.mapLoaded = false;
|
|
1051
1171
|
t.isinit = true;
|
|
1052
1172
|
}
|
|
1173
|
+
|
|
1053
1174
|
if (nextProps.editParam) {
|
|
1054
1175
|
t.mapLoaded = false;
|
|
1055
1176
|
}
|
|
1177
|
+
|
|
1056
1178
|
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
1057
1179
|
this.setState({
|
|
1058
1180
|
modal1Visible: nextProps.modal1Visible,
|
|
@@ -1077,6 +1199,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1077
1199
|
//实现2+次进入时,清理数据
|
|
1078
1200
|
if (nextProps.modal1Visible) {
|
|
1079
1201
|
_this9.clearList();
|
|
1202
|
+
|
|
1080
1203
|
_this9.setState({
|
|
1081
1204
|
setZoomLevel: true
|
|
1082
1205
|
}, function () {
|
|
@@ -1084,27 +1207,39 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1084
1207
|
setZoomLevel: false
|
|
1085
1208
|
});
|
|
1086
1209
|
});
|
|
1210
|
+
|
|
1087
1211
|
if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
1088
1212
|
if (_this9.map.getGraphic('locationPoint')) {
|
|
1089
1213
|
switch (nextProps.mapType) {
|
|
1090
1214
|
case 'bmap':
|
|
1091
1215
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1216
|
+
|
|
1092
1217
|
break;
|
|
1218
|
+
|
|
1093
1219
|
case 'amap':
|
|
1094
1220
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1221
|
+
|
|
1095
1222
|
break;
|
|
1223
|
+
|
|
1096
1224
|
case 'tmap':
|
|
1097
1225
|
_this9.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1226
|
+
|
|
1098
1227
|
break;
|
|
1228
|
+
|
|
1099
1229
|
case 'gmap':
|
|
1100
1230
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
1231
|
+
|
|
1101
1232
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
1233
|
+
|
|
1102
1234
|
_this9.map.state.gis.graphics.refresh();
|
|
1235
|
+
|
|
1103
1236
|
case 'olMap':
|
|
1104
1237
|
_this9.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
1238
|
+
|
|
1105
1239
|
break;
|
|
1106
1240
|
}
|
|
1107
1241
|
}
|
|
1242
|
+
|
|
1108
1243
|
_this9.map.setCenter(nextProps.mapCenter);
|
|
1109
1244
|
}
|
|
1110
1245
|
}
|
|
@@ -1115,13 +1250,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1115
1250
|
value: function componentWillUnmount() {
|
|
1116
1251
|
//关闭moveTo定时
|
|
1117
1252
|
var t = this;
|
|
1253
|
+
|
|
1118
1254
|
if (t.loadExtent) {
|
|
1119
1255
|
clearInterval(t.loadExtent);
|
|
1120
1256
|
}
|
|
1121
1257
|
}
|
|
1122
1258
|
}]);
|
|
1259
|
+
|
|
1123
1260
|
return VtxSearchMap;
|
|
1124
1261
|
}(_react["default"].Component);
|
|
1125
|
-
|
|
1262
|
+
|
|
1263
|
+
var _default = VtxSearchMap;
|
|
1264
|
+
exports["default"] = _default;
|
|
1126
1265
|
module.exports = exports["default"];
|
|
1127
1266
|
//# sourceMappingURL=VtxSearchMap.js.map
|