@vtx/map 1.1.28 → 1.1.30
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 +69 -0
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +65 -0
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.js +76 -14
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +87 -6
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/package.json +1 -1
package/lib/VtxMap/TMap/TMap.js
CHANGED
|
@@ -25,12 +25,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
25
25
|
|
|
26
26
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
27
27
|
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
28
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
29
|
|
|
36
30
|
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."); }
|
|
@@ -43,6 +37,12 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
43
37
|
|
|
44
38
|
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; }
|
|
45
39
|
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
46
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
47
47
|
|
|
48
48
|
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); } }
|
|
@@ -156,6 +156,7 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
156
156
|
},
|
|
157
157
|
controlStyle: 'lt'
|
|
158
158
|
};
|
|
159
|
+
_this.frameSelectProps = {};
|
|
159
160
|
|
|
160
161
|
_this.loadMapJs();
|
|
161
162
|
|
|
@@ -380,6 +381,68 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
380
381
|
pointCollectionDiv["class"] = 'vtx_gmap_html_pointCollection_t';
|
|
381
382
|
pointCollectionDiv.className = 'vtx_gmap_html_pointCollection_t';
|
|
382
383
|
$(t.state.gis.getPanes().mapPane.children[0]).before(pointCollectionDiv);
|
|
384
|
+
t.initPropsForUser();
|
|
385
|
+
} // 初始化对外方法
|
|
386
|
+
|
|
387
|
+
}, {
|
|
388
|
+
key: "initPropsForUser",
|
|
389
|
+
value: function initPropsForUser() {
|
|
390
|
+
var t = this;
|
|
391
|
+
|
|
392
|
+
t.state.gis["frameSelect"] = function () {
|
|
393
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
394
|
+
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
395
|
+
return t.frameSelect(obj, callback);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
t.state.gis["clearFrameSelect"] = function () {
|
|
399
|
+
return t.clearFrameSelect();
|
|
400
|
+
};
|
|
401
|
+
} // 框选
|
|
402
|
+
|
|
403
|
+
}, {
|
|
404
|
+
key: "frameSelect",
|
|
405
|
+
value: function frameSelect(_ref, callback) {
|
|
406
|
+
var geometryType = _ref.geometryType,
|
|
407
|
+
_ref$parameter = _ref.parameter,
|
|
408
|
+
parameter = _ref$parameter === void 0 ? {} : _ref$parameter,
|
|
409
|
+
_ref$data = _ref.data,
|
|
410
|
+
data = _ref$data === void 0 ? {} : _ref$data;
|
|
411
|
+
|
|
412
|
+
if (!['polygon', 'circle', 'rectangle'].includes(geometryType)) {
|
|
413
|
+
message.warn("传入的类型不支持框选!");
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
var t = this;
|
|
418
|
+
var params = {},
|
|
419
|
+
type = geometryType || 'polygon',
|
|
420
|
+
id = data.id || 'frameSelectFeature';
|
|
421
|
+
params.color = parameter.color || 'red';
|
|
422
|
+
params.lineColor = parameter.lineColor || 'red';
|
|
423
|
+
params.lineOpacity = parameter.lineOpacity || 1;
|
|
424
|
+
params.lineWidth = parameter.lineWidth || 2;
|
|
425
|
+
params.pellucidity = parameter.pellucidity || 0.6;
|
|
426
|
+
params.lineType = parameter.lineType || 'solid';
|
|
427
|
+
t.draw({
|
|
428
|
+
geometryType: type,
|
|
429
|
+
parameter: _objectSpread(_objectSpread({}, parameter), params),
|
|
430
|
+
data: {
|
|
431
|
+
id: id
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
t.frameSelectProps = {
|
|
435
|
+
callback: callback,
|
|
436
|
+
id: id,
|
|
437
|
+
type: geometryType
|
|
438
|
+
};
|
|
439
|
+
} // 清除框选
|
|
440
|
+
|
|
441
|
+
}, {
|
|
442
|
+
key: "clearFrameSelect",
|
|
443
|
+
value: function clearFrameSelect() {
|
|
444
|
+
this.removeGraphic(this.frameSelectProps.id, this.frameSelectProps.type);
|
|
445
|
+
this.frameSelectProps = {};
|
|
383
446
|
}
|
|
384
447
|
}, {
|
|
385
448
|
key: "setMapType",
|
|
@@ -2007,6 +2070,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2007
2070
|
this.polygonTool = new T.PolygonTool(this.state.gis, paramgcr);
|
|
2008
2071
|
this.polygonTool.open();
|
|
2009
2072
|
this.polygonTool.addEventListener('draw', function (ob) {
|
|
2073
|
+
var _t$frameSelectProps;
|
|
2074
|
+
|
|
2010
2075
|
var type = ob.type,
|
|
2011
2076
|
target = ob.target,
|
|
2012
2077
|
currentLnglats = ob.currentLnglats,
|
|
@@ -2060,6 +2125,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2060
2125
|
if ('drawEnd' in t.props) {
|
|
2061
2126
|
t.props.drawEnd(backobj);
|
|
2062
2127
|
}
|
|
2128
|
+
|
|
2129
|
+
if (((_t$frameSelectProps = t.frameSelectProps) === null || _t$frameSelectProps === void 0 ? void 0 : _t$frameSelectProps.callback) instanceof Function) {
|
|
2130
|
+
t.frameSelectProps.callback(backobj);
|
|
2131
|
+
}
|
|
2063
2132
|
});
|
|
2064
2133
|
break;
|
|
2065
2134
|
|
|
@@ -2068,6 +2137,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2068
2137
|
this.circleTool = new T.CircleTool(this.state.gis, paramgcr);
|
|
2069
2138
|
this.circleTool.open();
|
|
2070
2139
|
this.circleTool.addEventListener('drawend', function (ob) {
|
|
2140
|
+
var _t$frameSelectProps2;
|
|
2141
|
+
|
|
2071
2142
|
var type = ob.type,
|
|
2072
2143
|
target = ob.target,
|
|
2073
2144
|
currentCenter = ob.currentCenter,
|
|
@@ -2115,6 +2186,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2115
2186
|
if ('drawEnd' in t.props) {
|
|
2116
2187
|
t.props.drawEnd(backobj);
|
|
2117
2188
|
}
|
|
2189
|
+
|
|
2190
|
+
if (((_t$frameSelectProps2 = t.frameSelectProps) === null || _t$frameSelectProps2 === void 0 ? void 0 : _t$frameSelectProps2.callback) instanceof Function) {
|
|
2191
|
+
t.frameSelectProps.callback(backobj);
|
|
2192
|
+
}
|
|
2118
2193
|
});
|
|
2119
2194
|
break;
|
|
2120
2195
|
|
|
@@ -2123,6 +2198,8 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2123
2198
|
this.rectangleTool = new T.RectangleTool(this.state.gis, paramgcr);
|
|
2124
2199
|
this.rectangleTool.open();
|
|
2125
2200
|
this.rectangleTool.addEventListener('draw', function (ob) {
|
|
2201
|
+
var _t$frameSelectProps3;
|
|
2202
|
+
|
|
2126
2203
|
var type = ob.type,
|
|
2127
2204
|
target = ob.target,
|
|
2128
2205
|
currentBounds = ob.currentBounds,
|
|
@@ -2183,6 +2260,10 @@ var TMap = /*#__PURE__*/function (_React$Component) {
|
|
|
2183
2260
|
if ('drawEnd' in t.props) {
|
|
2184
2261
|
t.props.drawEnd(backobj);
|
|
2185
2262
|
}
|
|
2263
|
+
|
|
2264
|
+
if (((_t$frameSelectProps3 = t.frameSelectProps) === null || _t$frameSelectProps3 === void 0 ? void 0 : _t$frameSelectProps3.callback) instanceof Function) {
|
|
2265
|
+
t.frameSelectProps.callback(backobj);
|
|
2266
|
+
}
|
|
2186
2267
|
});
|
|
2187
2268
|
break;
|
|
2188
2269
|
} //保存绘制图元的id便于后期比对
|