@aibee/crc-bmap 0.0.22 → 0.0.24

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
@@ -892,6 +892,11 @@ var PoiLayer = class extends Layer {
892
892
  });
893
893
  this.registryEvent();
894
894
  }
895
+ clear() {
896
+ super.clear();
897
+ this.pois = [];
898
+ return this;
899
+ }
895
900
  createPoi(options) {
896
901
  const poi = new Poi(this.context, options);
897
902
  this.add(poi);
@@ -1590,6 +1595,7 @@ var BoxSelection = class extends BaseSvg {
1590
1595
  const height = Math.abs(endPoint.y - startPoint.y);
1591
1596
  setRectPosition(this.rect, leftTop.x, leftTop.y, width, height);
1592
1597
  }
1598
+ setRectPosition(this.rect, 0, 0, 0, 0);
1593
1599
  });
1594
1600
  const { config: { selectBox: { fill, stroke } } } = context;
1595
1601
  this.rect = createRect(stroke, fill);
@@ -1638,6 +1644,14 @@ var BoxSelection = class extends BaseSvg {
1638
1644
  const { context: { camera, container: { clientWidth: w, clientHeight: h } } } = this;
1639
1645
  if (!object)
1640
1646
  return false;
1647
+ if (!object.mesh) {
1648
+ const position = object.getPosition();
1649
+ if (position) {
1650
+ const position2d = vector3ToDevice(position, camera, w, h);
1651
+ return isContain(position2d, leftTop, rightBottom);
1652
+ }
1653
+ return false;
1654
+ }
1641
1655
  if (!object.mesh.geometry.boundingBox) {
1642
1656
  object.mesh.geometry.computeBoundingBox();
1643
1657
  }
@@ -2521,6 +2535,16 @@ var BMap = class extends EventDispatcher6 {
2521
2535
  var _a;
2522
2536
  return (_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.removePoiById(id);
2523
2537
  }
2538
+ getPois() {
2539
+ var _a;
2540
+ return ((_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.pois) || [];
2541
+ }
2542
+ clearPoi() {
2543
+ if (this.context.currentFloor) {
2544
+ this.getPois().forEach((poi) => poi.dispose());
2545
+ this.context.currentFloor.poiLayer.clear();
2546
+ }
2547
+ }
2524
2548
  dispose() {
2525
2549
  this.context.dispose();
2526
2550
  clearTextTexture();