@vtx/map 1.1.6 → 1.1.9
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 +3287 -2990
- package/lib/VtxMap/AMap/AMap.js.map +1 -0
- package/lib/VtxMap/BMap/Map.js +3517 -3146
- package/lib/VtxMap/BMap/Map.js.map +1 -0
- package/lib/VtxMap/GMap/Map.js +4572 -4021
- package/lib/VtxMap/GMap/Map.js.map +1 -0
- package/lib/VtxMap/Map.js +77 -63
- package/lib/VtxMap/Map.js.map +1 -0
- package/lib/VtxMap/MapToolFunction.js +422 -370
- package/lib/VtxMap/MapToolFunction.js.map +1 -0
- package/lib/VtxMap/OMap/Map.css +2 -2
- package/lib/VtxMap/OMap/Map.js +4345 -3782
- package/lib/VtxMap/OMap/Map.js.map +1 -0
- package/lib/VtxMap/OlMap/Map.css +4 -1
- package/lib/VtxMap/OlMap/Map.js +3921 -3181
- package/lib/VtxMap/OlMap/Map.js.map +1 -0
- package/lib/VtxMap/TMap/TMap.css +0 -1
- package/lib/VtxMap/TMap/TMap.js +3475 -3139
- package/lib/VtxMap/TMap/TMap.js.map +1 -0
- package/lib/VtxMap/index.js +37 -24
- package/lib/VtxMap/index.js.map +1 -0
- package/lib/VtxMap/mapPlayer.js +353 -308
- package/lib/VtxMap/mapPlayer.js.map +1 -0
- package/lib/VtxMap/optimizingPointMap.js +245 -205
- package/lib/VtxMap/optimizingPointMap.js.map +1 -0
- package/lib/VtxMap/style/css.js +16 -0
- package/lib/VtxMap/style/css.js.map +1 -0
- package/lib/VtxMap/style/index.js +16 -0
- package/lib/VtxMap/style/index.js.map +1 -0
- package/lib/VtxMap/zoomMap.js +120 -101
- package/lib/VtxMap/zoomMap.js.map +1 -0
- package/lib/VtxModal/VtxModal.css +62 -0
- package/lib/VtxModal/VtxModal.js +223 -213
- package/lib/VtxModal/VtxModal.js.map +1 -0
- package/lib/VtxModal/VtxModal.less +2 -2
- package/lib/VtxModal/VtxModalAntd3.css +62 -0
- package/lib/VtxModal/VtxModalAntd3.less +67 -0
- package/lib/VtxModal/draggableModal.js +138 -119
- package/lib/VtxModal/draggableModal.js.map +1 -0
- package/lib/VtxModal/index.js +21 -14
- package/lib/VtxModal/index.js.map +1 -0
- package/lib/VtxModal/style/css.js +21 -0
- package/lib/VtxModal/style/css.js.map +1 -0
- package/lib/VtxModal/style/index.js +21 -0
- package/lib/VtxModal/style/index.js.map +1 -0
- package/lib/VtxSearchMap/VtxSearchMap.css +171 -0
- package/lib/VtxSearchMap/VtxSearchMap.js +864 -819
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -0
- package/lib/VtxSearchMap/VtxSearchMapAntd3.css +0 -0
- package/lib/VtxSearchMap/VtxSearchMapAntd3.less +1 -0
- package/lib/VtxSearchMap/index.js +9 -9
- package/lib/VtxSearchMap/index.js.map +1 -0
- package/lib/VtxSearchMap/mapping.js +15 -12
- package/lib/VtxSearchMap/mapping.js.map +1 -0
- package/lib/VtxSearchMap/style/css.js +47 -0
- package/lib/VtxSearchMap/style/css.js.map +1 -0
- package/lib/VtxSearchMap/style/index.js +47 -0
- package/lib/VtxSearchMap/style/index.js.map +1 -0
- package/lib/default.js +32 -27
- package/lib/default.js.map +1 -0
- package/lib/index.js +9 -10
- package/lib/index.js.map +1 -0
- package/package.json +25 -4
|
@@ -1,891 +1,936 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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); }
|
|
2
4
|
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
6
|
+
value: true
|
|
5
7
|
});
|
|
8
|
+
exports["default"] = void 0;
|
|
6
9
|
|
|
7
|
-
var
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
11
|
|
|
9
|
-
var
|
|
12
|
+
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
10
13
|
|
|
11
|
-
var
|
|
14
|
+
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
12
15
|
|
|
13
|
-
var
|
|
16
|
+
var _message = _interopRequireDefault(require("antd/lib/message"));
|
|
14
17
|
|
|
15
|
-
require(
|
|
18
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
16
19
|
|
|
17
|
-
var
|
|
20
|
+
var _VtxModal = require("../VtxModal");
|
|
18
21
|
|
|
19
|
-
var
|
|
22
|
+
var _VtxMap = require("../VtxMap");
|
|
20
23
|
|
|
21
|
-
require(
|
|
24
|
+
var _default2 = _interopRequireWildcard(require("../default"));
|
|
22
25
|
|
|
23
|
-
var
|
|
26
|
+
var _mapping = require("./mapping");
|
|
24
27
|
|
|
25
|
-
var
|
|
28
|
+
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); }
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
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; }
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
30
33
|
|
|
31
|
-
var
|
|
34
|
+
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); }
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
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; }
|
|
34
37
|
|
|
35
|
-
var
|
|
38
|
+
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; }
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
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; }
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
40
43
|
|
|
41
|
-
var
|
|
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); } }
|
|
42
45
|
|
|
43
|
-
|
|
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; }
|
|
44
47
|
|
|
45
|
-
|
|
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); }
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
48
51
|
|
|
49
|
-
var
|
|
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); }; }
|
|
50
53
|
|
|
51
|
-
function
|
|
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); }
|
|
52
55
|
|
|
53
|
-
function
|
|
56
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
54
57
|
|
|
55
|
-
function
|
|
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; } }
|
|
56
59
|
|
|
57
|
-
function
|
|
60
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
58
61
|
|
|
59
|
-
function _toConsumableArray(arr) {
|
|
62
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
63
|
-
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
64
|
-
top: 'vtx-ui-searchmap-top',
|
|
65
|
-
bottom: 'vtx-ui-searchmap-bottom',
|
|
66
|
-
content: 'vtx-ui-searchmap-content',
|
|
67
|
-
show: 'vtx-ui-searchmap-show',
|
|
68
|
-
hidden: 'vtx-ui-searchmap-hidden',
|
|
69
|
-
w_l: 'vtx-ui-searchmap-w_l',
|
|
70
|
-
content_left: 'vtx-ui-searchmap-content_left',
|
|
71
|
-
listTitle: 'vtx-ui-searchmap-listtitle',
|
|
72
|
-
title: 'vtx-ui-searchmap-title',
|
|
73
|
-
btn: 'vtx-ui-searchmap-btn',
|
|
74
|
-
lists: 'vtx-ui-searchmap-lists',
|
|
75
|
-
select: 'vtx-ui-searchmap-select',
|
|
76
|
-
scrollauto: 'vtx-ui-searchmap-scrollauto',
|
|
77
|
-
content_right: 'vtx-ui-searchmap-content_right',
|
|
78
|
-
showLabel: 'vtx-ui-searchmap-showlabel',
|
|
79
|
-
hiddenLabel: 'vtx-ui-searchmap-hiddenlabel',
|
|
80
|
-
otherModal: 'vtx-ui-searchmap-othermodal'
|
|
81
|
-
};
|
|
82
|
-
// import Icon from 'antd/lib/icon';
|
|
83
|
-
// import 'antd/lib/icon/style/css';
|
|
64
|
+
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."); }
|
|
84
65
|
|
|
85
|
-
|
|
66
|
+
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); }
|
|
86
67
|
|
|
68
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
87
69
|
|
|
88
|
-
|
|
70
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
71
|
+
|
|
72
|
+
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; }
|
|
73
|
+
|
|
74
|
+
var styles = {
|
|
75
|
+
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
76
|
+
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
77
|
+
top: 'vtx-ui-searchmap-top',
|
|
78
|
+
bottom: 'vtx-ui-searchmap-bottom',
|
|
79
|
+
content: 'vtx-ui-searchmap-content',
|
|
80
|
+
show: 'vtx-ui-searchmap-show',
|
|
81
|
+
hidden: 'vtx-ui-searchmap-hidden',
|
|
82
|
+
w_l: 'vtx-ui-searchmap-w_l',
|
|
83
|
+
content_left: 'vtx-ui-searchmap-content_left',
|
|
84
|
+
listTitle: 'vtx-ui-searchmap-listtitle',
|
|
85
|
+
title: 'vtx-ui-searchmap-title',
|
|
86
|
+
btn: 'vtx-ui-searchmap-btn',
|
|
87
|
+
lists: 'vtx-ui-searchmap-lists',
|
|
88
|
+
select: 'vtx-ui-searchmap-select',
|
|
89
|
+
scrollauto: 'vtx-ui-searchmap-scrollauto',
|
|
90
|
+
content_right: 'vtx-ui-searchmap-content_right',
|
|
91
|
+
showLabel: 'vtx-ui-searchmap-showlabel',
|
|
92
|
+
hiddenLabel: 'vtx-ui-searchmap-hiddenlabel',
|
|
93
|
+
otherModal: 'vtx-ui-searchmap-othermodal'
|
|
94
|
+
}; // message.config({
|
|
89
95
|
// top: document.getElementById('root').offsetHeight/3,
|
|
90
96
|
// duration: 5,
|
|
91
97
|
// });
|
|
98
|
+
|
|
92
99
|
var warning = function warning() {
|
|
93
|
-
|
|
100
|
+
_message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
|
|
94
101
|
};
|
|
102
|
+
|
|
95
103
|
function distinct(ary) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
var pts = _toConsumableArray(ary);
|
|
105
|
+
|
|
106
|
+
if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
|
|
107
|
+
pts.pop();
|
|
108
|
+
return distinct(pts);
|
|
109
|
+
} else {
|
|
110
|
+
return pts;
|
|
111
|
+
}
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
var getIcon = function getIcon(type) {
|
|
106
|
-
|
|
115
|
+
return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
116
|
+
type: "icon-".concat(_mapping.iconMapping[type])
|
|
117
|
+
}) : type;
|
|
107
118
|
};
|
|
108
119
|
|
|
109
|
-
var VtxSearchMap = function (_React$Component) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
area: this.state.graphicValue.area
|
|
198
|
-
} : null);
|
|
199
|
-
break;
|
|
200
|
-
case 'polygon':
|
|
201
|
-
if (this.map.getGraphic(editGraphicId)) {
|
|
202
|
-
var _p = this.map.getGraphic(editGraphicId);
|
|
203
|
-
this.props[fun]({
|
|
204
|
-
rings: distinct(_p.geometry.rings),
|
|
205
|
-
area: this.map.getPolygonArea(distinct(_p.geometry.rings))
|
|
206
|
-
});
|
|
207
|
-
} else {
|
|
208
|
-
this.props[fun](this.state.graphicValue ? {
|
|
209
|
-
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
210
|
-
area: this.state.graphicValue.area
|
|
211
|
-
} : null);
|
|
212
|
-
}
|
|
213
|
-
break;
|
|
214
|
-
case 'rectangle':
|
|
215
|
-
this.props[fun](this.state.graphicValue ? {
|
|
216
|
-
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
217
|
-
area: this.state.graphicValue.area
|
|
218
|
-
} : null);
|
|
219
|
-
break;
|
|
220
|
-
case 'polyline':
|
|
221
|
-
if (this.map.getGraphic(editGraphicId)) {
|
|
222
|
-
var _p2 = this.map.getGraphic(editGraphicId);
|
|
223
|
-
this.props[fun]({
|
|
224
|
-
paths: _p2.geometry.paths,
|
|
225
|
-
length: this.map.calculateDistance(_p2.geometry.paths)
|
|
226
|
-
});
|
|
227
|
-
} else {
|
|
228
|
-
this.props[fun](this.state.graphicValue ? {
|
|
229
|
-
paths: this.state.graphicValue.geometry.paths,
|
|
230
|
-
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
231
|
-
} : null);
|
|
232
|
-
}
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
120
|
+
var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
121
|
+
_inherits(VtxSearchMap, _React$Component);
|
|
122
|
+
|
|
123
|
+
var _super = _createSuper(VtxSearchMap);
|
|
124
|
+
|
|
125
|
+
function VtxSearchMap(props) {
|
|
126
|
+
var _this;
|
|
127
|
+
|
|
128
|
+
_classCallCheck(this, VtxSearchMap);
|
|
129
|
+
|
|
130
|
+
_this = _super.call(this, props);
|
|
131
|
+
_this.map = null; //Map组件的ref对象
|
|
132
|
+
|
|
133
|
+
_this.mapLoaded = false;
|
|
134
|
+
_this.isDrawStatus = false;
|
|
135
|
+
_this.isClickMap = false;
|
|
136
|
+
_this.apid = []; //所有点id,除编辑点外
|
|
137
|
+
|
|
138
|
+
_this.loadExtent = null;
|
|
139
|
+
_this.mapId = "searchMap".concat(new Date().getTime());
|
|
140
|
+
_this.state = {
|
|
141
|
+
//列表和地图宽度切换的动画需要
|
|
142
|
+
isShowList: false,
|
|
143
|
+
//可拖动用于定位的点
|
|
144
|
+
locationPoint: [],
|
|
145
|
+
//搜索框文字
|
|
146
|
+
searchValue: '',
|
|
147
|
+
//搜索出来的列表点位
|
|
148
|
+
listPoint: [],
|
|
149
|
+
//列表数据
|
|
150
|
+
listMess: [],
|
|
151
|
+
// 返回点位/图形
|
|
152
|
+
graphicType: props.graphicType || 'point',
|
|
153
|
+
isDraw: props.graphicType !== 'point',
|
|
154
|
+
parameter: props.drawParameter,
|
|
155
|
+
graphicValue: null,
|
|
156
|
+
drawGraphID: 'drawnGraph',
|
|
157
|
+
|
|
158
|
+
/*地图Api参数*/
|
|
159
|
+
mapCenter: props.mapCenter || '',
|
|
160
|
+
maxZoom: props.maxZoom,
|
|
161
|
+
minZoom: props.minZoom,
|
|
162
|
+
wkid: props.wkid,
|
|
163
|
+
mapType: props.mapType || 'bmap',
|
|
164
|
+
mapStyle: props.mapStyle,
|
|
165
|
+
mapServer: props.mapServer,
|
|
166
|
+
setCenter: false,
|
|
167
|
+
mapVisiblePoints: {
|
|
168
|
+
fitView: [],
|
|
169
|
+
type: 'all'
|
|
170
|
+
},
|
|
171
|
+
setVisiblePoints: false,
|
|
172
|
+
isDoEdit: false,
|
|
173
|
+
isEndEdit: false,
|
|
174
|
+
editGraphicId: '',
|
|
175
|
+
editGraphic: null,
|
|
176
|
+
mapZoomLevel: props.mapZoomLevel || 11,
|
|
177
|
+
setZoomLevel: false,
|
|
178
|
+
|
|
179
|
+
/*modal参数*/
|
|
180
|
+
modal1Visible: props.modal1Visible || false,
|
|
181
|
+
isShowOther: props.isShowOther || false,
|
|
182
|
+
otherText: props.otherText || '显示服务区域',
|
|
183
|
+
isShowOtherGraph: props.isShowOther || false,
|
|
184
|
+
// openlayer
|
|
185
|
+
olProps: props.olProps
|
|
186
|
+
};
|
|
187
|
+
return _this;
|
|
188
|
+
} //经纬度回调
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
_createClass(VtxSearchMap, [{
|
|
192
|
+
key: "callback",
|
|
193
|
+
value: function callback() {
|
|
194
|
+
var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
|
|
195
|
+
|
|
196
|
+
if (fun in this.props && typeof this.props[fun] === 'function') {
|
|
197
|
+
var editGraphicId = this.state.editGraphicId;
|
|
198
|
+
|
|
199
|
+
switch (this.state.graphicType) {
|
|
200
|
+
case 'point':
|
|
201
|
+
var locationPoint = this.state.locationPoint;
|
|
202
|
+
|
|
203
|
+
if (this.map.getGraphic('locationPoint')) {
|
|
204
|
+
var p = this.map.getGraphic(locationPoint[0].id).geometry;
|
|
205
|
+
this.props[fun]([p.x, p.y]);
|
|
206
|
+
} else {
|
|
207
|
+
return [];
|
|
235
208
|
}
|
|
236
|
-
|
|
237
|
-
|
|
209
|
+
|
|
210
|
+
break;
|
|
211
|
+
|
|
212
|
+
case 'circle':
|
|
213
|
+
this.props[fun](this.state.graphicValue ? {
|
|
214
|
+
x: this.state.graphicValue.geometry.x,
|
|
215
|
+
y: this.state.graphicValue.geometry.y,
|
|
216
|
+
radius: this.state.graphicValue.geometry.radius,
|
|
217
|
+
area: this.state.graphicValue.area
|
|
218
|
+
} : null);
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case 'polygon':
|
|
222
|
+
if (this.map.getGraphic(editGraphicId)) {
|
|
223
|
+
var _p = this.map.getGraphic(editGraphicId);
|
|
224
|
+
|
|
225
|
+
this.props[fun]({
|
|
226
|
+
rings: distinct(_p.geometry.rings),
|
|
227
|
+
area: this.map.getPolygonArea(distinct(_p.geometry.rings))
|
|
228
|
+
});
|
|
229
|
+
} else {
|
|
230
|
+
this.props[fun](this.state.graphicValue ? {
|
|
231
|
+
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
232
|
+
area: this.state.graphicValue.area
|
|
233
|
+
} : null);
|
|
238
234
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
this.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
editGraphicId = 'locationPoint';
|
|
258
|
-
if (this.props.editParam) {
|
|
259
|
-
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
260
|
-
editGraphic = _extends({}, this.props.editParam, { id: 'drawnGraph' });
|
|
261
|
-
editGraphicId = 'drawnGraph';
|
|
262
|
-
}
|
|
263
|
-
this.isinit = false;
|
|
264
|
-
this.setState({
|
|
265
|
-
editGraphic: editGraphic,
|
|
266
|
-
locationPoint: [{
|
|
267
|
-
id: 'locationPoint',
|
|
268
|
-
longitude: (t.props.mapCenter || [])[0] || lglt.nowCenter.lng,
|
|
269
|
-
latitude: (t.props.mapCenter || [])[1] || lglt.nowCenter.lat,
|
|
270
|
-
url: _default2.default.mapServerURL + '/images/defaultMarker.png',
|
|
271
|
-
config: {
|
|
272
|
-
zIndex: 1000
|
|
273
|
-
}
|
|
274
|
-
}]
|
|
275
|
-
}, function () {
|
|
276
|
-
t.setState({
|
|
277
|
-
isDoEdit: true,
|
|
278
|
-
editGraphicId: editGraphicId
|
|
279
|
-
}, function () {
|
|
280
|
-
setTimeout(function () {
|
|
281
|
-
t.setState({
|
|
282
|
-
isDoEdit: false
|
|
283
|
-
});
|
|
284
|
-
}, 500);
|
|
285
|
-
});
|
|
286
|
-
});
|
|
235
|
+
|
|
236
|
+
break;
|
|
237
|
+
|
|
238
|
+
case 'rectangle':
|
|
239
|
+
this.props[fun](this.state.graphicValue ? {
|
|
240
|
+
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
241
|
+
area: this.state.graphicValue.area
|
|
242
|
+
} : null);
|
|
243
|
+
break;
|
|
244
|
+
|
|
245
|
+
case 'polyline':
|
|
246
|
+
if (this.map.getGraphic(editGraphicId)) {
|
|
247
|
+
var _p2 = this.map.getGraphic(editGraphicId);
|
|
248
|
+
|
|
249
|
+
this.props[fun]({
|
|
250
|
+
paths: _p2.geometry.paths,
|
|
251
|
+
length: this.map.calculateDistance(_p2.geometry.paths)
|
|
252
|
+
});
|
|
287
253
|
} else {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
254
|
+
this.props[fun](this.state.graphicValue ? {
|
|
255
|
+
paths: this.state.graphicValue.geometry.paths,
|
|
256
|
+
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
257
|
+
} : null);
|
|
291
258
|
}
|
|
259
|
+
|
|
260
|
+
break;
|
|
292
261
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (this.props.clearDrawnGraph) {
|
|
265
|
+
this.clearDrawnGraph();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: "showOrhidden",
|
|
270
|
+
value: function showOrhidden(bealoon) {
|
|
271
|
+
this.setState({
|
|
272
|
+
isShowList: bealoon
|
|
273
|
+
});
|
|
274
|
+
} //绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
|
|
275
|
+
|
|
276
|
+
}, {
|
|
277
|
+
key: "drawLocationPoint",
|
|
278
|
+
value: function drawLocationPoint() {
|
|
279
|
+
var t = this; //判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
|
|
280
|
+
|
|
281
|
+
if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
|
|
282
|
+
var lglt = this.map.getMapExtent(),
|
|
283
|
+
editGraphic = null,
|
|
284
|
+
editGraphicId = 'locationPoint';
|
|
285
|
+
|
|
286
|
+
if (this.props.editParam) {
|
|
287
|
+
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
288
|
+
editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
|
|
289
|
+
id: 'drawnGraph'
|
|
290
|
+
});
|
|
291
|
+
editGraphicId = 'drawnGraph';
|
|
310
292
|
}
|
|
311
|
-
//搜索关键字切换
|
|
312
293
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
294
|
+
this.isinit = false;
|
|
295
|
+
this.setState({
|
|
296
|
+
editGraphic: editGraphic,
|
|
297
|
+
locationPoint: [{
|
|
298
|
+
id: 'locationPoint',
|
|
299
|
+
longitude: (t.props.mapCenter || [])[0] || lglt.nowCenter.lng,
|
|
300
|
+
latitude: (t.props.mapCenter || [])[1] || lglt.nowCenter.lat,
|
|
301
|
+
url: "".concat(_default2["default"].mapServerURL, "/images/defaultMarker.png"),
|
|
302
|
+
config: {
|
|
303
|
+
zIndex: 1000
|
|
304
|
+
}
|
|
305
|
+
}]
|
|
306
|
+
}, function () {
|
|
307
|
+
t.setState({
|
|
308
|
+
isDoEdit: true,
|
|
309
|
+
editGraphicId: editGraphicId
|
|
310
|
+
}, function () {
|
|
311
|
+
setTimeout(function () {
|
|
312
|
+
t.setState({
|
|
313
|
+
isDoEdit: false
|
|
314
|
+
});
|
|
315
|
+
}, 500);
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
} else {
|
|
319
|
+
t.loadExtent = setTimeout(function () {
|
|
320
|
+
t.drawLocationPoint();
|
|
321
|
+
}, 50);
|
|
322
|
+
}
|
|
323
|
+
} //校正定位的点位位置到当前的中心点
|
|
324
|
+
|
|
325
|
+
}, {
|
|
326
|
+
key: "correction",
|
|
327
|
+
value: function correction() {
|
|
328
|
+
var t = this; //获取当前中心点经纬度
|
|
329
|
+
|
|
330
|
+
var lglt = this.map.getMapExtent();
|
|
331
|
+
var locationPoint = t.state.locationPoint;
|
|
332
|
+
locationPoint = locationPoint.map(function (item, index) {
|
|
333
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
334
|
+
longitude: lglt.nowCenter.lng,
|
|
335
|
+
latitude: lglt.nowCenter.lat
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
this.map.updatePoint(locationPoint);
|
|
339
|
+
} //搜索关键字切换
|
|
340
|
+
|
|
341
|
+
}, {
|
|
342
|
+
key: "changeValue",
|
|
343
|
+
value: function changeValue(e) {
|
|
344
|
+
this.setState({
|
|
345
|
+
searchValue: e.target.value
|
|
346
|
+
});
|
|
347
|
+
} //根据关键字搜索数据
|
|
348
|
+
|
|
349
|
+
}, {
|
|
350
|
+
key: "searchList",
|
|
351
|
+
value: function searchList() {
|
|
352
|
+
//因为antd组件问题,这边使用手动关键位,控制方法执行
|
|
353
|
+
var t = this;
|
|
354
|
+
var searchPoints = t.map.searchPoints(this.state.searchValue);
|
|
355
|
+
searchPoints.then(function (results) {
|
|
356
|
+
if (results.length > 0) {
|
|
357
|
+
var lsp = [],
|
|
358
|
+
lsm = [];
|
|
359
|
+
t.apid = [];
|
|
360
|
+
|
|
361
|
+
for (var i = 0; i < results.length; i++) {
|
|
362
|
+
var r = results[i];
|
|
363
|
+
lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
|
|
364
|
+
url: "".concat(_default2["default"].mapServerURL, "/images/defaultMarker_selected.png"),
|
|
365
|
+
labelClass: styles.hiddenLabel
|
|
366
|
+
}));
|
|
367
|
+
lsm.push({
|
|
368
|
+
id: r.id,
|
|
369
|
+
title: r.config.labelContent,
|
|
370
|
+
isSelect: false
|
|
318
371
|
});
|
|
372
|
+
t.apid.push(r.id);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
t.setState({
|
|
376
|
+
listPoint: lsp,
|
|
377
|
+
listMess: lsm,
|
|
378
|
+
isShowList: true
|
|
379
|
+
});
|
|
380
|
+
t.setFitView();
|
|
381
|
+
} else {
|
|
382
|
+
warning();
|
|
319
383
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
384
|
+
});
|
|
385
|
+
} //返回最佳位置(zoom,center)
|
|
386
|
+
|
|
387
|
+
}, {
|
|
388
|
+
key: "setFitView",
|
|
389
|
+
value: function setFitView() {
|
|
390
|
+
var _this2 = this;
|
|
391
|
+
|
|
392
|
+
this.setState({
|
|
393
|
+
mapVisiblePoints: {
|
|
394
|
+
fitView: this.apid,
|
|
395
|
+
type: 'all'
|
|
396
|
+
},
|
|
397
|
+
setVisiblePoints: true
|
|
398
|
+
}, function () {
|
|
399
|
+
_this2.setState({
|
|
400
|
+
setVisiblePoints: false
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
} //清空列表的所有数据(包括点位)
|
|
404
|
+
|
|
405
|
+
}, {
|
|
406
|
+
key: "clearList",
|
|
407
|
+
value: function clearList() {
|
|
408
|
+
this.apid = [];
|
|
409
|
+
this.setState({
|
|
410
|
+
searchValue: '',
|
|
411
|
+
listPoint: [],
|
|
412
|
+
listMess: [],
|
|
413
|
+
isShowList: false
|
|
414
|
+
});
|
|
415
|
+
} //列表选中地址
|
|
416
|
+
|
|
417
|
+
}, {
|
|
418
|
+
key: "chooseAddress",
|
|
419
|
+
value: function chooseAddress(id) {
|
|
420
|
+
var t = this;
|
|
421
|
+
var _this$state = this.state,
|
|
422
|
+
listPoint = _this$state.listPoint,
|
|
423
|
+
listMess = _this$state.listMess;
|
|
424
|
+
var mapCenter = [];
|
|
425
|
+
listPoint = listPoint.map(function (item, index) {
|
|
426
|
+
if (item.id === id) {
|
|
427
|
+
mapCenter = [item.longitude, item.latitude];
|
|
428
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
429
|
+
labelClass: styles.showLabel
|
|
430
|
+
});
|
|
431
|
+
} else {
|
|
432
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
433
|
+
labelClass: styles.hiddenLabel
|
|
434
|
+
});
|
|
356
435
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
type: 'all'
|
|
368
|
-
},
|
|
369
|
-
setVisiblePoints: true
|
|
370
|
-
}, function () {
|
|
371
|
-
_this2.setState({
|
|
372
|
-
setVisiblePoints: false
|
|
373
|
-
});
|
|
374
|
-
});
|
|
436
|
+
});
|
|
437
|
+
listMess = listMess.map(function (item, index) {
|
|
438
|
+
if (item.id === id) {
|
|
439
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
440
|
+
isSelect: true
|
|
441
|
+
});
|
|
442
|
+
} else {
|
|
443
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
444
|
+
isSelect: false
|
|
445
|
+
});
|
|
375
446
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
447
|
+
});
|
|
448
|
+
this.setState({
|
|
449
|
+
listPoint: listPoint,
|
|
450
|
+
listMess: listMess,
|
|
451
|
+
mapCenter: mapCenter,
|
|
452
|
+
setCenter: true
|
|
453
|
+
}, function () {
|
|
454
|
+
t.setState({
|
|
455
|
+
setCenter: false
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
if (t.state.graphicType == 'point') {
|
|
459
|
+
t.correction();
|
|
388
460
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
}, {
|
|
464
|
+
key: "clickGraphic",
|
|
465
|
+
value: function clickGraphic(obj) {
|
|
466
|
+
if (obj.type === 'point' && obj.attributes.other === 'search') {
|
|
467
|
+
this.chooseAddress(obj.attributes.id);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}, {
|
|
471
|
+
key: "closeModal",
|
|
472
|
+
value: function closeModal(e) {
|
|
473
|
+
if (this.isDrawStatus && this.isClickMap) {
|
|
474
|
+
_message["default"].warning('请双击结束图元编辑');
|
|
475
|
+
} else {
|
|
476
|
+
if ('closeModal' in this.props) {
|
|
477
|
+
this.props.closeModal();
|
|
478
|
+
} else {
|
|
479
|
+
this.setState({
|
|
480
|
+
modal1Visible: false
|
|
481
|
+
});
|
|
482
|
+
} // if(this.props.clearDrawnGraph){
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
this.clearDrawnGraph(); // }
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}, {
|
|
489
|
+
key: "clearDrawnGraph",
|
|
490
|
+
value: function clearDrawnGraph() {
|
|
491
|
+
var _this3 = this;
|
|
492
|
+
|
|
493
|
+
this.isDrawStatus = true;
|
|
494
|
+
this.setState({
|
|
495
|
+
isDraw: this.state.graphicType !== 'point',
|
|
496
|
+
graphicValue: null,
|
|
497
|
+
isEndEdit: this.state.graphicType !== 'point'
|
|
498
|
+
}, function () {
|
|
499
|
+
_this3.setState({
|
|
500
|
+
isEndEdit: false
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
}, {
|
|
505
|
+
key: "render",
|
|
506
|
+
value: function render() {
|
|
507
|
+
var _this4 = this;
|
|
508
|
+
|
|
509
|
+
var t = this;
|
|
510
|
+
var _this$state2 = this.state,
|
|
511
|
+
isShowList = _this$state2.isShowList,
|
|
512
|
+
searchValue = _this$state2.searchValue,
|
|
513
|
+
locationPoint = _this$state2.locationPoint,
|
|
514
|
+
listPoint = _this$state2.listPoint,
|
|
515
|
+
listMess = _this$state2.listMess,
|
|
516
|
+
mapZoomLevel = _this$state2.mapZoomLevel,
|
|
517
|
+
setZoomLevel = _this$state2.setZoomLevel,
|
|
518
|
+
maxZoom = _this$state2.maxZoom,
|
|
519
|
+
minZoom = _this$state2.minZoom,
|
|
520
|
+
wkid = _this$state2.wkid,
|
|
521
|
+
mapServer = _this$state2.mapServer,
|
|
522
|
+
mapCenter = _this$state2.mapCenter,
|
|
523
|
+
setCenter = _this$state2.setCenter,
|
|
524
|
+
mapType = _this$state2.mapType,
|
|
525
|
+
mapStyle = _this$state2.mapStyle,
|
|
526
|
+
mapVisiblePoints = _this$state2.mapVisiblePoints,
|
|
527
|
+
setVisiblePoints = _this$state2.setVisiblePoints,
|
|
528
|
+
isDoEdit = _this$state2.isDoEdit,
|
|
529
|
+
editGraphicId = _this$state2.editGraphicId,
|
|
530
|
+
isEndEdit = _this$state2.isEndEdit,
|
|
531
|
+
modal1Visible = _this$state2.modal1Visible,
|
|
532
|
+
drawGraphID = _this$state2.drawGraphID,
|
|
533
|
+
isShowOther = _this$state2.isShowOther,
|
|
534
|
+
otherText = _this$state2.otherText,
|
|
535
|
+
isShowOtherGraph = _this$state2.isShowOtherGraph,
|
|
536
|
+
editGraphic = _this$state2.editGraphic,
|
|
537
|
+
graphicType = _this$state2.graphicType,
|
|
538
|
+
olProps = _this$state2.olProps;
|
|
539
|
+
var InputProps = {
|
|
540
|
+
style: {
|
|
541
|
+
'width': '200px'
|
|
542
|
+
},
|
|
543
|
+
placeholder: '输入关键字',
|
|
544
|
+
value: searchValue,
|
|
545
|
+
onChange: this.changeValue.bind(this),
|
|
546
|
+
onPressEnter: this.searchList.bind(this),
|
|
547
|
+
onKeyDown: this.changeValue.bind(this)
|
|
548
|
+
};
|
|
549
|
+
var drawProps = this.state.graphicType == 'point' || t.isinit ? {
|
|
550
|
+
isDraw: this.state.isDraw,
|
|
551
|
+
isCloseDraw: this.state.isCloseDraw
|
|
552
|
+
} : {
|
|
553
|
+
isDraw: this.state.isDraw,
|
|
554
|
+
isCloseDraw: this.state.isCloseDraw,
|
|
555
|
+
drawEnd: function drawEnd(obj) {
|
|
556
|
+
_this4.isDrawStatus = false;
|
|
557
|
+
_this4.isClickMap = false;
|
|
558
|
+
var objparam = {
|
|
559
|
+
graphicValue: obj,
|
|
560
|
+
isDraw: false
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
if (obj.geometryType == 'polyline' || obj.geometryType == 'polygon') {
|
|
564
|
+
objparam.editGraphicId = obj.id;
|
|
565
|
+
objparam.isDoEdit = true;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
_this4.setState(objparam, function () {
|
|
569
|
+
_this4.setState({
|
|
570
|
+
isDoEdit: false
|
|
435
571
|
});
|
|
572
|
+
});
|
|
573
|
+
},
|
|
574
|
+
mapDraw: {
|
|
575
|
+
geometryType: this.state.graphicType,
|
|
576
|
+
parameter: this.state.parameter || (this.state.graphicType == 'polyline' ? {
|
|
577
|
+
color: '#108edf',
|
|
578
|
+
//线颜色,
|
|
579
|
+
pellucidity: 1,
|
|
580
|
+
//线透明度,
|
|
581
|
+
lineWidth: 3,
|
|
582
|
+
//线宽度
|
|
583
|
+
lineType: 'solid'
|
|
584
|
+
} : this.state.graphicType == 'polygon' || this.state.graphicType == 'circle' || this.state.graphicType == 'rectangle' ? {
|
|
585
|
+
color: '#ffffff',
|
|
586
|
+
//填充色,
|
|
587
|
+
lineColor: '#108edf',
|
|
588
|
+
//线颜色,
|
|
589
|
+
lineOpacity: 1,
|
|
590
|
+
//线透明度,
|
|
591
|
+
lineWidth: 3,
|
|
592
|
+
//线宽度,
|
|
593
|
+
pellucidity: 0.8,
|
|
594
|
+
//填充透明度
|
|
595
|
+
lineType: 'solid'
|
|
596
|
+
} : {}),
|
|
597
|
+
data: {
|
|
598
|
+
id: drawGraphID
|
|
599
|
+
}
|
|
436
600
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
601
|
+
};
|
|
602
|
+
var mapPoints = [],
|
|
603
|
+
mapLines = [],
|
|
604
|
+
mapPolygons = [],
|
|
605
|
+
mapCircles = [];
|
|
606
|
+
|
|
607
|
+
if (graphicType == 'point') {
|
|
608
|
+
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
609
|
+
} else {
|
|
610
|
+
mapPoints = _toConsumableArray(listPoint);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (graphicType === 'polygon') {
|
|
614
|
+
if (editGraphic) {
|
|
615
|
+
mapPolygons.push(editGraphic);
|
|
616
|
+
drawProps = null;
|
|
443
617
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
if ('closeModal' in this.props) {
|
|
451
|
-
this.props.closeModal();
|
|
452
|
-
} else {
|
|
453
|
-
this.setState({
|
|
454
|
-
modal1Visible: false
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
// if(this.props.clearDrawnGraph){
|
|
458
|
-
this.clearDrawnGraph();
|
|
459
|
-
// }
|
|
460
|
-
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
if (graphicType === 'polyline') {
|
|
621
|
+
if (editGraphic) {
|
|
622
|
+
mapLines.push(editGraphic);
|
|
623
|
+
drawProps = null;
|
|
461
624
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.setState({
|
|
469
|
-
isDraw: this.state.graphicType !== 'point',
|
|
470
|
-
graphicValue: null,
|
|
471
|
-
isEndEdit: this.state.graphicType !== 'point'
|
|
472
|
-
}, function () {
|
|
473
|
-
_this3.setState({ isEndEdit: false });
|
|
474
|
-
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (graphicType === 'rectangle') {
|
|
628
|
+
if (editGraphic) {
|
|
629
|
+
mapPolygons.push(editGraphic);
|
|
630
|
+
drawProps = null;
|
|
475
631
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
var _state2 = this.state,
|
|
483
|
-
isShowList = _state2.isShowList,
|
|
484
|
-
searchValue = _state2.searchValue,
|
|
485
|
-
locationPoint = _state2.locationPoint,
|
|
486
|
-
listPoint = _state2.listPoint,
|
|
487
|
-
listMess = _state2.listMess,
|
|
488
|
-
mapZoomLevel = _state2.mapZoomLevel,
|
|
489
|
-
setZoomLevel = _state2.setZoomLevel,
|
|
490
|
-
maxZoom = _state2.maxZoom,
|
|
491
|
-
minZoom = _state2.minZoom,
|
|
492
|
-
wkid = _state2.wkid,
|
|
493
|
-
mapServer = _state2.mapServer,
|
|
494
|
-
mapCenter = _state2.mapCenter,
|
|
495
|
-
setCenter = _state2.setCenter,
|
|
496
|
-
mapType = _state2.mapType,
|
|
497
|
-
mapVisiblePoints = _state2.mapVisiblePoints,
|
|
498
|
-
setVisiblePoints = _state2.setVisiblePoints,
|
|
499
|
-
isDoEdit = _state2.isDoEdit,
|
|
500
|
-
editGraphicId = _state2.editGraphicId,
|
|
501
|
-
isEndEdit = _state2.isEndEdit,
|
|
502
|
-
modal1Visible = _state2.modal1Visible,
|
|
503
|
-
drawGraphID = _state2.drawGraphID,
|
|
504
|
-
isShowOther = _state2.isShowOther,
|
|
505
|
-
otherText = _state2.otherText,
|
|
506
|
-
isShowOtherGraph = _state2.isShowOtherGraph,
|
|
507
|
-
editGraphic = _state2.editGraphic,
|
|
508
|
-
graphicType = _state2.graphicType,
|
|
509
|
-
olProps = _state2.olProps;
|
|
510
|
-
|
|
511
|
-
var InputProps = {
|
|
512
|
-
style: { 'width': '200px' },
|
|
513
|
-
placeholder: '输入关键字',
|
|
514
|
-
value: searchValue,
|
|
515
|
-
onChange: this.changeValue.bind(this),
|
|
516
|
-
onPressEnter: this.searchList.bind(this),
|
|
517
|
-
onKeyDown: this.changeValue.bind(this)
|
|
518
|
-
};
|
|
519
|
-
var drawProps = this.state.graphicType == 'point' || t.isinit ? {
|
|
520
|
-
isDraw: this.state.isDraw,
|
|
521
|
-
isCloseDraw: this.state.isCloseDraw
|
|
522
|
-
} : {
|
|
523
|
-
isDraw: this.state.isDraw,
|
|
524
|
-
isCloseDraw: this.state.isCloseDraw,
|
|
525
|
-
drawEnd: function drawEnd(obj) {
|
|
526
|
-
_this4.isDrawStatus = false;
|
|
527
|
-
_this4.isClickMap = false;
|
|
528
|
-
var objparam = {
|
|
529
|
-
graphicValue: obj,
|
|
530
|
-
isDraw: false
|
|
531
|
-
};
|
|
532
|
-
if (obj.geometryType == 'polyline' || obj.geometryType == 'polygon') {
|
|
533
|
-
objparam.editGraphicId = obj.id;
|
|
534
|
-
objparam.isDoEdit = true;
|
|
535
|
-
}
|
|
536
|
-
_this4.setState(objparam, function () {
|
|
537
|
-
_this4.setState({
|
|
538
|
-
isDoEdit: false
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
},
|
|
542
|
-
mapDraw: {
|
|
543
|
-
geometryType: this.state.graphicType,
|
|
544
|
-
parameter: this.state.parameter || (this.state.graphicType == 'polyline' ? {
|
|
545
|
-
color: '#108edf', //线颜色,
|
|
546
|
-
pellucidity: 1, //线透明度,
|
|
547
|
-
lineWidth: 3, //线宽度
|
|
548
|
-
lineType: 'solid'
|
|
549
|
-
} : this.state.graphicType == 'polygon' || this.state.graphicType == 'circle' || this.state.graphicType == 'rectangle' ? {
|
|
550
|
-
color: '#ffffff', //填充色,
|
|
551
|
-
lineColor: '#108edf', //线颜色,
|
|
552
|
-
lineOpacity: 1, //线透明度,
|
|
553
|
-
lineWidth: 3, //线宽度,
|
|
554
|
-
pellucidity: 0.8, //填充透明度
|
|
555
|
-
lineType: 'solid'
|
|
556
|
-
} : {}),
|
|
557
|
-
data: { id: drawGraphID }
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
var mapPoints = [],
|
|
561
|
-
mapLines = [],
|
|
562
|
-
mapPolygons = [],
|
|
563
|
-
mapCircles = [];
|
|
564
|
-
if (graphicType == 'point') {
|
|
565
|
-
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
566
|
-
} else {
|
|
567
|
-
mapPoints = [].concat(_toConsumableArray(listPoint));
|
|
568
|
-
}
|
|
569
|
-
if (graphicType === 'polygon') {
|
|
570
|
-
if (editGraphic) {
|
|
571
|
-
mapPolygons.push(editGraphic);
|
|
572
|
-
drawProps = null;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
if (graphicType === 'polyline') {
|
|
576
|
-
if (editGraphic) {
|
|
577
|
-
mapLines.push(editGraphic);
|
|
578
|
-
drawProps = null;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
if (graphicType === 'rectangle') {
|
|
582
|
-
if (editGraphic) {
|
|
583
|
-
mapPolygons.push(editGraphic);
|
|
584
|
-
drawProps = null;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
if (graphicType === 'circle') {
|
|
588
|
-
if (editGraphic) {
|
|
589
|
-
mapCircles.push(editGraphic);
|
|
590
|
-
drawProps = null;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
if (isShowOtherGraph) {
|
|
594
|
-
var otherGraph = this.props.otherGraph;
|
|
595
|
-
|
|
596
|
-
if (otherGraph) {
|
|
597
|
-
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
598
|
-
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
599
|
-
mapPolygons = [].concat(_toConsumableArray(mapPolygons), _toConsumableArray(otherGraph.polygon || []));
|
|
600
|
-
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
return _react2.default.createElement(
|
|
604
|
-
_VtxModal.VtxModal,
|
|
605
|
-
{
|
|
606
|
-
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
607
|
-
style: { top: 50 },
|
|
608
|
-
visible: modal1Visible,
|
|
609
|
-
maximize: true,
|
|
610
|
-
isNotMoving: true,
|
|
611
|
-
wrapClassName: styles.searchModal,
|
|
612
|
-
bodyStyle: { height: window.innerHeight * 0.7 + 'px' },
|
|
613
|
-
maskClosable: false,
|
|
614
|
-
onCancel: this.closeModal.bind(this),
|
|
615
|
-
footer: _react2.default.createElement(
|
|
616
|
-
'div',
|
|
617
|
-
{ className: styles.bottom },
|
|
618
|
-
_react2.default.createElement(
|
|
619
|
-
_button2.default,
|
|
620
|
-
{ type: 'primary', onClick: function onClick() {
|
|
621
|
-
_this4.callback();
|
|
622
|
-
}, icon: getIcon('check') },
|
|
623
|
-
'\u786E\u5B9A'
|
|
624
|
-
),
|
|
625
|
-
_react2.default.createElement(
|
|
626
|
-
_button2.default,
|
|
627
|
-
{ onClick: this.closeModal.bind(this), icon: getIcon('close') },
|
|
628
|
-
'\u5173\u95ED'
|
|
629
|
-
)
|
|
630
|
-
)
|
|
631
|
-
},
|
|
632
|
-
_react2.default.createElement(
|
|
633
|
-
'div',
|
|
634
|
-
{ className: styles.searchMap },
|
|
635
|
-
_react2.default.createElement(
|
|
636
|
-
'div',
|
|
637
|
-
{ className: styles.top },
|
|
638
|
-
mapType == 'gmap' || mapType == 'olmap' ? '' : [_react2.default.createElement(_input2.default, _extends({ key: '1' }, InputProps)), _react2.default.createElement(
|
|
639
|
-
_button2.default,
|
|
640
|
-
{ key: '2', type: 'primary', onClick: this.searchList.bind(this), icon: getIcon('search') },
|
|
641
|
-
'\u67E5\u8BE2'
|
|
642
|
-
), _react2.default.createElement(
|
|
643
|
-
_button2.default,
|
|
644
|
-
{ key: '3', onClick: this.clearList.bind(this), icon: getIcon('close') },
|
|
645
|
-
'\u6E05\u7A7A'
|
|
646
|
-
)],
|
|
647
|
-
this.state.graphicType == 'point' ? _react2.default.createElement(
|
|
648
|
-
_button2.default,
|
|
649
|
-
{ onClick: this.correction.bind(this), icon: getIcon('environment') },
|
|
650
|
-
'\u6821\u6B63'
|
|
651
|
-
) : null,
|
|
652
|
-
this.state.graphicType != 'point' ? _react2.default.createElement(
|
|
653
|
-
_button2.default,
|
|
654
|
-
{ disabled: this.isDrawStatus, onClick: function onClick() {
|
|
655
|
-
_this4.isDrawStatus = true;
|
|
656
|
-
_this4.setState({
|
|
657
|
-
isDraw: true,
|
|
658
|
-
graphicValue: null,
|
|
659
|
-
editGraphic: null,
|
|
660
|
-
isEndEdit: true
|
|
661
|
-
}, function () {
|
|
662
|
-
t.map.removeGraphic('drawnGraph', 'draw');
|
|
663
|
-
t.setState({
|
|
664
|
-
isEndEdit: false
|
|
665
|
-
});
|
|
666
|
-
});
|
|
667
|
-
_this4.callback('editDraw');
|
|
668
|
-
}, icon: getIcon('edit') },
|
|
669
|
-
'\u91CD\u65B0\u7ED8\u5236'
|
|
670
|
-
) : null,
|
|
671
|
-
mapType == 'gmap' || mapType == 'olmap' ? '' : _react2.default.createElement(
|
|
672
|
-
_button2.default,
|
|
673
|
-
{ onClick: this.setFitView.bind(this), icon: getIcon('sync') },
|
|
674
|
-
'\u8FD4\u56DE\u5168\u5C40\u5730\u56FE'
|
|
675
|
-
),
|
|
676
|
-
isShowOther ? _react2.default.createElement(
|
|
677
|
-
'div',
|
|
678
|
-
{ className: styles.otherModal },
|
|
679
|
-
_react2.default.createElement(
|
|
680
|
-
_checkbox2.default,
|
|
681
|
-
{ checked: isShowOtherGraph, onChange: function onChange(e) {
|
|
682
|
-
_this4.setState({ isShowOtherGraph: e.target.checked });
|
|
683
|
-
} },
|
|
684
|
-
otherText
|
|
685
|
-
)
|
|
686
|
-
) : ''
|
|
687
|
-
),
|
|
688
|
-
_react2.default.createElement(
|
|
689
|
-
'div',
|
|
690
|
-
{ className: styles.content, style: { paddingLeft: mapType == 'gmap' || mapType == 'olmap' ? '0px' : '25px' } },
|
|
691
|
-
mapType == 'gmap' || mapType == 'olmap' ? '' : _react2.default.createElement(
|
|
692
|
-
'div',
|
|
693
|
-
{ className: styles.content_left + ' ' + (isShowList ? styles.w_l : '') },
|
|
694
|
-
_react2.default.createElement(
|
|
695
|
-
'div',
|
|
696
|
-
{ className: '' + (isShowList ? styles.show : styles.hidden) },
|
|
697
|
-
_react2.default.createElement(
|
|
698
|
-
'div',
|
|
699
|
-
{ className: styles.listTitle },
|
|
700
|
-
_react2.default.createElement(
|
|
701
|
-
'div',
|
|
702
|
-
{ className: styles.title },
|
|
703
|
-
'\u67E5\u8BE2\u7ED3\u679C'
|
|
704
|
-
),
|
|
705
|
-
_react2.default.createElement(
|
|
706
|
-
'div',
|
|
707
|
-
{ onClick: function onClick() {
|
|
708
|
-
return _this4.showOrhidden(false);
|
|
709
|
-
}, className: styles.btn },
|
|
710
|
-
_react2.default.createElement(_default.VtxMapIcon, { type: 'icon-doubleleft' })
|
|
711
|
-
)
|
|
712
|
-
),
|
|
713
|
-
_react2.default.createElement(
|
|
714
|
-
'div',
|
|
715
|
-
{ className: styles.scrollauto },
|
|
716
|
-
listMess.map(function (item, index) {
|
|
717
|
-
return _react2.default.createElement(
|
|
718
|
-
'div',
|
|
719
|
-
{
|
|
720
|
-
key: index,
|
|
721
|
-
onClick: function onClick() {
|
|
722
|
-
return _this4.chooseAddress(item.id);
|
|
723
|
-
},
|
|
724
|
-
className: styles.lists + ' ' + (item.isSelect ? styles.select : '')
|
|
725
|
-
},
|
|
726
|
-
item.title
|
|
727
|
-
);
|
|
728
|
-
})
|
|
729
|
-
)
|
|
730
|
-
),
|
|
731
|
-
_react2.default.createElement(
|
|
732
|
-
'div',
|
|
733
|
-
{ onClick: function onClick() {
|
|
734
|
-
return _this4.showOrhidden(true);
|
|
735
|
-
}, className: styles.btn + ' ' + (!isShowList ? styles.show : styles.hidden) },
|
|
736
|
-
_react2.default.createElement(_default.VtxMapIcon, { type: 'icon-doubleright' })
|
|
737
|
-
)
|
|
738
|
-
),
|
|
739
|
-
_react2.default.createElement(
|
|
740
|
-
'div',
|
|
741
|
-
{ className: styles.content_right },
|
|
742
|
-
_react2.default.createElement(_VtxMap.VtxMap, _extends({
|
|
743
|
-
getMapInstance: function getMapInstance(map) {
|
|
744
|
-
if (map) _this4.map = map;
|
|
745
|
-
},
|
|
746
|
-
mapType: mapType,
|
|
747
|
-
mapServer: mapServer,
|
|
748
|
-
wkid: wkid,
|
|
749
|
-
mapId: t.mapId,
|
|
750
|
-
setCenter: setCenter,
|
|
751
|
-
mapCenter: mapCenter,
|
|
752
|
-
minZoom: minZoom,
|
|
753
|
-
maxZoom: maxZoom,
|
|
754
|
-
mapZoomLevel: mapZoomLevel,
|
|
755
|
-
setZoomLevel: setZoomLevel,
|
|
756
|
-
mapPoints: mapPoints,
|
|
757
|
-
mapLines: mapLines,
|
|
758
|
-
mapPolygons: mapPolygons,
|
|
759
|
-
mapCircles: mapCircles,
|
|
760
|
-
mapVisiblePoints: mapVisiblePoints,
|
|
761
|
-
setVisiblePoints: setVisiblePoints,
|
|
762
|
-
isDoEdit: isDoEdit,
|
|
763
|
-
isEndEdit: isEndEdit,
|
|
764
|
-
editGraphicId: editGraphicId,
|
|
765
|
-
editGraphicChange: function editGraphicChange() {},
|
|
766
|
-
clickGraphic: this.clickGraphic.bind(this),
|
|
767
|
-
clickMap: function clickMap() {
|
|
768
|
-
t.isClickMap = true;
|
|
769
|
-
},
|
|
770
|
-
olProps: olProps
|
|
771
|
-
}, drawProps))
|
|
772
|
-
)
|
|
773
|
-
)
|
|
774
|
-
)
|
|
775
|
-
);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (graphicType === 'circle') {
|
|
635
|
+
if (editGraphic) {
|
|
636
|
+
mapCircles.push(editGraphic);
|
|
637
|
+
drawProps = null;
|
|
776
638
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
_this5.drawLocationPoint();
|
|
788
|
-
}
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (isShowOtherGraph) {
|
|
642
|
+
var otherGraph = this.props.otherGraph;
|
|
643
|
+
|
|
644
|
+
if (otherGraph) {
|
|
645
|
+
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
646
|
+
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
647
|
+
mapPolygons = [].concat(_toConsumableArray(mapPolygons), _toConsumableArray(otherGraph.polygon || []));
|
|
648
|
+
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
792
649
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
|
|
653
|
+
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
654
|
+
style: {
|
|
655
|
+
top: 50
|
|
656
|
+
},
|
|
657
|
+
visible: modal1Visible,
|
|
658
|
+
maximize: true,
|
|
659
|
+
isNotMoving: true,
|
|
660
|
+
wrapClassName: styles.searchModal,
|
|
661
|
+
bodyStyle: {
|
|
662
|
+
height: "".concat(window.innerHeight * 0.7, "px")
|
|
663
|
+
},
|
|
664
|
+
maskClosable: false,
|
|
665
|
+
onCancel: this.closeModal.bind(this),
|
|
666
|
+
footer: /*#__PURE__*/_react["default"].createElement("div", {
|
|
667
|
+
className: styles.bottom
|
|
668
|
+
}, /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
669
|
+
type: "primary",
|
|
670
|
+
onClick: function onClick() {
|
|
671
|
+
_this4.callback();
|
|
672
|
+
},
|
|
673
|
+
icon: getIcon('check')
|
|
674
|
+
}, "\u786E\u5B9A"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
675
|
+
onClick: this.closeModal.bind(this),
|
|
676
|
+
icon: getIcon('close')
|
|
677
|
+
}, "\u5173\u95ED"))
|
|
678
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
679
|
+
className: styles.searchMap
|
|
680
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
681
|
+
className: styles.top
|
|
682
|
+
}, mapType == 'gmap' || mapType == 'olmap' ? '' : [/*#__PURE__*/_react["default"].createElement(_input["default"], _extends({
|
|
683
|
+
key: "1"
|
|
684
|
+
}, InputProps)), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
685
|
+
key: "2",
|
|
686
|
+
type: "primary",
|
|
687
|
+
onClick: this.searchList.bind(this),
|
|
688
|
+
icon: getIcon('search')
|
|
689
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
690
|
+
key: "3",
|
|
691
|
+
onClick: this.clearList.bind(this),
|
|
692
|
+
icon: getIcon('close')
|
|
693
|
+
}, "\u6E05\u7A7A")], this.state.graphicType == 'point' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
694
|
+
onClick: this.correction.bind(this),
|
|
695
|
+
icon: getIcon('environment')
|
|
696
|
+
}, "\u6821\u6B63") : null, this.state.graphicType != 'point' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
697
|
+
disabled: this.isDrawStatus,
|
|
698
|
+
onClick: function onClick() {
|
|
699
|
+
_this4.isDrawStatus = true;
|
|
700
|
+
|
|
701
|
+
_this4.setState({
|
|
702
|
+
isDraw: true,
|
|
703
|
+
graphicValue: null,
|
|
704
|
+
editGraphic: null,
|
|
705
|
+
isEndEdit: true
|
|
706
|
+
}, function () {
|
|
707
|
+
t.map.removeGraphic('drawnGraph', 'draw');
|
|
708
|
+
t.setState({
|
|
709
|
+
isEndEdit: false
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
_this4.callback('editDraw');
|
|
714
|
+
},
|
|
715
|
+
icon: getIcon('edit')
|
|
716
|
+
}, "\u91CD\u65B0\u7ED8\u5236") : null, mapType == 'gmap' || mapType == 'olmap' ? '' : /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
717
|
+
onClick: this.setFitView.bind(this),
|
|
718
|
+
icon: getIcon('sync')
|
|
719
|
+
}, "\u8FD4\u56DE\u5168\u5C40\u5730\u56FE"), isShowOther ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
720
|
+
className: styles.otherModal
|
|
721
|
+
}, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
722
|
+
checked: isShowOtherGraph,
|
|
723
|
+
onChange: function onChange(e) {
|
|
724
|
+
_this4.setState({
|
|
725
|
+
isShowOtherGraph: e.target.checked
|
|
726
|
+
});
|
|
798
727
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
this.initSearchMap();
|
|
728
|
+
}, otherText)) : ''), /*#__PURE__*/_react["default"].createElement("div", {
|
|
729
|
+
className: styles.content,
|
|
730
|
+
style: {
|
|
731
|
+
paddingLeft: mapType == 'gmap' || mapType == 'olmap' ? '0px' : '25px'
|
|
804
732
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
733
|
+
}, mapType == 'gmap' || mapType == 'olmap' ? '' : /*#__PURE__*/_react["default"].createElement("div", {
|
|
734
|
+
className: "".concat(styles.content_left, " ").concat(isShowList ? styles.w_l : '')
|
|
735
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
736
|
+
className: "".concat(isShowList ? styles.show : styles.hidden)
|
|
737
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
738
|
+
className: styles.listTitle
|
|
739
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
740
|
+
className: styles.title
|
|
741
|
+
}, "\u67E5\u8BE2\u7ED3\u679C"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
742
|
+
onClick: function onClick() {
|
|
743
|
+
return _this4.showOrhidden(false);
|
|
744
|
+
},
|
|
745
|
+
className: styles.btn
|
|
746
|
+
}, /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
747
|
+
type: "icon-doubleleft"
|
|
748
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
749
|
+
className: styles.scrollauto
|
|
750
|
+
}, listMess.map(function (item, index) {
|
|
751
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
752
|
+
key: index,
|
|
753
|
+
onClick: function onClick() {
|
|
754
|
+
return _this4.chooseAddress(item.id);
|
|
755
|
+
},
|
|
756
|
+
className: "".concat(styles.lists, " ").concat(item.isSelect ? styles.select : '')
|
|
757
|
+
}, item.title);
|
|
758
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
759
|
+
onClick: function onClick() {
|
|
760
|
+
return _this4.showOrhidden(true);
|
|
761
|
+
},
|
|
762
|
+
className: "".concat(styles.btn, " ").concat(!isShowList ? styles.show : styles.hidden)
|
|
763
|
+
}, /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
764
|
+
type: "icon-doubleright"
|
|
765
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
766
|
+
className: styles.content_right
|
|
767
|
+
}, /*#__PURE__*/_react["default"].createElement(_VtxMap.VtxMap, _extends({
|
|
768
|
+
getMapInstance: function getMapInstance(map) {
|
|
769
|
+
if (map) _this4.map = map;
|
|
770
|
+
},
|
|
771
|
+
mapType: mapType,
|
|
772
|
+
mapStyle: mapStyle,
|
|
773
|
+
mapServer: mapServer,
|
|
774
|
+
wkid: wkid,
|
|
775
|
+
mapId: t.mapId,
|
|
776
|
+
setCenter: setCenter,
|
|
777
|
+
mapCenter: mapCenter,
|
|
778
|
+
minZoom: minZoom,
|
|
779
|
+
maxZoom: maxZoom,
|
|
780
|
+
mapZoomLevel: mapZoomLevel,
|
|
781
|
+
setZoomLevel: setZoomLevel,
|
|
782
|
+
mapPoints: mapPoints,
|
|
783
|
+
mapLines: mapLines,
|
|
784
|
+
mapPolygons: mapPolygons,
|
|
785
|
+
mapCircles: mapCircles,
|
|
786
|
+
mapVisiblePoints: mapVisiblePoints,
|
|
787
|
+
setVisiblePoints: setVisiblePoints,
|
|
788
|
+
isDoEdit: isDoEdit,
|
|
789
|
+
isEndEdit: isEndEdit,
|
|
790
|
+
editGraphicId: editGraphicId,
|
|
791
|
+
editGraphicChange: function editGraphicChange() {},
|
|
792
|
+
clickGraphic: this.clickGraphic.bind(this),
|
|
793
|
+
clickMap: function clickMap() {
|
|
794
|
+
t.isClickMap = true;
|
|
795
|
+
},
|
|
796
|
+
olProps: olProps
|
|
797
|
+
}, drawProps))))));
|
|
798
|
+
}
|
|
799
|
+
}, {
|
|
800
|
+
key: "initSearchMap",
|
|
801
|
+
value: function initSearchMap() {
|
|
802
|
+
var _this5 = this;
|
|
803
|
+
|
|
804
|
+
if (this.props.modal1Visible
|
|
805
|
+
/*&& !this.state.locationPoint[0]*/
|
|
806
|
+
) {
|
|
807
|
+
if (this.map) {
|
|
808
|
+
this.map.loadMapComplete.then(function () {
|
|
809
|
+
if (!_this5.mapLoaded) {
|
|
810
|
+
_this5.mapLoaded = true;
|
|
811
|
+
|
|
812
|
+
_this5.drawLocationPoint();
|
|
819
813
|
}
|
|
820
|
-
|
|
821
|
-
this.setState({
|
|
822
|
-
modal1Visible: nextProps.modal1Visible,
|
|
823
|
-
maxZoom: nextProps.maxZoom,
|
|
824
|
-
minZoom: nextProps.minZoom,
|
|
825
|
-
wkid: nextProps.wkid,
|
|
826
|
-
mapCenter: nextProps.mapCenter || '',
|
|
827
|
-
mapType: nextProps.mapType || 'bmap',
|
|
828
|
-
mapServer: nextProps.mapServer,
|
|
829
|
-
graphicType: nextProps.graphicType || 'point',
|
|
830
|
-
isDraw: nextProps.graphicType !== 'point' && !nextProps.editParam,
|
|
831
|
-
isCloseDraw: !(nextProps.graphicType !== 'point' && !nextProps.editParam),
|
|
832
|
-
editGraphicId: ''
|
|
833
|
-
}, function () {
|
|
834
|
-
t.setState({
|
|
835
|
-
isCloseDraw: false
|
|
836
|
-
});
|
|
837
|
-
t.initSearchMap();
|
|
838
|
-
});
|
|
839
|
-
setTimeout(function () {
|
|
840
|
-
//实现2+次进入时,清理数据
|
|
841
|
-
if (nextProps.modal1Visible) {
|
|
842
|
-
_this6.clearList();
|
|
843
|
-
_this6.setState({
|
|
844
|
-
setZoomLevel: true
|
|
845
|
-
}, function () {
|
|
846
|
-
_this6.setState({
|
|
847
|
-
setZoomLevel: false
|
|
848
|
-
});
|
|
849
|
-
});
|
|
850
|
-
if (!!_this6.map && !!_this6.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
851
|
-
if (_this6.map.getGraphic('locationPoint')) {
|
|
852
|
-
switch (nextProps.mapType) {
|
|
853
|
-
case 'bmap':
|
|
854
|
-
_this6.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
855
|
-
break;
|
|
856
|
-
case 'amap':
|
|
857
|
-
_this6.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
858
|
-
break;
|
|
859
|
-
case 'tmap':
|
|
860
|
-
_this6.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
861
|
-
break;
|
|
862
|
-
case 'gmap':
|
|
863
|
-
_this6.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
864
|
-
_this6.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
865
|
-
_this6.map.state.gis.graphics.refresh();
|
|
866
|
-
case 'olMap':
|
|
867
|
-
_this6.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
868
|
-
break;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
_this6.map.setCenter(nextProps.mapCenter);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}, 100);
|
|
814
|
+
});
|
|
875
815
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}, {
|
|
819
|
+
key: "componentDidMount",
|
|
820
|
+
value: function componentDidMount() {
|
|
821
|
+
//绘制定位点(以当前的中心点位参照=>初始化好后才有ref可以获取中心点)
|
|
822
|
+
this.initSearchMap();
|
|
823
|
+
}
|
|
824
|
+
}, {
|
|
825
|
+
key: "componentDidUpdate",
|
|
826
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
827
|
+
//重新渲染结束
|
|
828
|
+
this.initSearchMap();
|
|
829
|
+
}
|
|
830
|
+
}, {
|
|
831
|
+
key: "componentWillReceiveProps",
|
|
832
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
833
|
+
var _this6 = this;
|
|
834
|
+
|
|
835
|
+
var t = this;
|
|
836
|
+
this.isClickMap = false;
|
|
837
|
+
|
|
838
|
+
if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
|
|
839
|
+
this.map.clearAll();
|
|
840
|
+
t.mapLoaded = false;
|
|
841
|
+
t.isinit = true;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
if (nextProps.editParam) {
|
|
845
|
+
t.mapLoaded = false;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
849
|
+
this.setState({
|
|
850
|
+
modal1Visible: nextProps.modal1Visible,
|
|
851
|
+
maxZoom: nextProps.maxZoom,
|
|
852
|
+
minZoom: nextProps.minZoom,
|
|
853
|
+
wkid: nextProps.wkid,
|
|
854
|
+
mapCenter: nextProps.mapCenter || '',
|
|
855
|
+
mapType: nextProps.mapType || 'bmap',
|
|
856
|
+
mapStyle: nextProps.mapStyle,
|
|
857
|
+
mapServer: nextProps.mapServer,
|
|
858
|
+
graphicType: nextProps.graphicType || 'point',
|
|
859
|
+
isDraw: nextProps.graphicType !== 'point' && !nextProps.editParam,
|
|
860
|
+
isCloseDraw: !(nextProps.graphicType !== 'point' && !nextProps.editParam),
|
|
861
|
+
editGraphicId: ''
|
|
862
|
+
}, function () {
|
|
863
|
+
t.setState({
|
|
864
|
+
isCloseDraw: false
|
|
865
|
+
});
|
|
866
|
+
t.initSearchMap();
|
|
867
|
+
});
|
|
868
|
+
setTimeout(function () {
|
|
869
|
+
//实现2+次进入时,清理数据
|
|
870
|
+
if (nextProps.modal1Visible) {
|
|
871
|
+
_this6.clearList();
|
|
872
|
+
|
|
873
|
+
_this6.setState({
|
|
874
|
+
setZoomLevel: true
|
|
875
|
+
}, function () {
|
|
876
|
+
_this6.setState({
|
|
877
|
+
setZoomLevel: false
|
|
878
|
+
});
|
|
879
|
+
});
|
|
880
|
+
|
|
881
|
+
if (!!_this6.map && !!_this6.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
882
|
+
if (_this6.map.getGraphic('locationPoint')) {
|
|
883
|
+
switch (nextProps.mapType) {
|
|
884
|
+
case 'bmap':
|
|
885
|
+
_this6.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
886
|
+
|
|
887
|
+
break;
|
|
888
|
+
|
|
889
|
+
case 'amap':
|
|
890
|
+
_this6.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
891
|
+
|
|
892
|
+
break;
|
|
893
|
+
|
|
894
|
+
case 'tmap':
|
|
895
|
+
_this6.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
896
|
+
|
|
897
|
+
break;
|
|
898
|
+
|
|
899
|
+
case 'gmap':
|
|
900
|
+
_this6.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
901
|
+
|
|
902
|
+
_this6.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
903
|
+
|
|
904
|
+
_this6.map.state.gis.graphics.refresh();
|
|
905
|
+
|
|
906
|
+
case 'olMap':
|
|
907
|
+
_this6.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
908
|
+
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
883
911
|
}
|
|
912
|
+
|
|
913
|
+
_this6.map.setCenter(nextProps.mapCenter);
|
|
914
|
+
}
|
|
884
915
|
}
|
|
885
|
-
|
|
916
|
+
}, 100);
|
|
917
|
+
}
|
|
918
|
+
}, {
|
|
919
|
+
key: "componentWillUnmount",
|
|
920
|
+
value: function componentWillUnmount() {
|
|
921
|
+
//关闭moveTo定时
|
|
922
|
+
var t = this;
|
|
923
|
+
|
|
924
|
+
if (t.loadExtent) {
|
|
925
|
+
clearInterval(t.loadExtent);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}]);
|
|
886
929
|
|
|
887
|
-
|
|
888
|
-
}(
|
|
930
|
+
return VtxSearchMap;
|
|
931
|
+
}(_react["default"].Component);
|
|
889
932
|
|
|
890
|
-
|
|
891
|
-
|
|
933
|
+
var _default = VtxSearchMap;
|
|
934
|
+
exports["default"] = _default;
|
|
935
|
+
module.exports = exports["default"];
|
|
936
|
+
//# sourceMappingURL=VtxSearchMap.js.map
|