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