@vtx/map 1.1.46 → 1.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/VtxMap/AMap/AMap.js +630 -1000
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +747 -1195
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/GMap/Map.js +1046 -1564
- package/lib/VtxMap/GMap/Map.js.map +1 -1
- package/lib/VtxMap/Map.js +8 -42
- package/lib/VtxMap/Map.js.map +1 -1
- package/lib/VtxMap/MapToolFunction.js +26 -63
- package/lib/VtxMap/MapToolFunction.js.map +1 -1
- package/lib/VtxMap/OMap/Map.js +867 -1361
- package/lib/VtxMap/OMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.js +717 -1225
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +651 -1058
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/lib/VtxMap/index.js +1 -8
- package/lib/VtxMap/index.js.map +1 -1
- package/lib/VtxMap/mapPlayer.js +67 -123
- package/lib/VtxMap/mapPlayer.js.map +1 -1
- package/lib/VtxMap/optimizingPointMap.js +21 -77
- package/lib/VtxMap/optimizingPointMap.js.map +1 -1
- package/lib/VtxMap/style/css.js +0 -6
- package/lib/VtxMap/style/css.js.map +1 -1
- package/lib/VtxMap/style/index.js +0 -6
- package/lib/VtxMap/style/index.js.map +1 -1
- package/lib/VtxMap/zoomMap.js +12 -41
- package/lib/VtxMap/zoomMap.js.map +1 -1
- package/lib/VtxModal/VtxModal.js +19 -63
- package/lib/VtxModal/VtxModal.js.map +1 -1
- package/lib/VtxModal/draggableModal.js +12 -48
- package/lib/VtxModal/draggableModal.js.map +1 -1
- package/lib/VtxModal/index.js +1 -6
- package/lib/VtxModal/index.js.map +1 -1
- package/lib/VtxModal/style/css.js +0 -6
- package/lib/VtxModal/style/css.js.map +1 -1
- package/lib/VtxModal/style/index.js +0 -6
- package/lib/VtxModal/style/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.css +5 -5
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js +106 -239
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.less +2 -2
- package/lib/VtxSearchCheckMap/index.js +0 -2
- package/lib/VtxSearchCheckMap/index.js.map +1 -1
- package/lib/VtxSearchCheckMap/mapping.js +1 -2
- package/lib/VtxSearchCheckMap/mapping.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/css.js +0 -19
- package/lib/VtxSearchCheckMap/style/css.js.map +1 -1
- package/lib/VtxSearchCheckMap/style/index.js +0 -19
- package/lib/VtxSearchCheckMap/style/index.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.css +25 -20
- package/lib/VtxSearchMap/VtxSearchMap.js +114 -240
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
- package/lib/VtxSearchMap/VtxSearchMap.less +33 -20
- package/lib/VtxSearchMap/index.js +0 -2
- package/lib/VtxSearchMap/index.js.map +1 -1
- package/lib/VtxSearchMap/mapping.js +1 -2
- package/lib/VtxSearchMap/mapping.js.map +1 -1
- package/lib/VtxSearchMap/style/css.js +0 -19
- package/lib/VtxSearchMap/style/css.js.map +1 -1
- package/lib/VtxSearchMap/style/index.js +0 -19
- package/lib/VtxSearchMap/style/index.js.map +1 -1
- package/lib/default.js +4 -13
- package/lib/default.js.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/utils/util.js +5 -17
- package/lib/utils/util.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,88 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
13
|
-
|
|
14
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
-
|
|
16
11
|
var _message = _interopRequireDefault(require("antd/lib/message"));
|
|
17
|
-
|
|
18
12
|
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
19
|
-
|
|
20
13
|
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
21
|
-
|
|
22
14
|
var _VtxModal = require("../VtxModal");
|
|
23
|
-
|
|
24
15
|
var _VtxMap = require("../VtxMap");
|
|
25
|
-
|
|
26
16
|
var _default2 = _interopRequireWildcard(require("../default"));
|
|
27
|
-
|
|
28
17
|
var _mapping = require("./mapping");
|
|
29
|
-
|
|
30
18
|
var _util = require("../utils/util");
|
|
31
|
-
|
|
32
19
|
var _antd = require("antd");
|
|
33
|
-
|
|
34
20
|
var _DownOutlined = _interopRequireDefault(require("@ant-design/icons/DownOutlined"));
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
40
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
-
|
|
42
24
|
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); }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
49
|
-
|
|
50
|
-
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); } }
|
|
51
|
-
|
|
28
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
52
29
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
|
-
|
|
54
30
|
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); }
|
|
55
|
-
|
|
56
31
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
57
|
-
|
|
58
32
|
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); }; }
|
|
59
|
-
|
|
60
33
|
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); }
|
|
61
|
-
|
|
62
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
63
|
-
|
|
64
35
|
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; } }
|
|
65
|
-
|
|
66
36
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
67
|
-
|
|
68
|
-
function
|
|
69
|
-
|
|
37
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
39
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
70
40
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
71
|
-
|
|
72
41
|
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."); }
|
|
73
|
-
|
|
74
42
|
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); }
|
|
75
|
-
|
|
76
43
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
77
|
-
|
|
78
44
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
79
|
-
|
|
80
|
-
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; }
|
|
81
|
-
|
|
45
|
+
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; } //公共地址配置
|
|
82
46
|
var styles = {
|
|
83
47
|
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
84
48
|
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
85
49
|
top: 'vtx-ui-searchmap-top',
|
|
50
|
+
top_left: 'vtx-ui-searchmap-top-left',
|
|
51
|
+
top_right: 'vtx-ui-searchmap-top-right',
|
|
86
52
|
bottom: 'vtx-ui-searchmap-bottom',
|
|
87
53
|
content: 'vtx-ui-searchmap-content',
|
|
88
54
|
show: 'vtx-ui-searchmap-show',
|
|
@@ -108,18 +74,17 @@ var CoverageTypes = [{
|
|
|
108
74
|
}, {
|
|
109
75
|
name: '卫星底图',
|
|
110
76
|
key: 'wx'
|
|
111
|
-
}];
|
|
77
|
+
}];
|
|
78
|
+
|
|
79
|
+
// message.config({
|
|
112
80
|
// top: document.getElementById('root').offsetHeight/3,
|
|
113
81
|
// duration: 5,
|
|
114
82
|
// });
|
|
115
|
-
|
|
116
83
|
var warning = function warning() {
|
|
117
84
|
_message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
|
|
118
85
|
};
|
|
119
|
-
|
|
120
86
|
function distinct(ary) {
|
|
121
87
|
var pts = _toConsumableArray(ary);
|
|
122
|
-
|
|
123
88
|
if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
|
|
124
89
|
pts.pop();
|
|
125
90
|
return distinct(pts);
|
|
@@ -127,67 +92,57 @@ function distinct(ary) {
|
|
|
127
92
|
return pts;
|
|
128
93
|
}
|
|
129
94
|
}
|
|
130
|
-
|
|
131
95
|
var getIcon = function getIcon(type) {
|
|
132
96
|
return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
133
97
|
type: "icon-".concat(_mapping.iconMapping[type])
|
|
134
98
|
}) : type;
|
|
135
99
|
};
|
|
136
|
-
|
|
137
100
|
var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
138
101
|
_inherits(VtxSearchMap, _React$Component);
|
|
139
|
-
|
|
140
102
|
var _super = _createSuper(VtxSearchMap);
|
|
141
|
-
|
|
142
103
|
function VtxSearchMap(props) {
|
|
143
104
|
var _this;
|
|
144
|
-
|
|
145
105
|
_classCallCheck(this, VtxSearchMap);
|
|
146
|
-
|
|
147
106
|
_this = _super.call(this, props);
|
|
148
|
-
|
|
107
|
+
// 绘制多个图元时返回参数
|
|
149
108
|
_defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
|
|
150
109
|
var resData = [];
|
|
151
110
|
var _this$state = _this.state,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
111
|
+
graphicValue = _this$state.graphicValue,
|
|
112
|
+
editGraphic = _this$state.editGraphic;
|
|
155
113
|
switch (graphicType) {
|
|
156
114
|
case 'polygon':
|
|
157
115
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
158
116
|
resData.push({
|
|
117
|
+
id: item.id,
|
|
159
118
|
rings: distinct(item.rings || item.geometry.rings),
|
|
160
119
|
area: _this.map.getPolygonArea(distinct(item.rings || item.geometry.rings))
|
|
161
120
|
});
|
|
162
121
|
});
|
|
163
122
|
break;
|
|
164
|
-
|
|
165
123
|
case 'polyline':
|
|
166
124
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
167
125
|
resData.push({
|
|
126
|
+
id: item.id,
|
|
168
127
|
paths: item.paths || item.geometry.paths,
|
|
169
128
|
length: _this.map.calculateDistance(item.paths || item.geometry.paths)
|
|
170
129
|
});
|
|
171
130
|
});
|
|
172
|
-
|
|
173
131
|
default:
|
|
174
132
|
break;
|
|
175
133
|
}
|
|
176
|
-
|
|
177
134
|
return resData.length ? resData : null;
|
|
178
135
|
});
|
|
179
|
-
|
|
180
136
|
_this.map = null; //Map组件的ref对象
|
|
181
|
-
|
|
182
137
|
_this.mapLoaded = false;
|
|
183
138
|
_this.isDrawStatus = false;
|
|
184
139
|
_this.isClickMap = false;
|
|
185
140
|
_this.apid = []; //所有点id,除编辑点外
|
|
186
|
-
|
|
187
141
|
_this.loadExtent = null;
|
|
188
142
|
_this.mapId = "searchMap".concat(new Date().getTime());
|
|
189
143
|
_this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
|
|
190
|
-
_this.clickable = false,
|
|
144
|
+
_this.clickable = false,
|
|
145
|
+
// 多个面绘制时,是否可以点击面进行编辑
|
|
191
146
|
_this.state = {
|
|
192
147
|
//列表和地图宽度切换的动画需要
|
|
193
148
|
isShowList: false,
|
|
@@ -206,7 +161,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
206
161
|
graphicValue: _this.multiDraw ? [] : null,
|
|
207
162
|
// 绘制图元id集合
|
|
208
163
|
drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
|
|
209
|
-
|
|
210
164
|
/*地图Api参数*/
|
|
211
165
|
mapCenter: props.mapCenter || '',
|
|
212
166
|
maxZoom: props.maxZoom,
|
|
@@ -227,7 +181,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
227
181
|
editGraphic: _this.multiDraw ? [] : null,
|
|
228
182
|
mapZoomLevel: props.mapZoomLevel || 11,
|
|
229
183
|
setZoomLevel: false,
|
|
230
|
-
|
|
231
184
|
/*modal参数*/
|
|
232
185
|
modal1Visible: props.modal1Visible || false,
|
|
233
186
|
isShowOther: props.isShowOther || false,
|
|
@@ -239,38 +192,33 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
239
192
|
isChangeMapType: props.isChangeMapType || true,
|
|
240
193
|
currentMap: 'normal',
|
|
241
194
|
showControl: props.showControl || false,
|
|
242
|
-
coverageType: props.coverageType || 'sl'
|
|
195
|
+
coverageType: props.coverageType || 'sl',
|
|
196
|
+
// 自定义右上角功能
|
|
197
|
+
customNodes: props.customNodes || null
|
|
243
198
|
};
|
|
244
199
|
return _this;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
200
|
+
}
|
|
248
201
|
_createClass(VtxSearchMap, [{
|
|
249
202
|
key: "callback",
|
|
250
|
-
value:
|
|
203
|
+
value:
|
|
204
|
+
//经纬度回调
|
|
251
205
|
function callback() {
|
|
252
206
|
var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
|
|
253
|
-
|
|
254
207
|
if (fun in this.props && typeof this.props[fun] === 'function') {
|
|
255
208
|
var editGraphicId = this.state.editGraphicId;
|
|
256
|
-
|
|
257
209
|
switch (this.state.graphicType) {
|
|
258
210
|
case 'point':
|
|
259
211
|
var locationPoint = this.state.locationPoint;
|
|
260
|
-
|
|
261
212
|
if (this.map.getGraphic('locationPoint')) {
|
|
262
213
|
var p = this.map.getGraphic(locationPoint[0].id).geometry;
|
|
263
214
|
this.props[fun]([p.x, p.y]);
|
|
264
215
|
} else {
|
|
265
216
|
return [];
|
|
266
217
|
}
|
|
267
|
-
|
|
268
218
|
break;
|
|
269
|
-
|
|
270
219
|
case 'circle':
|
|
271
220
|
if (this.map.getGraphic(editGraphicId)) {
|
|
272
221
|
var _p = this.map.getGraphic(editGraphicId);
|
|
273
|
-
|
|
274
222
|
this.props[fun]({
|
|
275
223
|
x: _p.geometry.x,
|
|
276
224
|
y: _p.geometry.y,
|
|
@@ -285,18 +233,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
285
233
|
area: this.state.graphicValue.area
|
|
286
234
|
} : null);
|
|
287
235
|
}
|
|
288
|
-
|
|
289
236
|
break;
|
|
290
|
-
|
|
291
237
|
case 'polygon':
|
|
292
238
|
if (this.multiDraw) {
|
|
293
239
|
this.props[fun](this.getMultiRes('polygon'));
|
|
294
240
|
return;
|
|
295
241
|
}
|
|
296
|
-
|
|
297
242
|
if (this.map.getGraphic(editGraphicId)) {
|
|
298
243
|
var _p2 = this.map.getGraphic(editGraphicId);
|
|
299
|
-
|
|
300
244
|
this.props[fun]({
|
|
301
245
|
rings: distinct(_p2.geometry.rings),
|
|
302
246
|
area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
|
|
@@ -307,25 +251,20 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
307
251
|
area: this.state.graphicValue.area
|
|
308
252
|
} : null);
|
|
309
253
|
}
|
|
310
|
-
|
|
311
254
|
break;
|
|
312
|
-
|
|
313
255
|
case 'rectangle':
|
|
314
256
|
this.props[fun](this.state.graphicValue ? {
|
|
315
257
|
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
316
258
|
area: this.state.graphicValue.area
|
|
317
259
|
} : null);
|
|
318
260
|
break;
|
|
319
|
-
|
|
320
261
|
case 'polyline':
|
|
321
262
|
if (this.multiDraw) {
|
|
322
263
|
this.props[fun](this.getMultiRes('polyline'));
|
|
323
264
|
return;
|
|
324
265
|
}
|
|
325
|
-
|
|
326
266
|
if (this.map.getGraphic(editGraphicId)) {
|
|
327
267
|
var _p3 = this.map.getGraphic(editGraphicId);
|
|
328
|
-
|
|
329
268
|
this.props[fun]({
|
|
330
269
|
paths: _p3.geometry.paths,
|
|
331
270
|
length: this.map.calculateDistance(_p3.geometry.paths)
|
|
@@ -336,11 +275,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
336
275
|
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
337
276
|
} : null);
|
|
338
277
|
}
|
|
339
|
-
|
|
340
278
|
break;
|
|
341
279
|
}
|
|
342
280
|
}
|
|
343
|
-
|
|
344
281
|
if (this.props.clearDrawnGraph) {
|
|
345
282
|
this.clearDrawnGraph();
|
|
346
283
|
}
|
|
@@ -351,18 +288,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
351
288
|
this.setState({
|
|
352
289
|
isShowList: bealoon
|
|
353
290
|
});
|
|
354
|
-
}
|
|
355
|
-
|
|
291
|
+
}
|
|
292
|
+
//绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
|
|
356
293
|
}, {
|
|
357
294
|
key: "drawLocationPoint",
|
|
358
295
|
value: function drawLocationPoint() {
|
|
359
|
-
var t = this;
|
|
360
|
-
|
|
296
|
+
var t = this;
|
|
297
|
+
//判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
|
|
361
298
|
if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
|
|
362
299
|
var lglt = this.map.getMapExtent(),
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
300
|
+
editGraphic = null,
|
|
301
|
+
editGraphicId = 'locationPoint';
|
|
366
302
|
if (!this.multiDraw && this.props.editParam) {
|
|
367
303
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
368
304
|
editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
|
|
@@ -370,17 +306,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
370
306
|
});
|
|
371
307
|
editGraphicId = 'drawnGraph';
|
|
372
308
|
}
|
|
373
|
-
|
|
374
309
|
if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
|
|
375
310
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
376
311
|
editGraphic = this.props.editParam.map(function (item, index) {
|
|
377
312
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
378
|
-
id: "drawnGraph".concat(index)
|
|
313
|
+
id: item.id || "drawnGraph".concat(index)
|
|
379
314
|
});
|
|
380
315
|
});
|
|
381
316
|
editGraphicId = null;
|
|
382
317
|
}
|
|
383
|
-
|
|
384
318
|
this.isinit = false;
|
|
385
319
|
this.setState({
|
|
386
320
|
editGraphic: editGraphic,
|
|
@@ -411,13 +345,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
411
345
|
t.drawLocationPoint();
|
|
412
346
|
}, 50);
|
|
413
347
|
}
|
|
414
|
-
}
|
|
415
|
-
|
|
348
|
+
}
|
|
349
|
+
//校正定位的点位位置到当前的中心点
|
|
416
350
|
}, {
|
|
417
351
|
key: "correction",
|
|
418
352
|
value: function correction() {
|
|
419
|
-
var t = this;
|
|
420
|
-
|
|
353
|
+
var t = this;
|
|
354
|
+
//获取当前中心点经纬度
|
|
421
355
|
var lglt = this.map.getMapExtent();
|
|
422
356
|
var locationPoint = t.state.locationPoint;
|
|
423
357
|
locationPoint = locationPoint.map(function (item, index) {
|
|
@@ -427,27 +361,24 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
427
361
|
});
|
|
428
362
|
});
|
|
429
363
|
this.map.updatePoint(locationPoint);
|
|
430
|
-
}
|
|
431
|
-
|
|
364
|
+
}
|
|
365
|
+
//搜索关键字切换
|
|
432
366
|
}, {
|
|
433
367
|
key: "changeValue",
|
|
434
368
|
value: function changeValue(e) {
|
|
435
369
|
this.setState({
|
|
436
370
|
searchValue: e.target.value
|
|
437
371
|
});
|
|
438
|
-
}
|
|
439
|
-
|
|
372
|
+
}
|
|
373
|
+
//根据关键字搜索数据
|
|
440
374
|
}, {
|
|
441
375
|
key: "searchList",
|
|
442
376
|
value: function searchList() {
|
|
443
377
|
var t = this;
|
|
444
|
-
|
|
445
378
|
if (!t.state.searchValue) {
|
|
446
379
|
_message["default"].warn("请输入搜索关键字");
|
|
447
|
-
|
|
448
380
|
return;
|
|
449
381
|
}
|
|
450
|
-
|
|
451
382
|
if (window.AMap) {
|
|
452
383
|
t.searchPoints();
|
|
453
384
|
} else {
|
|
@@ -486,12 +417,10 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
486
417
|
key: "handleSearch",
|
|
487
418
|
value: function handleSearch(results) {
|
|
488
419
|
var t = this;
|
|
489
|
-
|
|
490
420
|
if (results.length > 0) {
|
|
491
421
|
var lsp = [],
|
|
492
|
-
|
|
422
|
+
lsm = [];
|
|
493
423
|
t.apid = [];
|
|
494
|
-
|
|
495
424
|
for (var i = 0; i < results.length; i++) {
|
|
496
425
|
var r = results[i];
|
|
497
426
|
lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
|
|
@@ -506,7 +435,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
506
435
|
});
|
|
507
436
|
t.apid.push(r.id);
|
|
508
437
|
}
|
|
509
|
-
|
|
510
438
|
t.setState({
|
|
511
439
|
listPoint: lsp,
|
|
512
440
|
listMess: lsm,
|
|
@@ -516,13 +444,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
516
444
|
} else {
|
|
517
445
|
warning();
|
|
518
446
|
}
|
|
519
|
-
}
|
|
447
|
+
}
|
|
520
448
|
|
|
449
|
+
//返回最佳位置(zoom,center)
|
|
521
450
|
}, {
|
|
522
451
|
key: "setFitView",
|
|
523
452
|
value: function setFitView() {
|
|
524
453
|
var _this2 = this;
|
|
525
|
-
|
|
526
454
|
this.setState({
|
|
527
455
|
mapVisiblePoints: {
|
|
528
456
|
fitView: this.apid,
|
|
@@ -534,8 +462,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
534
462
|
setVisiblePoints: false
|
|
535
463
|
});
|
|
536
464
|
});
|
|
537
|
-
}
|
|
538
|
-
|
|
465
|
+
}
|
|
466
|
+
//清空列表的所有数据(包括点位)
|
|
539
467
|
}, {
|
|
540
468
|
key: "clearList",
|
|
541
469
|
value: function clearList() {
|
|
@@ -546,15 +474,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
546
474
|
listMess: [],
|
|
547
475
|
isShowList: false
|
|
548
476
|
});
|
|
549
|
-
}
|
|
550
|
-
|
|
477
|
+
}
|
|
478
|
+
//列表选中地址
|
|
551
479
|
}, {
|
|
552
480
|
key: "chooseAddress",
|
|
553
481
|
value: function chooseAddress(id) {
|
|
554
482
|
var t = this;
|
|
555
483
|
var _this$state2 = this.state,
|
|
556
|
-
|
|
557
|
-
|
|
484
|
+
listPoint = _this$state2.listPoint,
|
|
485
|
+
listMess = _this$state2.listMess;
|
|
558
486
|
var mapCenter = [];
|
|
559
487
|
listPoint = listPoint.map(function (item, index) {
|
|
560
488
|
if (item.id === id) {
|
|
@@ -590,7 +518,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
590
518
|
t.setState({
|
|
591
519
|
setCenter: false
|
|
592
520
|
});
|
|
593
|
-
|
|
594
521
|
if (t.state.graphicType == 'point') {
|
|
595
522
|
t.correction();
|
|
596
523
|
}
|
|
@@ -600,14 +527,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
600
527
|
key: "clickGraphic",
|
|
601
528
|
value: function clickGraphic(obj) {
|
|
602
529
|
var _this3 = this;
|
|
603
|
-
|
|
604
530
|
if (obj.type === 'point' && obj.attributes.other === 'search') {
|
|
605
531
|
this.chooseAddress(obj.attributes.id);
|
|
606
532
|
}
|
|
607
|
-
|
|
608
533
|
if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
|
|
609
534
|
var _obj$param$attributes;
|
|
610
|
-
|
|
611
535
|
// 开启编辑
|
|
612
536
|
this.setState({
|
|
613
537
|
editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
|
|
@@ -624,7 +548,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
624
548
|
value: function closeModal(e) {
|
|
625
549
|
this.isDrawStatus = false;
|
|
626
550
|
this.isClickMap = false;
|
|
627
|
-
|
|
628
551
|
if (this.isDrawStatus && this.isClickMap) {
|
|
629
552
|
_message["default"].warning('请双击结束图元编辑');
|
|
630
553
|
} else {
|
|
@@ -634,17 +557,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
634
557
|
this.setState({
|
|
635
558
|
modal1Visible: false
|
|
636
559
|
});
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
560
|
+
}
|
|
561
|
+
// if(this.props.clearDrawnGraph){
|
|
562
|
+
this.clearDrawnGraph();
|
|
563
|
+
// }
|
|
641
564
|
}
|
|
642
565
|
}
|
|
643
566
|
}, {
|
|
644
567
|
key: "clearDrawnGraph",
|
|
645
568
|
value: function clearDrawnGraph() {
|
|
646
569
|
var _this4 = this;
|
|
647
|
-
|
|
648
570
|
this.isDrawStatus = true;
|
|
649
571
|
this.setState({
|
|
650
572
|
isDraw: this.state.graphicType !== 'point',
|
|
@@ -660,7 +582,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
660
582
|
key: "continueDraw",
|
|
661
583
|
value: function continueDraw(func) {
|
|
662
584
|
var _this5 = this;
|
|
663
|
-
|
|
664
585
|
this.clickable = false;
|
|
665
586
|
this.setState({
|
|
666
587
|
isDraw: false,
|
|
@@ -683,15 +604,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
683
604
|
key: "editGraphic",
|
|
684
605
|
value: function editGraphic() {
|
|
685
606
|
var _this6 = this;
|
|
686
|
-
|
|
687
607
|
if (this.isDrawStatus && this.isClickMap) {
|
|
688
608
|
_message["default"].warning('请双击结束图元编辑');
|
|
689
|
-
|
|
690
609
|
return;
|
|
691
610
|
}
|
|
692
|
-
|
|
693
611
|
_message["default"].info('请点击图元进行编辑');
|
|
694
|
-
|
|
695
612
|
this.clickable = true;
|
|
696
613
|
this.isDrawStatus = false;
|
|
697
614
|
this.setState({
|
|
@@ -711,8 +628,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
711
628
|
value: function editGraphicChange(obj) {
|
|
712
629
|
if (!this.multiDraw) return;
|
|
713
630
|
var _this$state3 = this.state,
|
|
714
|
-
|
|
715
|
-
|
|
631
|
+
graphicValue = _this$state3.graphicValue,
|
|
632
|
+
editGraphic = _this$state3.editGraphic;
|
|
716
633
|
this.setState({
|
|
717
634
|
graphicValue: (graphicValue || []).map(function (item) {
|
|
718
635
|
return item.id === obj.id ? obj : item;
|
|
@@ -731,7 +648,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
731
648
|
currentMap: str
|
|
732
649
|
});
|
|
733
650
|
var layers = [];
|
|
734
|
-
|
|
735
651
|
switch (mapType) {
|
|
736
652
|
case 'amap':
|
|
737
653
|
case 'bmap':
|
|
@@ -741,12 +657,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
741
657
|
} else {
|
|
742
658
|
t.map.setMapType('wx');
|
|
743
659
|
}
|
|
744
|
-
|
|
745
660
|
break;
|
|
746
|
-
|
|
747
661
|
case 'gmap':
|
|
748
662
|
break;
|
|
749
|
-
|
|
750
663
|
default:
|
|
751
664
|
break;
|
|
752
665
|
}
|
|
@@ -755,42 +668,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
755
668
|
key: "render",
|
|
756
669
|
value: function render() {
|
|
757
670
|
var _this7 = this;
|
|
758
|
-
|
|
759
671
|
var t = this;
|
|
760
672
|
var _this$state4 = this.state,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
673
|
+
isShowList = _this$state4.isShowList,
|
|
674
|
+
searchValue = _this$state4.searchValue,
|
|
675
|
+
locationPoint = _this$state4.locationPoint,
|
|
676
|
+
listPoint = _this$state4.listPoint,
|
|
677
|
+
listMess = _this$state4.listMess,
|
|
678
|
+
mapZoomLevel = _this$state4.mapZoomLevel,
|
|
679
|
+
setZoomLevel = _this$state4.setZoomLevel,
|
|
680
|
+
maxZoom = _this$state4.maxZoom,
|
|
681
|
+
minZoom = _this$state4.minZoom,
|
|
682
|
+
wkid = _this$state4.wkid,
|
|
683
|
+
mapServer = _this$state4.mapServer,
|
|
684
|
+
mapCenter = _this$state4.mapCenter,
|
|
685
|
+
setCenter = _this$state4.setCenter,
|
|
686
|
+
mapType = _this$state4.mapType,
|
|
687
|
+
mapStyle = _this$state4.mapStyle,
|
|
688
|
+
mapVisiblePoints = _this$state4.mapVisiblePoints,
|
|
689
|
+
setVisiblePoints = _this$state4.setVisiblePoints,
|
|
690
|
+
isDoEdit = _this$state4.isDoEdit,
|
|
691
|
+
editGraphicId = _this$state4.editGraphicId,
|
|
692
|
+
isEndEdit = _this$state4.isEndEdit,
|
|
693
|
+
modal1Visible = _this$state4.modal1Visible,
|
|
694
|
+
drawGraphID = _this$state4.drawGraphID,
|
|
695
|
+
isShowOther = _this$state4.isShowOther,
|
|
696
|
+
otherText = _this$state4.otherText,
|
|
697
|
+
isShowOtherGraph = _this$state4.isShowOtherGraph,
|
|
698
|
+
editGraphic = _this$state4.editGraphic,
|
|
699
|
+
graphicType = _this$state4.graphicType,
|
|
700
|
+
graphicValue = _this$state4.graphicValue,
|
|
701
|
+
olProps = _this$state4.olProps,
|
|
702
|
+
isChangeMapType = _this$state4.isChangeMapType,
|
|
703
|
+
currentMap = _this$state4.currentMap,
|
|
704
|
+
showControl = _this$state4.showControl,
|
|
705
|
+
coverageType = _this$state4.coverageType,
|
|
706
|
+
customNodes = _this$state4.customNodes;
|
|
794
707
|
var InputProps = {
|
|
795
708
|
style: {
|
|
796
709
|
'width': '200px'
|
|
@@ -815,11 +728,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
815
728
|
isDoEdit: !_this7.multiDraw,
|
|
816
729
|
isDraw: _this7.multiDraw
|
|
817
730
|
};
|
|
818
|
-
|
|
819
731
|
if (!_this7.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
|
|
820
732
|
objparam.editGraphicId = obj.id;
|
|
821
733
|
}
|
|
822
|
-
|
|
823
734
|
_this7.setState(objparam);
|
|
824
735
|
},
|
|
825
736
|
mapDraw: {
|
|
@@ -851,51 +762,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
851
762
|
}
|
|
852
763
|
};
|
|
853
764
|
var mapPoints = [],
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
765
|
+
mapLines = [],
|
|
766
|
+
mapPolygons = [],
|
|
767
|
+
mapCircles = [];
|
|
858
768
|
if (graphicType == 'point') {
|
|
859
769
|
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
860
770
|
} else {
|
|
861
771
|
mapPoints = _toConsumableArray(listPoint);
|
|
862
772
|
}
|
|
863
|
-
|
|
864
773
|
if (graphicType === 'polygon') {
|
|
865
774
|
if (editGraphic) {
|
|
866
775
|
var _mapPolygons;
|
|
867
|
-
|
|
868
776
|
Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
|
|
869
777
|
!this.multiDraw && (drawProps = null);
|
|
870
778
|
}
|
|
871
779
|
}
|
|
872
|
-
|
|
873
780
|
if (graphicType === 'polyline') {
|
|
874
781
|
if (editGraphic) {
|
|
875
782
|
var _mapLines;
|
|
876
|
-
|
|
877
783
|
Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
|
|
878
784
|
!this.multiDraw && (drawProps = null);
|
|
879
785
|
}
|
|
880
786
|
}
|
|
881
|
-
|
|
882
787
|
if (graphicType === 'rectangle') {
|
|
883
788
|
if (editGraphic) {
|
|
884
789
|
mapPolygons.push(editGraphic);
|
|
885
790
|
drawProps = null;
|
|
886
791
|
}
|
|
887
792
|
}
|
|
888
|
-
|
|
889
793
|
if (graphicType === 'circle') {
|
|
890
794
|
if (editGraphic) {
|
|
891
795
|
mapCircles.push(editGraphic);
|
|
892
796
|
drawProps = null;
|
|
893
797
|
}
|
|
894
798
|
}
|
|
895
|
-
|
|
896
799
|
if (isShowOtherGraph) {
|
|
897
800
|
var otherGraph = this.props.otherGraph;
|
|
898
|
-
|
|
899
801
|
if (otherGraph) {
|
|
900
802
|
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
901
803
|
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
@@ -903,7 +805,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
903
805
|
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
904
806
|
}
|
|
905
807
|
}
|
|
906
|
-
|
|
907
808
|
return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
|
|
908
809
|
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
909
810
|
style: {
|
|
@@ -925,10 +826,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
925
826
|
onClick: function onClick() {
|
|
926
827
|
if (_this7.multiDraw && _this7.state.isDoEdit && !_this7.state.isEndEdit) {
|
|
927
828
|
_this7.continueDraw(_this7.callback.bind(_this7));
|
|
928
|
-
|
|
929
829
|
return;
|
|
930
830
|
}
|
|
931
|
-
|
|
932
831
|
_this7.callback();
|
|
933
832
|
},
|
|
934
833
|
icon: getIcon('check')
|
|
@@ -940,6 +839,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
940
839
|
className: styles.searchMap
|
|
941
840
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
942
841
|
className: styles.top
|
|
842
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
843
|
+
className: styles.top_left
|
|
943
844
|
}, [/*#__PURE__*/_react["default"].createElement(_input["default"], _extends({
|
|
944
845
|
key: "1"
|
|
945
846
|
}, InputProps)), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
@@ -958,16 +859,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
958
859
|
disabled: this.isDrawStatus,
|
|
959
860
|
onClick: function onClick() {
|
|
960
861
|
_this7.isDrawStatus = true;
|
|
961
|
-
|
|
962
862
|
if (_this7.multiDraw) {
|
|
963
863
|
_this7.clickable = false;
|
|
964
|
-
graphicValue === null || graphicValue === void 0
|
|
864
|
+
graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
|
|
965
865
|
return t.map.removeGraphic(item.id, 'draw');
|
|
966
866
|
});
|
|
967
|
-
editGraphic === null || editGraphic === void 0
|
|
867
|
+
editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
|
|
968
868
|
return t.map.removeGraphic(item.id, 'draw');
|
|
969
869
|
});
|
|
970
|
-
|
|
971
870
|
_this7.setState({
|
|
972
871
|
isDraw: false,
|
|
973
872
|
isCloseDraw: true,
|
|
@@ -994,7 +893,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
994
893
|
});
|
|
995
894
|
});
|
|
996
895
|
}
|
|
997
|
-
|
|
998
896
|
_this7.callback('editDraw');
|
|
999
897
|
},
|
|
1000
898
|
icon: getIcon('edit')
|
|
@@ -1007,13 +905,23 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1007
905
|
}, "\u7F16\u8F91\u56FE\u5143"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
1008
906
|
onClick: this.setFitView.bind(this),
|
|
1009
907
|
icon: getIcon('sync')
|
|
1010
|
-
}, "\u8FD4\u56DE\u5168\u5C40\u5730\u56FE"),
|
|
908
|
+
}, "\u8FD4\u56DE\u5168\u5C40\u5730\u56FE")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
909
|
+
className: styles.top_right
|
|
910
|
+
}, typeof customNodes == 'function' && customNodes(t.map), isShowOther ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
911
|
+
className: styles.otherModal
|
|
912
|
+
}, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
913
|
+
checked: isShowOtherGraph,
|
|
914
|
+
onChange: function onChange(e) {
|
|
915
|
+
_this7.setState({
|
|
916
|
+
isShowOtherGraph: e.target.checked
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
}, otherText)) : '', isChangeMapType && ['amap', 'bmap', 'tmap'].includes(mapType) && /*#__PURE__*/_react["default"].createElement(_antd.Dropdown, {
|
|
1011
920
|
placement: "bottom",
|
|
1012
921
|
overlay: /*#__PURE__*/_react["default"].createElement(_antd.Menu, {
|
|
1013
922
|
onClick: function onClick(_ref) {
|
|
1014
923
|
var key = _ref.key;
|
|
1015
924
|
console.log(key);
|
|
1016
|
-
|
|
1017
925
|
_this7.setState({
|
|
1018
926
|
coverageType: key
|
|
1019
927
|
});
|
|
@@ -1031,16 +939,7 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1031
939
|
style: {
|
|
1032
940
|
width: 'fit-content'
|
|
1033
941
|
}
|
|
1034
|
-
}, /*#__PURE__*/_react["default"].createElement(_button["default"], null, coverageType == 'wx' ? '卫星底图' : '矢量底图', /*#__PURE__*/_react["default"].createElement(_DownOutlined["default"], null)))),
|
|
1035
|
-
className: styles.otherModal
|
|
1036
|
-
}, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
1037
|
-
checked: isShowOtherGraph,
|
|
1038
|
-
onChange: function onChange(e) {
|
|
1039
|
-
_this7.setState({
|
|
1040
|
-
isShowOtherGraph: e.target.checked
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
}, otherText)) : ''), /*#__PURE__*/_react["default"].createElement("div", {
|
|
942
|
+
}, /*#__PURE__*/_react["default"].createElement(_button["default"], null, coverageType == 'wx' ? '卫星底图' : '矢量底图', /*#__PURE__*/_react["default"].createElement(_DownOutlined["default"], null)))))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
1044
943
|
className: styles.content,
|
|
1045
944
|
style: {
|
|
1046
945
|
paddingLeft: '25px'
|
|
@@ -1117,15 +1016,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1117
1016
|
key: "initSearchMap",
|
|
1118
1017
|
value: function initSearchMap() {
|
|
1119
1018
|
var _this8 = this;
|
|
1120
|
-
|
|
1121
|
-
if (this.props.modal1Visible
|
|
1122
|
-
/*&& !this.state.locationPoint[0]*/
|
|
1123
|
-
) {
|
|
1019
|
+
if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
|
|
1124
1020
|
if (this.map) {
|
|
1125
1021
|
this.map.loadMapComplete.then(function () {
|
|
1126
1022
|
if (!_this8.mapLoaded) {
|
|
1127
1023
|
_this8.mapLoaded = true;
|
|
1128
|
-
|
|
1129
1024
|
_this8.drawLocationPoint();
|
|
1130
1025
|
}
|
|
1131
1026
|
});
|
|
@@ -1148,20 +1043,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1148
1043
|
key: "componentWillReceiveProps",
|
|
1149
1044
|
value: function componentWillReceiveProps(nextProps) {
|
|
1150
1045
|
var _this9 = this;
|
|
1151
|
-
|
|
1152
1046
|
var t = this;
|
|
1153
1047
|
this.isClickMap = false;
|
|
1154
|
-
|
|
1155
1048
|
if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
|
|
1156
1049
|
this.map.clearAll();
|
|
1157
1050
|
t.mapLoaded = false;
|
|
1158
1051
|
t.isinit = true;
|
|
1159
1052
|
}
|
|
1160
|
-
|
|
1161
1053
|
if (nextProps.editParam) {
|
|
1162
1054
|
t.mapLoaded = false;
|
|
1163
1055
|
}
|
|
1164
|
-
|
|
1165
1056
|
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
1166
1057
|
this.setState({
|
|
1167
1058
|
modal1Visible: nextProps.modal1Visible,
|
|
@@ -1186,7 +1077,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1186
1077
|
//实现2+次进入时,清理数据
|
|
1187
1078
|
if (nextProps.modal1Visible) {
|
|
1188
1079
|
_this9.clearList();
|
|
1189
|
-
|
|
1190
1080
|
_this9.setState({
|
|
1191
1081
|
setZoomLevel: true
|
|
1192
1082
|
}, function () {
|
|
@@ -1194,39 +1084,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1194
1084
|
setZoomLevel: false
|
|
1195
1085
|
});
|
|
1196
1086
|
});
|
|
1197
|
-
|
|
1198
1087
|
if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
1199
1088
|
if (_this9.map.getGraphic('locationPoint')) {
|
|
1200
1089
|
switch (nextProps.mapType) {
|
|
1201
1090
|
case 'bmap':
|
|
1202
1091
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1203
|
-
|
|
1204
1092
|
break;
|
|
1205
|
-
|
|
1206
1093
|
case 'amap':
|
|
1207
1094
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1208
|
-
|
|
1209
1095
|
break;
|
|
1210
|
-
|
|
1211
1096
|
case 'tmap':
|
|
1212
1097
|
_this9.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1213
|
-
|
|
1214
1098
|
break;
|
|
1215
|
-
|
|
1216
1099
|
case 'gmap':
|
|
1217
1100
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
1218
|
-
|
|
1219
1101
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
1220
|
-
|
|
1221
1102
|
_this9.map.state.gis.graphics.refresh();
|
|
1222
|
-
|
|
1223
1103
|
case 'olMap':
|
|
1224
1104
|
_this9.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
1225
|
-
|
|
1226
1105
|
break;
|
|
1227
1106
|
}
|
|
1228
1107
|
}
|
|
1229
|
-
|
|
1230
1108
|
_this9.map.setCenter(nextProps.mapCenter);
|
|
1231
1109
|
}
|
|
1232
1110
|
}
|
|
@@ -1237,17 +1115,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1237
1115
|
value: function componentWillUnmount() {
|
|
1238
1116
|
//关闭moveTo定时
|
|
1239
1117
|
var t = this;
|
|
1240
|
-
|
|
1241
1118
|
if (t.loadExtent) {
|
|
1242
1119
|
clearInterval(t.loadExtent);
|
|
1243
1120
|
}
|
|
1244
1121
|
}
|
|
1245
1122
|
}]);
|
|
1246
|
-
|
|
1247
1123
|
return VtxSearchMap;
|
|
1248
1124
|
}(_react["default"].Component);
|
|
1249
|
-
|
|
1250
|
-
var _default = VtxSearchMap;
|
|
1251
|
-
exports["default"] = _default;
|
|
1125
|
+
var _default = exports["default"] = VtxSearchMap;
|
|
1252
1126
|
module.exports = exports["default"];
|
|
1253
1127
|
//# sourceMappingURL=VtxSearchMap.js.map
|