@vtx/map 1.1.30 → 1.1.31
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 +27 -12
- package/lib/VtxMap/TMap/TMap.js.map +1 -1
- package/package.json +1 -1
package/lib/VtxMap/BMap/Map.js
CHANGED
|
@@ -523,7 +523,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
523
523
|
t._drawmanager = new BMapLib.DrawingManager(map); //监听绘制结束事件
|
|
524
524
|
|
|
525
525
|
t._drawmanager.addEventListener('overlaycomplete', function (e) {
|
|
526
|
-
var _t$frameSelectProps;
|
|
526
|
+
var _t$frameSelectProps$b;
|
|
527
527
|
|
|
528
528
|
if (e.label) {
|
|
529
529
|
t.state.gis.removeOverlay(e.label);
|
|
@@ -605,8 +605,8 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
605
605
|
t.props.drawEnd(backobj);
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
if (((_t$frameSelectProps = t.frameSelectProps) === null || _t$frameSelectProps === void 0 ? void 0 : _t$frameSelectProps.callback) instanceof Function) {
|
|
609
|
-
t.frameSelectProps.callback(backobj);
|
|
608
|
+
if (((_t$frameSelectProps$b = t.frameSelectProps[backobj.id]) === null || _t$frameSelectProps$b === void 0 ? void 0 : _t$frameSelectProps$b.callback) instanceof Function) {
|
|
609
|
+
t.frameSelectProps[backobj.id].callback(backobj);
|
|
610
610
|
}
|
|
611
611
|
});
|
|
612
612
|
}
|
|
@@ -3163,7 +3163,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3163
3163
|
var t = this;
|
|
3164
3164
|
var params = {},
|
|
3165
3165
|
type = geometryType || 'polygon',
|
|
3166
|
-
id = data.id ||
|
|
3166
|
+
id = data.id || "frameSelectFeature_".concat(Math.random());
|
|
3167
3167
|
params.color = parameter.color || 'red';
|
|
3168
3168
|
params.lineColor = parameter.lineColor || 'red';
|
|
3169
3169
|
params.lineOpacity = parameter.lineOpacity || 1;
|
|
@@ -3177,7 +3177,7 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3177
3177
|
id: id
|
|
3178
3178
|
}
|
|
3179
3179
|
});
|
|
3180
|
-
t.frameSelectProps = {
|
|
3180
|
+
t.frameSelectProps[id] = {
|
|
3181
3181
|
callback: callback,
|
|
3182
3182
|
id: id,
|
|
3183
3183
|
type: geometryType
|
|
@@ -3187,8 +3187,19 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3187
3187
|
}, {
|
|
3188
3188
|
key: "clearFrameSelect",
|
|
3189
3189
|
value: function clearFrameSelect() {
|
|
3190
|
-
|
|
3190
|
+
for (var key in this.frameSelectProps) {
|
|
3191
|
+
this.removeGraphic(this.frameSelectProps[key].id, this.frameSelectProps[key].type);
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3191
3194
|
this.frameSelectProps = {};
|
|
3195
|
+
} // 清除框选ById
|
|
3196
|
+
|
|
3197
|
+
}, {
|
|
3198
|
+
key: "clearFrameSelectById",
|
|
3199
|
+
value: function clearFrameSelectById(id) {
|
|
3200
|
+
var obj = this.frameSelectProps[id];
|
|
3201
|
+
this.removeGraphic(obj.id, obj.type);
|
|
3202
|
+
delete this.frameSelectProps[id];
|
|
3192
3203
|
} // 关闭信息窗口
|
|
3193
3204
|
|
|
3194
3205
|
}, {
|
|
@@ -3740,6 +3751,10 @@ var BaiduMap = /*#__PURE__*/function (_React$Component) {
|
|
|
3740
3751
|
return t.clearFrameSelect();
|
|
3741
3752
|
};
|
|
3742
3753
|
|
|
3754
|
+
t.state.gis["clearFrameSelectById"] = function (id) {
|
|
3755
|
+
return t.clearFrameSelectById(id);
|
|
3756
|
+
};
|
|
3757
|
+
|
|
3743
3758
|
t.state.gis["refresh"] = function () {
|
|
3744
3759
|
t.refresh();
|
|
3745
3760
|
};
|