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