@vtx/map 1.1.30 → 1.1.32
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 +21 -6
- package/lib/VtxMap/AMap/AMap.js.map +1 -1
- package/lib/VtxMap/BMap/Map.js +21 -6
- package/lib/VtxMap/BMap/Map.js.map +1 -1
- package/lib/VtxMap/OlMap/Map.js +21 -6
- package/lib/VtxMap/OlMap/Map.js.map +1 -1
- package/lib/VtxMap/TMap/TMap.js +45 -17
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/package.json +1 -1
package/lib/VtxMap/AMap/AMap.js
CHANGED
|
@@ -499,7 +499,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
499
499
|
t.mousetool = new AMap.MouseTool(t.state.gis); //绘制完后的回调
|
|
500
500
|
|
|
501
501
|
t.mousetool.on('draw', function (_ref2) {
|
|
502
|
-
var _t$frameSelectProps;
|
|
502
|
+
var _t$frameSelectProps$b;
|
|
503
503
|
|
|
504
504
|
var type = _ref2.type,
|
|
505
505
|
obj = _ref2.obj;
|
|
@@ -576,8 +576,8 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
576
576
|
t.props.drawEnd(backobj);
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
-
if (((_t$frameSelectProps = t.frameSelectProps) === null || _t$frameSelectProps === void 0 ? void 0 : _t$frameSelectProps.callback) instanceof Function) {
|
|
580
|
-
t.frameSelectProps.callback(backobj);
|
|
579
|
+
if (((_t$frameSelectProps$b = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b === void 0 ? void 0 : _t$frameSelectProps$b.callback) instanceof Function) {
|
|
580
|
+
t.frameSelectProps[backobj.id].callback(backobj);
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
t.heatmap = new AMap.Heatmap(t.state.gis);
|
|
@@ -608,6 +608,10 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
608
608
|
t.state.gis["clearFrameSelect"] = function () {
|
|
609
609
|
return t.clearFrameSelect();
|
|
610
610
|
};
|
|
611
|
+
|
|
612
|
+
t.state.gis["clearFrameSelectById"] = function (id) {
|
|
613
|
+
return t.clearFrameSelectById(id);
|
|
614
|
+
};
|
|
611
615
|
} // 框选
|
|
612
616
|
|
|
613
617
|
}, {
|
|
@@ -627,7 +631,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
627
631
|
var t = this;
|
|
628
632
|
var params = {},
|
|
629
633
|
type = geometryType || 'polygon',
|
|
630
|
-
id = data.id ||
|
|
634
|
+
id = data.id || "frameSelectFeature_".concat(Math.random());
|
|
631
635
|
params.color = parameter.color || 'red';
|
|
632
636
|
params.lineColor = parameter.lineColor || 'red';
|
|
633
637
|
params.lineOpacity = parameter.lineOpacity || 1;
|
|
@@ -641,7 +645,7 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
641
645
|
id: id
|
|
642
646
|
}
|
|
643
647
|
});
|
|
644
|
-
t.frameSelectProps = {
|
|
648
|
+
t.frameSelectProps[id] = {
|
|
645
649
|
callback: callback,
|
|
646
650
|
id: id,
|
|
647
651
|
type: geometryType
|
|
@@ -651,8 +655,19 @@ var VortexAMap = /*#__PURE__*/function (_React$Component) {
|
|
|
651
655
|
}, {
|
|
652
656
|
key: "clearFrameSelect",
|
|
653
657
|
value: function clearFrameSelect() {
|
|
654
|
-
|
|
658
|
+
for (var key in this.frameSelectProps) {
|
|
659
|
+
this.removeGraphic(this.frameSelectProps[key].id, this.frameSelectProps[key].type);
|
|
660
|
+
}
|
|
661
|
+
|
|
655
662
|
this.frameSelectProps = {};
|
|
663
|
+
} // 清除框选ById
|
|
664
|
+
|
|
665
|
+
}, {
|
|
666
|
+
key: "clearFrameSelectById",
|
|
667
|
+
value: function clearFrameSelectById(id) {
|
|
668
|
+
var obj = this.frameSelectProps[id];
|
|
669
|
+
this.removeGraphic(obj.id, obj.type);
|
|
670
|
+
delete this.frameSelectProps[id];
|
|
656
671
|
}
|
|
657
672
|
/*
|
|
658
673
|
切换地图矢量图和卫星图背景
|