@aibee/crc-bmap 0.0.21 → 0.0.22

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/bmap.esm.js CHANGED
@@ -707,7 +707,8 @@ var defaultOptions2 = {
707
707
  text: "",
708
708
  level: 1,
709
709
  collision_enable: true,
710
- opacity: 1
710
+ opacity: 1,
711
+ id: ""
711
712
  };
712
713
  var Poi = class extends Object3D4 {
713
714
  constructor(context, options) {
@@ -916,6 +917,12 @@ var PoiLayer = class extends Layer {
916
917
  this.remove(poi);
917
918
  poi.dispose();
918
919
  }
920
+ removePoiById(id) {
921
+ const poi = this.pois.find((item) => item.options.id === id);
922
+ if (poi) {
923
+ this.removePoi(poi);
924
+ }
925
+ }
919
926
  /**
920
927
  * 保存poi按照level排序
921
928
  * @param poi
@@ -2309,6 +2316,9 @@ var BMap = class extends EventDispatcher6 {
2309
2316
  }
2310
2317
  createGraphicPoi(graphic, options) {
2311
2318
  if (this.context.currentFloor) {
2319
+ if (options.id === void 0) {
2320
+ options.id = graphic.options.id;
2321
+ }
2312
2322
  const poi = this.context.currentFloor.addPoi(options);
2313
2323
  const position = graphic.getCenter();
2314
2324
  position.z += graphic.options.height / 2;
@@ -2507,6 +2517,10 @@ var BMap = class extends EventDispatcher6 {
2507
2517
  }
2508
2518
  return (_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.createGraphic(options);
2509
2519
  }
2520
+ removePoiById(id) {
2521
+ var _a;
2522
+ return (_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.removePoiById(id);
2523
+ }
2510
2524
  dispose() {
2511
2525
  this.context.dispose();
2512
2526
  clearTextTexture();