@vtx/map 1.1.35 → 1.1.37
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 +624 -992
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +743 -1187
- 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 +697 -1192
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +645 -1050
- 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.js +105 -238
- package/lib/VtxSearchCheckMap/VtxSearchCheckMap.js.map +1 -1
- 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.js +105 -220
- package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -1
- 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/package.json +1 -1
- package/lib/icon_font.js +0 -49
- package/lib/icon_font.js.map +0 -1
|
@@ -1,78 +1,45 @@
|
|
|
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
|
-
function
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
34
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
-
|
|
36
21
|
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); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
-
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
42
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
-
|
|
44
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
45
|
-
|
|
25
|
+
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); } }
|
|
46
26
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
47
|
-
|
|
48
27
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
49
|
-
|
|
50
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
51
|
-
|
|
52
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
53
|
-
|
|
54
30
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
55
|
-
|
|
56
31
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
57
|
-
|
|
58
32
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
59
|
-
|
|
60
33
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
61
|
-
|
|
62
|
-
function
|
|
63
|
-
|
|
34
|
+
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; }
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
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); }
|
|
64
37
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
65
|
-
|
|
66
38
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
|
-
|
|
68
39
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
69
|
-
|
|
70
40
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
71
|
-
|
|
72
41
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
73
|
-
|
|
74
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
75
|
-
|
|
42
|
+
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; } //公共地址配置
|
|
76
43
|
var styles = {
|
|
77
44
|
searchModal: 'vtx-ui-searchmap-searchmodal',
|
|
78
45
|
searchMap: 'vtx-ui-searchmap-searchmap',
|
|
@@ -94,18 +61,17 @@ var styles = {
|
|
|
94
61
|
hiddenLabel: 'vtx-ui-searchmap-hiddenlabel',
|
|
95
62
|
otherModal: 'vtx-ui-searchmap-othermodal',
|
|
96
63
|
mapTxt: 'vtx-ui-searchmap-mapTxt'
|
|
97
|
-
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// message.config({
|
|
98
67
|
// top: document.getElementById('root').offsetHeight/3,
|
|
99
68
|
// duration: 5,
|
|
100
69
|
// });
|
|
101
|
-
|
|
102
70
|
var warning = function warning() {
|
|
103
71
|
_message["default"].warning('位置点查询失败,请缩小比例尺或切换关键字后再重新查询!');
|
|
104
72
|
};
|
|
105
|
-
|
|
106
73
|
function distinct(ary) {
|
|
107
74
|
var pts = _toConsumableArray(ary);
|
|
108
|
-
|
|
109
75
|
if (pts[0][0] == pts[pts.length - 1][0] && pts[0][1] == pts[pts.length - 1][1]) {
|
|
110
76
|
pts.pop();
|
|
111
77
|
return distinct(pts);
|
|
@@ -113,31 +79,24 @@ function distinct(ary) {
|
|
|
113
79
|
return pts;
|
|
114
80
|
}
|
|
115
81
|
}
|
|
116
|
-
|
|
117
82
|
var getIcon = function getIcon(type) {
|
|
118
83
|
return _default2.antdMajorVersion === '4' ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
|
|
119
84
|
type: "icon-".concat(_mapping.iconMapping[type])
|
|
120
85
|
}) : type;
|
|
121
86
|
};
|
|
122
|
-
|
|
123
87
|
var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
124
88
|
_inherits(VtxSearchMap, _React$Component);
|
|
125
|
-
|
|
126
89
|
var _super = _createSuper(VtxSearchMap);
|
|
127
|
-
|
|
128
90
|
function VtxSearchMap(props) {
|
|
129
91
|
var _this;
|
|
130
|
-
|
|
131
92
|
_classCallCheck(this, VtxSearchMap);
|
|
132
|
-
|
|
133
93
|
_this = _super.call(this, props);
|
|
134
|
-
|
|
94
|
+
// 绘制多个图元时返回参数
|
|
135
95
|
_defineProperty(_assertThisInitialized(_this), "getMultiRes", function (graphicType) {
|
|
136
96
|
var resData = [];
|
|
137
97
|
var _this$state = _this.state,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
98
|
+
graphicValue = _this$state.graphicValue,
|
|
99
|
+
editGraphic = _this$state.editGraphic;
|
|
141
100
|
switch (graphicType) {
|
|
142
101
|
case 'polygon':
|
|
143
102
|
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
@@ -147,25 +106,28 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
147
106
|
});
|
|
148
107
|
});
|
|
149
108
|
break;
|
|
150
|
-
|
|
109
|
+
case 'polyline':
|
|
110
|
+
[].concat(_toConsumableArray(graphicValue || []), _toConsumableArray(editGraphic || [])).forEach(function (item) {
|
|
111
|
+
resData.push({
|
|
112
|
+
paths: item.geometry.paths,
|
|
113
|
+
length: _this.map.calculateDistance(item.geometry.paths)
|
|
114
|
+
});
|
|
115
|
+
});
|
|
151
116
|
default:
|
|
152
117
|
break;
|
|
153
118
|
}
|
|
154
|
-
|
|
155
119
|
return resData.length ? resData : null;
|
|
156
120
|
});
|
|
157
|
-
|
|
158
121
|
_this.map = null; //Map组件的ref对象
|
|
159
|
-
|
|
160
122
|
_this.mapLoaded = false;
|
|
161
123
|
_this.isDrawStatus = false;
|
|
162
124
|
_this.isClickMap = false;
|
|
163
125
|
_this.apid = []; //所有点id,除编辑点外
|
|
164
|
-
|
|
165
126
|
_this.loadExtent = null;
|
|
166
127
|
_this.mapId = "searchMap".concat(new Date().getTime());
|
|
167
|
-
_this.multiDraw = props.multiDraw && ['polygon'].includes(props.graphicType);
|
|
168
|
-
_this.clickable = false,
|
|
128
|
+
_this.multiDraw = props.multiDraw && ['polygon', 'polyline'].includes(props.graphicType);
|
|
129
|
+
_this.clickable = false,
|
|
130
|
+
// 多个面绘制时,是否可以点击面进行编辑
|
|
169
131
|
_this.state = {
|
|
170
132
|
//列表和地图宽度切换的动画需要
|
|
171
133
|
isShowList: false,
|
|
@@ -184,7 +146,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
184
146
|
graphicValue: _this.multiDraw ? [] : null,
|
|
185
147
|
// 绘制图元id集合
|
|
186
148
|
drawGraphID: _this.multiDraw ? ['drawnGraph'] : 'drawnGraph',
|
|
187
|
-
|
|
188
149
|
/*地图Api参数*/
|
|
189
150
|
mapCenter: props.mapCenter || '',
|
|
190
151
|
maxZoom: props.maxZoom,
|
|
@@ -205,7 +166,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
205
166
|
editGraphic: _this.multiDraw ? [] : null,
|
|
206
167
|
mapZoomLevel: props.mapZoomLevel || 11,
|
|
207
168
|
setZoomLevel: false,
|
|
208
|
-
|
|
209
169
|
/*modal参数*/
|
|
210
170
|
modal1Visible: props.modal1Visible || false,
|
|
211
171
|
isShowOther: props.isShowOther || false,
|
|
@@ -219,35 +179,28 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
219
179
|
showControl: props.showControl || false
|
|
220
180
|
};
|
|
221
181
|
return _this;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
182
|
+
}
|
|
225
183
|
_createClass(VtxSearchMap, [{
|
|
226
184
|
key: "callback",
|
|
227
|
-
value:
|
|
185
|
+
value:
|
|
186
|
+
//经纬度回调
|
|
228
187
|
function callback() {
|
|
229
188
|
var fun = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'callback';
|
|
230
|
-
|
|
231
189
|
if (fun in this.props && typeof this.props[fun] === 'function') {
|
|
232
190
|
var editGraphicId = this.state.editGraphicId;
|
|
233
|
-
|
|
234
191
|
switch (this.state.graphicType) {
|
|
235
192
|
case 'point':
|
|
236
193
|
var locationPoint = this.state.locationPoint;
|
|
237
|
-
|
|
238
194
|
if (this.map.getGraphic('locationPoint')) {
|
|
239
195
|
var p = this.map.getGraphic(locationPoint[0].id).geometry;
|
|
240
196
|
this.props[fun]([p.x, p.y]);
|
|
241
197
|
} else {
|
|
242
198
|
return [];
|
|
243
199
|
}
|
|
244
|
-
|
|
245
200
|
break;
|
|
246
|
-
|
|
247
201
|
case 'circle':
|
|
248
202
|
if (this.map.getGraphic(editGraphicId)) {
|
|
249
203
|
var _p = this.map.getGraphic(editGraphicId);
|
|
250
|
-
|
|
251
204
|
this.props[fun]({
|
|
252
205
|
x: _p.geometry.x,
|
|
253
206
|
y: _p.geometry.y,
|
|
@@ -262,18 +215,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
262
215
|
area: this.state.graphicValue.area
|
|
263
216
|
} : null);
|
|
264
217
|
}
|
|
265
|
-
|
|
266
218
|
break;
|
|
267
|
-
|
|
268
219
|
case 'polygon':
|
|
269
220
|
if (this.multiDraw) {
|
|
270
221
|
this.props[fun](this.getMultiRes('polygon'));
|
|
271
222
|
return;
|
|
272
223
|
}
|
|
273
|
-
|
|
274
224
|
if (this.map.getGraphic(editGraphicId)) {
|
|
275
225
|
var _p2 = this.map.getGraphic(editGraphicId);
|
|
276
|
-
|
|
277
226
|
this.props[fun]({
|
|
278
227
|
rings: distinct(_p2.geometry.rings),
|
|
279
228
|
area: this.map.getPolygonArea(distinct(_p2.geometry.rings))
|
|
@@ -284,20 +233,20 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
284
233
|
area: this.state.graphicValue.area
|
|
285
234
|
} : null);
|
|
286
235
|
}
|
|
287
|
-
|
|
288
236
|
break;
|
|
289
|
-
|
|
290
237
|
case 'rectangle':
|
|
291
238
|
this.props[fun](this.state.graphicValue ? {
|
|
292
239
|
rings: distinct(this.state.graphicValue.geometry.rings),
|
|
293
240
|
area: this.state.graphicValue.area
|
|
294
241
|
} : null);
|
|
295
242
|
break;
|
|
296
|
-
|
|
297
243
|
case 'polyline':
|
|
244
|
+
if (this.multiDraw) {
|
|
245
|
+
this.props[fun](this.getMultiRes('polyline'));
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
298
248
|
if (this.map.getGraphic(editGraphicId)) {
|
|
299
249
|
var _p3 = this.map.getGraphic(editGraphicId);
|
|
300
|
-
|
|
301
250
|
this.props[fun]({
|
|
302
251
|
paths: _p3.geometry.paths,
|
|
303
252
|
length: this.map.calculateDistance(_p3.geometry.paths)
|
|
@@ -308,11 +257,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
308
257
|
length: this.map.calculateDistance(this.state.graphicValue.geometry.paths)
|
|
309
258
|
} : null);
|
|
310
259
|
}
|
|
311
|
-
|
|
312
260
|
break;
|
|
313
261
|
}
|
|
314
262
|
}
|
|
315
|
-
|
|
316
263
|
if (this.props.clearDrawnGraph) {
|
|
317
264
|
this.clearDrawnGraph();
|
|
318
265
|
}
|
|
@@ -323,18 +270,17 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
323
270
|
this.setState({
|
|
324
271
|
isShowList: bealoon
|
|
325
272
|
});
|
|
326
|
-
}
|
|
327
|
-
|
|
273
|
+
}
|
|
274
|
+
//绘制定位点(以当前的中心点位参照 => 同时开启点位编辑)
|
|
328
275
|
}, {
|
|
329
276
|
key: "drawLocationPoint",
|
|
330
277
|
value: function drawLocationPoint() {
|
|
331
|
-
var t = this;
|
|
332
|
-
|
|
278
|
+
var t = this;
|
|
279
|
+
//判断arcgis,是: 判断中心点是否已经确定,确定,继续走逻辑.不确认.轮询等待
|
|
333
280
|
if (this.props.mapType !== 'gmap' || this.map.state.gis.extent && !!this.map.state.gis.extent.xmax) {
|
|
334
281
|
var lglt = this.map.getMapExtent(),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
282
|
+
editGraphic = null,
|
|
283
|
+
editGraphicId = 'locationPoint';
|
|
338
284
|
if (!this.multiDraw && this.props.editParam) {
|
|
339
285
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
340
286
|
editGraphic = _objectSpread(_objectSpread({}, this.props.editParam), {}, {
|
|
@@ -342,7 +288,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
342
288
|
});
|
|
343
289
|
editGraphicId = 'drawnGraph';
|
|
344
290
|
}
|
|
345
|
-
|
|
346
291
|
if (this.multiDraw && Array.isArray(this.props.editParam) && this.props.editParam.length) {
|
|
347
292
|
// && (this.props.graphicType == 'polyline' || this.props.graphicType == 'polygon')
|
|
348
293
|
editGraphic = this.props.editParam.map(function (item, index) {
|
|
@@ -352,7 +297,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
352
297
|
});
|
|
353
298
|
editGraphicId = null;
|
|
354
299
|
}
|
|
355
|
-
|
|
356
300
|
this.isinit = false;
|
|
357
301
|
this.setState({
|
|
358
302
|
editGraphic: editGraphic,
|
|
@@ -383,13 +327,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
383
327
|
t.drawLocationPoint();
|
|
384
328
|
}, 50);
|
|
385
329
|
}
|
|
386
|
-
}
|
|
387
|
-
|
|
330
|
+
}
|
|
331
|
+
//校正定位的点位位置到当前的中心点
|
|
388
332
|
}, {
|
|
389
333
|
key: "correction",
|
|
390
334
|
value: function correction() {
|
|
391
|
-
var t = this;
|
|
392
|
-
|
|
335
|
+
var t = this;
|
|
336
|
+
//获取当前中心点经纬度
|
|
393
337
|
var lglt = this.map.getMapExtent();
|
|
394
338
|
var locationPoint = t.state.locationPoint;
|
|
395
339
|
locationPoint = locationPoint.map(function (item, index) {
|
|
@@ -399,16 +343,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
399
343
|
});
|
|
400
344
|
});
|
|
401
345
|
this.map.updatePoint(locationPoint);
|
|
402
|
-
}
|
|
403
|
-
|
|
346
|
+
}
|
|
347
|
+
//搜索关键字切换
|
|
404
348
|
}, {
|
|
405
349
|
key: "changeValue",
|
|
406
350
|
value: function changeValue(e) {
|
|
407
351
|
this.setState({
|
|
408
352
|
searchValue: e.target.value
|
|
409
353
|
});
|
|
410
|
-
}
|
|
411
|
-
|
|
354
|
+
}
|
|
355
|
+
//根据关键字搜索数据
|
|
412
356
|
}, {
|
|
413
357
|
key: "searchList",
|
|
414
358
|
value: function searchList() {
|
|
@@ -418,9 +362,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
418
362
|
searchPoints.then(function (results) {
|
|
419
363
|
if (results.length > 0) {
|
|
420
364
|
var lsp = [],
|
|
421
|
-
|
|
365
|
+
lsm = [];
|
|
422
366
|
t.apid = [];
|
|
423
|
-
|
|
424
367
|
for (var i = 0; i < results.length; i++) {
|
|
425
368
|
var r = results[i];
|
|
426
369
|
lsp.push(_objectSpread(_objectSpread({}, results[i]), {}, {
|
|
@@ -435,7 +378,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
435
378
|
});
|
|
436
379
|
t.apid.push(r.id);
|
|
437
380
|
}
|
|
438
|
-
|
|
439
381
|
t.setState({
|
|
440
382
|
listPoint: lsp,
|
|
441
383
|
listMess: lsm,
|
|
@@ -446,13 +388,12 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
446
388
|
warning();
|
|
447
389
|
}
|
|
448
390
|
});
|
|
449
|
-
}
|
|
450
|
-
|
|
391
|
+
}
|
|
392
|
+
//返回最佳位置(zoom,center)
|
|
451
393
|
}, {
|
|
452
394
|
key: "setFitView",
|
|
453
395
|
value: function setFitView() {
|
|
454
396
|
var _this2 = this;
|
|
455
|
-
|
|
456
397
|
this.setState({
|
|
457
398
|
mapVisiblePoints: {
|
|
458
399
|
fitView: this.apid,
|
|
@@ -464,8 +405,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
464
405
|
setVisiblePoints: false
|
|
465
406
|
});
|
|
466
407
|
});
|
|
467
|
-
}
|
|
468
|
-
|
|
408
|
+
}
|
|
409
|
+
//清空列表的所有数据(包括点位)
|
|
469
410
|
}, {
|
|
470
411
|
key: "clearList",
|
|
471
412
|
value: function clearList() {
|
|
@@ -476,15 +417,15 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
476
417
|
listMess: [],
|
|
477
418
|
isShowList: false
|
|
478
419
|
});
|
|
479
|
-
}
|
|
480
|
-
|
|
420
|
+
}
|
|
421
|
+
//列表选中地址
|
|
481
422
|
}, {
|
|
482
423
|
key: "chooseAddress",
|
|
483
424
|
value: function chooseAddress(id) {
|
|
484
425
|
var t = this;
|
|
485
426
|
var _this$state2 = this.state,
|
|
486
|
-
|
|
487
|
-
|
|
427
|
+
listPoint = _this$state2.listPoint,
|
|
428
|
+
listMess = _this$state2.listMess;
|
|
488
429
|
var mapCenter = [];
|
|
489
430
|
listPoint = listPoint.map(function (item, index) {
|
|
490
431
|
if (item.id === id) {
|
|
@@ -520,7 +461,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
520
461
|
t.setState({
|
|
521
462
|
setCenter: false
|
|
522
463
|
});
|
|
523
|
-
|
|
524
464
|
if (t.state.graphicType == 'point') {
|
|
525
465
|
t.correction();
|
|
526
466
|
}
|
|
@@ -530,14 +470,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
530
470
|
key: "clickGraphic",
|
|
531
471
|
value: function clickGraphic(obj) {
|
|
532
472
|
var _this3 = this;
|
|
533
|
-
|
|
534
473
|
if (obj.type === 'point' && obj.attributes.other === 'search') {
|
|
535
474
|
this.chooseAddress(obj.attributes.id);
|
|
536
475
|
}
|
|
537
|
-
|
|
538
|
-
if (this.clickable && obj.type === 'polygon') {
|
|
476
|
+
if (this.clickable && ['polygon', 'polyline'].includes(obj.type)) {
|
|
539
477
|
var _obj$param$attributes;
|
|
540
|
-
|
|
541
478
|
// 开启编辑
|
|
542
479
|
this.setState({
|
|
543
480
|
editGraphicId: obj.param.id || ((_obj$param$attributes = obj.param.attributes) === null || _obj$param$attributes === void 0 ? void 0 : _obj$param$attributes.id),
|
|
@@ -561,17 +498,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
561
498
|
this.setState({
|
|
562
499
|
modal1Visible: false
|
|
563
500
|
});
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
501
|
+
}
|
|
502
|
+
// if(this.props.clearDrawnGraph){
|
|
503
|
+
this.clearDrawnGraph();
|
|
504
|
+
// }
|
|
568
505
|
}
|
|
569
506
|
}
|
|
570
507
|
}, {
|
|
571
508
|
key: "clearDrawnGraph",
|
|
572
509
|
value: function clearDrawnGraph() {
|
|
573
510
|
var _this4 = this;
|
|
574
|
-
|
|
575
511
|
this.isDrawStatus = true;
|
|
576
512
|
this.setState({
|
|
577
513
|
isDraw: this.state.graphicType !== 'point',
|
|
@@ -587,7 +523,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
587
523
|
key: "continueDraw",
|
|
588
524
|
value: function continueDraw(func) {
|
|
589
525
|
var _this5 = this;
|
|
590
|
-
|
|
591
526
|
this.clickable = false;
|
|
592
527
|
this.setState({
|
|
593
528
|
isDraw: false,
|
|
@@ -610,15 +545,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
610
545
|
key: "editGraphic",
|
|
611
546
|
value: function editGraphic() {
|
|
612
547
|
var _this6 = this;
|
|
613
|
-
|
|
614
548
|
if (this.isDrawStatus && this.isClickMap) {
|
|
615
549
|
_message["default"].warning('请双击结束图元编辑');
|
|
616
|
-
|
|
617
550
|
return;
|
|
618
551
|
}
|
|
619
|
-
|
|
620
552
|
_message["default"].info('请点击图元进行编辑');
|
|
621
|
-
|
|
622
553
|
this.clickable = true;
|
|
623
554
|
this.isDrawStatus = false;
|
|
624
555
|
this.setState({
|
|
@@ -638,8 +569,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
638
569
|
value: function editGraphicChange(obj) {
|
|
639
570
|
if (!this.multiDraw) return;
|
|
640
571
|
var _this$state3 = this.state,
|
|
641
|
-
|
|
642
|
-
|
|
572
|
+
graphicValue = _this$state3.graphicValue,
|
|
573
|
+
editGraphic = _this$state3.editGraphic;
|
|
643
574
|
this.setState({
|
|
644
575
|
graphicValue: (graphicValue || []).map(function (item) {
|
|
645
576
|
return item.id === obj.id ? obj : item;
|
|
@@ -658,7 +589,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
658
589
|
currentMap: str
|
|
659
590
|
});
|
|
660
591
|
var layers = [];
|
|
661
|
-
|
|
662
592
|
switch (mapType) {
|
|
663
593
|
case 'amap':
|
|
664
594
|
case 'bmap':
|
|
@@ -668,12 +598,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
668
598
|
} else {
|
|
669
599
|
t.map.setMapType('wx');
|
|
670
600
|
}
|
|
671
|
-
|
|
672
601
|
break;
|
|
673
|
-
|
|
674
602
|
case 'gmap':
|
|
675
603
|
break;
|
|
676
|
-
|
|
677
604
|
default:
|
|
678
605
|
break;
|
|
679
606
|
}
|
|
@@ -682,41 +609,40 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
682
609
|
key: "render",
|
|
683
610
|
value: function render() {
|
|
684
611
|
var _this7 = this;
|
|
685
|
-
|
|
686
612
|
var t = this;
|
|
687
613
|
var _this$state4 = this.state,
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
614
|
+
isShowList = _this$state4.isShowList,
|
|
615
|
+
searchValue = _this$state4.searchValue,
|
|
616
|
+
locationPoint = _this$state4.locationPoint,
|
|
617
|
+
listPoint = _this$state4.listPoint,
|
|
618
|
+
listMess = _this$state4.listMess,
|
|
619
|
+
mapZoomLevel = _this$state4.mapZoomLevel,
|
|
620
|
+
setZoomLevel = _this$state4.setZoomLevel,
|
|
621
|
+
maxZoom = _this$state4.maxZoom,
|
|
622
|
+
minZoom = _this$state4.minZoom,
|
|
623
|
+
wkid = _this$state4.wkid,
|
|
624
|
+
mapServer = _this$state4.mapServer,
|
|
625
|
+
mapCenter = _this$state4.mapCenter,
|
|
626
|
+
setCenter = _this$state4.setCenter,
|
|
627
|
+
mapType = _this$state4.mapType,
|
|
628
|
+
mapStyle = _this$state4.mapStyle,
|
|
629
|
+
mapVisiblePoints = _this$state4.mapVisiblePoints,
|
|
630
|
+
setVisiblePoints = _this$state4.setVisiblePoints,
|
|
631
|
+
isDoEdit = _this$state4.isDoEdit,
|
|
632
|
+
editGraphicId = _this$state4.editGraphicId,
|
|
633
|
+
isEndEdit = _this$state4.isEndEdit,
|
|
634
|
+
modal1Visible = _this$state4.modal1Visible,
|
|
635
|
+
drawGraphID = _this$state4.drawGraphID,
|
|
636
|
+
isShowOther = _this$state4.isShowOther,
|
|
637
|
+
otherText = _this$state4.otherText,
|
|
638
|
+
isShowOtherGraph = _this$state4.isShowOtherGraph,
|
|
639
|
+
editGraphic = _this$state4.editGraphic,
|
|
640
|
+
graphicType = _this$state4.graphicType,
|
|
641
|
+
graphicValue = _this$state4.graphicValue,
|
|
642
|
+
olProps = _this$state4.olProps,
|
|
643
|
+
isChangeMapType = _this$state4.isChangeMapType,
|
|
644
|
+
currentMap = _this$state4.currentMap,
|
|
645
|
+
showControl = _this$state4.showControl;
|
|
720
646
|
var InputProps = {
|
|
721
647
|
style: {
|
|
722
648
|
'width': '200px'
|
|
@@ -741,11 +667,9 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
741
667
|
isDoEdit: !_this7.multiDraw,
|
|
742
668
|
isDraw: _this7.multiDraw
|
|
743
669
|
};
|
|
744
|
-
|
|
745
670
|
if (!_this7.multiDraw && (obj.geometryType == 'polyline' || obj.geometryType == 'polygon')) {
|
|
746
671
|
objparam.editGraphicId = obj.id;
|
|
747
672
|
}
|
|
748
|
-
|
|
749
673
|
_this7.setState(objparam);
|
|
750
674
|
},
|
|
751
675
|
mapDraw: {
|
|
@@ -777,49 +701,42 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
777
701
|
}
|
|
778
702
|
};
|
|
779
703
|
var mapPoints = [],
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
704
|
+
mapLines = [],
|
|
705
|
+
mapPolygons = [],
|
|
706
|
+
mapCircles = [];
|
|
784
707
|
if (graphicType == 'point') {
|
|
785
708
|
mapPoints = [].concat(_toConsumableArray(locationPoint), _toConsumableArray(listPoint));
|
|
786
709
|
} else {
|
|
787
710
|
mapPoints = _toConsumableArray(listPoint);
|
|
788
711
|
}
|
|
789
|
-
|
|
790
712
|
if (graphicType === 'polygon') {
|
|
791
713
|
if (editGraphic) {
|
|
792
714
|
var _mapPolygons;
|
|
793
|
-
|
|
794
715
|
Array.isArray(editGraphic) ? (_mapPolygons = mapPolygons).push.apply(_mapPolygons, _toConsumableArray(editGraphic)) : mapPolygons.push(editGraphic);
|
|
795
716
|
!this.multiDraw && (drawProps = null);
|
|
796
717
|
}
|
|
797
718
|
}
|
|
798
|
-
|
|
799
719
|
if (graphicType === 'polyline') {
|
|
800
720
|
if (editGraphic) {
|
|
801
|
-
|
|
802
|
-
|
|
721
|
+
var _mapLines;
|
|
722
|
+
Array.isArray(editGraphic) ? (_mapLines = mapLines).push.apply(_mapLines, _toConsumableArray(editGraphic)) : mapLines.push(editGraphic);
|
|
723
|
+
!this.multiDraw && (drawProps = null);
|
|
803
724
|
}
|
|
804
725
|
}
|
|
805
|
-
|
|
806
726
|
if (graphicType === 'rectangle') {
|
|
807
727
|
if (editGraphic) {
|
|
808
728
|
mapPolygons.push(editGraphic);
|
|
809
729
|
drawProps = null;
|
|
810
730
|
}
|
|
811
731
|
}
|
|
812
|
-
|
|
813
732
|
if (graphicType === 'circle') {
|
|
814
733
|
if (editGraphic) {
|
|
815
734
|
mapCircles.push(editGraphic);
|
|
816
735
|
drawProps = null;
|
|
817
736
|
}
|
|
818
737
|
}
|
|
819
|
-
|
|
820
738
|
if (isShowOtherGraph) {
|
|
821
739
|
var otherGraph = this.props.otherGraph;
|
|
822
|
-
|
|
823
740
|
if (otherGraph) {
|
|
824
741
|
mapPoints = [].concat(_toConsumableArray(mapPoints), _toConsumableArray(otherGraph.point || []));
|
|
825
742
|
mapLines = [].concat(_toConsumableArray(mapLines), _toConsumableArray(otherGraph.polyline || []));
|
|
@@ -827,7 +744,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
827
744
|
mapCircles = [].concat(_toConsumableArray(mapCircles), _toConsumableArray(otherGraph.circle || []));
|
|
828
745
|
}
|
|
829
746
|
}
|
|
830
|
-
|
|
831
747
|
var mapTypeContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
832
748
|
style: {
|
|
833
749
|
width: '170px',
|
|
@@ -863,7 +779,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
863
779
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
864
780
|
src: "".concat(_default2["default"].mapServerURL, "/images/wx.png")
|
|
865
781
|
})));
|
|
866
|
-
|
|
867
782
|
return /*#__PURE__*/_react["default"].createElement(_VtxModal.VtxModal, {
|
|
868
783
|
title: this.state.graphicType == 'point' ? "定位" : "绘制",
|
|
869
784
|
style: {
|
|
@@ -885,10 +800,8 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
885
800
|
onClick: function onClick() {
|
|
886
801
|
if (_this7.multiDraw && _this7.state.isDoEdit && !_this7.state.isEndEdit) {
|
|
887
802
|
_this7.continueDraw(_this7.callback.bind(_this7));
|
|
888
|
-
|
|
889
803
|
return;
|
|
890
804
|
}
|
|
891
|
-
|
|
892
805
|
_this7.callback();
|
|
893
806
|
},
|
|
894
807
|
icon: getIcon('check')
|
|
@@ -918,16 +831,14 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
918
831
|
disabled: this.isDrawStatus,
|
|
919
832
|
onClick: function onClick() {
|
|
920
833
|
_this7.isDrawStatus = true;
|
|
921
|
-
|
|
922
834
|
if (_this7.multiDraw) {
|
|
923
835
|
_this7.clickable = false;
|
|
924
|
-
graphicValue === null || graphicValue === void 0
|
|
836
|
+
graphicValue === null || graphicValue === void 0 || graphicValue.forEach(function (item) {
|
|
925
837
|
return t.map.removeGraphic(item.id, 'draw');
|
|
926
838
|
});
|
|
927
|
-
editGraphic === null || editGraphic === void 0
|
|
839
|
+
editGraphic === null || editGraphic === void 0 || editGraphic.forEach(function (item) {
|
|
928
840
|
return t.map.removeGraphic(item.id, 'draw');
|
|
929
841
|
});
|
|
930
|
-
|
|
931
842
|
_this7.setState({
|
|
932
843
|
isDraw: false,
|
|
933
844
|
isCloseDraw: true,
|
|
@@ -954,7 +865,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
954
865
|
});
|
|
955
866
|
});
|
|
956
867
|
}
|
|
957
|
-
|
|
958
868
|
_this7.callback('editDraw');
|
|
959
869
|
},
|
|
960
870
|
icon: getIcon('edit')
|
|
@@ -1059,15 +969,11 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1059
969
|
key: "initSearchMap",
|
|
1060
970
|
value: function initSearchMap() {
|
|
1061
971
|
var _this8 = this;
|
|
1062
|
-
|
|
1063
|
-
if (this.props.modal1Visible
|
|
1064
|
-
/*&& !this.state.locationPoint[0]*/
|
|
1065
|
-
) {
|
|
972
|
+
if (this.props.modal1Visible /*&& !this.state.locationPoint[0]*/) {
|
|
1066
973
|
if (this.map) {
|
|
1067
974
|
this.map.loadMapComplete.then(function () {
|
|
1068
975
|
if (!_this8.mapLoaded) {
|
|
1069
976
|
_this8.mapLoaded = true;
|
|
1070
|
-
|
|
1071
977
|
_this8.drawLocationPoint();
|
|
1072
978
|
}
|
|
1073
979
|
});
|
|
@@ -1090,20 +996,16 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1090
996
|
key: "componentWillReceiveProps",
|
|
1091
997
|
value: function componentWillReceiveProps(nextProps) {
|
|
1092
998
|
var _this9 = this;
|
|
1093
|
-
|
|
1094
999
|
var t = this;
|
|
1095
1000
|
this.isClickMap = false;
|
|
1096
|
-
|
|
1097
1001
|
if (t.state.graphicType !== nextProps.graphicType && !!this.map) {
|
|
1098
1002
|
this.map.clearAll();
|
|
1099
1003
|
t.mapLoaded = false;
|
|
1100
1004
|
t.isinit = true;
|
|
1101
1005
|
}
|
|
1102
|
-
|
|
1103
1006
|
if (nextProps.editParam) {
|
|
1104
1007
|
t.mapLoaded = false;
|
|
1105
1008
|
}
|
|
1106
|
-
|
|
1107
1009
|
t.isDrawStatus = nextProps.graphicType !== 'point' && !nextProps.editParam;
|
|
1108
1010
|
this.setState({
|
|
1109
1011
|
modal1Visible: nextProps.modal1Visible,
|
|
@@ -1128,7 +1030,6 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1128
1030
|
//实现2+次进入时,清理数据
|
|
1129
1031
|
if (nextProps.modal1Visible) {
|
|
1130
1032
|
_this9.clearList();
|
|
1131
|
-
|
|
1132
1033
|
_this9.setState({
|
|
1133
1034
|
setZoomLevel: true
|
|
1134
1035
|
}, function () {
|
|
@@ -1136,39 +1037,27 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1136
1037
|
setZoomLevel: false
|
|
1137
1038
|
});
|
|
1138
1039
|
});
|
|
1139
|
-
|
|
1140
1040
|
if (!!_this9.map && !!_this9.state.locationPoint[0] && nextProps.mapCenter && !!nextProps.mapCenter[0]) {
|
|
1141
1041
|
if (_this9.map.getGraphic('locationPoint')) {
|
|
1142
1042
|
switch (nextProps.mapType) {
|
|
1143
1043
|
case 'bmap':
|
|
1144
1044
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new BMap.Point(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1145
|
-
|
|
1146
1045
|
break;
|
|
1147
|
-
|
|
1148
1046
|
case 'amap':
|
|
1149
1047
|
_this9.map.getGraphic('locationPoint').mapLayer.setPosition(new AMap.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1150
|
-
|
|
1151
1048
|
break;
|
|
1152
|
-
|
|
1153
1049
|
case 'tmap':
|
|
1154
1050
|
_this9.map.getGraphic('locationPoint').mapLayer.setLngLat(new T.LngLat(nextProps.mapCenter[0], nextProps.mapCenter[1]));
|
|
1155
|
-
|
|
1156
1051
|
break;
|
|
1157
|
-
|
|
1158
1052
|
case 'gmap':
|
|
1159
1053
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLatitude(nextProps.mapCenter[1]);
|
|
1160
|
-
|
|
1161
1054
|
_this9.map.getGraphic('locationPoint').mapLayer.geometry.setLongitude(nextProps.mapCenter[0]);
|
|
1162
|
-
|
|
1163
1055
|
_this9.map.state.gis.graphics.refresh();
|
|
1164
|
-
|
|
1165
1056
|
case 'olMap':
|
|
1166
1057
|
_this9.map.getGraphic('locationPoint').mapLayer.setGeometry(new ol.geom.Point(nextProps.mapCenter));
|
|
1167
|
-
|
|
1168
1058
|
break;
|
|
1169
1059
|
}
|
|
1170
1060
|
}
|
|
1171
|
-
|
|
1172
1061
|
_this9.map.setCenter(nextProps.mapCenter);
|
|
1173
1062
|
}
|
|
1174
1063
|
}
|
|
@@ -1179,17 +1068,13 @@ var VtxSearchMap = /*#__PURE__*/function (_React$Component) {
|
|
|
1179
1068
|
value: function componentWillUnmount() {
|
|
1180
1069
|
//关闭moveTo定时
|
|
1181
1070
|
var t = this;
|
|
1182
|
-
|
|
1183
1071
|
if (t.loadExtent) {
|
|
1184
1072
|
clearInterval(t.loadExtent);
|
|
1185
1073
|
}
|
|
1186
1074
|
}
|
|
1187
1075
|
}]);
|
|
1188
|
-
|
|
1189
1076
|
return VtxSearchMap;
|
|
1190
1077
|
}(_react["default"].Component);
|
|
1191
|
-
|
|
1192
|
-
var _default = VtxSearchMap;
|
|
1193
|
-
exports["default"] = _default;
|
|
1078
|
+
var _default = exports["default"] = VtxSearchMap;
|
|
1194
1079
|
module.exports = exports["default"];
|
|
1195
1080
|
//# sourceMappingURL=VtxSearchMap.js.map
|