@vtx/map 1.1.39 → 1.1.40

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.
@@ -3405,8 +3405,9 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
3405
3405
  }
3406
3406
  }, {
3407
3407
  key: "clearCluster",
3408
- value: function clearCluster() {
3408
+ value: function clearCluster(arg) {
3409
3409
  var t = this;
3410
+ var ids = arg && (arg === null || arg === void 0 ? void 0 : arg.length) > 0 ? arg : t.state.pointIds;
3410
3411
 
3411
3412
  if (t.clusterInfo.clusterHulls) {
3412
3413
  t.state.gis.removeLayer(t.clusterInfo.clusterHulls);
@@ -3423,10 +3424,12 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
3423
3424
  t.clusterInfo.clusterCircles = null;
3424
3425
  }
3425
3426
 
3426
- t.props.mapPoints.map(function (item) {
3427
- if (t.GM.getGraphic(item.id)) {
3428
- t.GM.removeGraphic(item.id);
3427
+ ids.map(function (id) {
3428
+ if (t.GM.getGraphic(id)) {
3429
+ t.GM.removeGraphic(id);
3429
3430
  }
3431
+
3432
+ t.state.pointIds.splice(t.state.pointIds.indexOf(id), 1);
3430
3433
  });
3431
3434
  t.addPoint(t.props.mapPoints);
3432
3435
  t.refresh();
@@ -4185,8 +4188,10 @@ var OlMap = /*#__PURE__*/function (_React$Component) {
4185
4188
 
4186
4189
  if (typeof setCluster == 'boolean' && setCluster || setCluster && setCluster !== t.props.setCluster) {
4187
4190
  t.cluster(mapCluster);
4188
- } else if (setCluster !== t.props.setCluster) {
4189
- t.clearCluster();
4191
+ }
4192
+
4193
+ if (!setCluster && setCluster !== t.props.setCluster) {
4194
+ t.clearCluster(mapCluster);
4190
4195
  } //图元编辑调用
4191
4196
 
4192
4197