@aibee/crc-bmap 0.0.25 → 0.0.27

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
@@ -757,6 +757,7 @@ var Poi = class extends Object3D4 {
757
757
  div.style.justifyContent = `center`;
758
758
  div.style.alignItems = `center`;
759
759
  div.style.pointerEvents = `none`;
760
+ this.overlay.setOpacity(this.options.opacity);
760
761
  return div;
761
762
  }
762
763
  getPosition() {
@@ -926,6 +927,10 @@ var PoiLayer = class extends Layer {
926
927
  this.removePoi(poi);
927
928
  }
928
929
  }
930
+ getPoiById(id) {
931
+ const poi = this.pois.find((item) => item.options.id === id);
932
+ return poi || null;
933
+ }
929
934
  /**
930
935
  * 保存poi按照level排序
931
936
  * @param poi
@@ -1592,8 +1597,9 @@ var BoxSelection = class extends BaseSvg {
1592
1597
  const width = Math.abs(endPoint.x - startPoint.x);
1593
1598
  const height = Math.abs(endPoint.y - startPoint.y);
1594
1599
  setRectPosition(this.rect, leftTop.x, leftTop.y, width, height);
1600
+ } else {
1601
+ setRectPosition(this.rect, 0, 0, 0, 0);
1595
1602
  }
1596
- setRectPosition(this.rect, 0, 0, 0, 0);
1597
1603
  });
1598
1604
  const { config: { selectBox: { fill, stroke } } } = context;
1599
1605
  this.rect = createRect(stroke, fill);
@@ -1681,6 +1687,7 @@ var Selection = class extends EventDispatcher3 {
1681
1687
  __publicField(this, "_list", /* @__PURE__ */ new Set());
1682
1688
  __publicField(this, "boxSelection");
1683
1689
  __publicField(this, "prevPanStatus");
1690
+ __publicField(this, "prevRotateStatus");
1684
1691
  __publicField(this, "onPointerDown", (e) => {
1685
1692
  const { graphics } = this.context.getGraphicsByDeviceXy(e.offsetX, e.offsetY);
1686
1693
  const graphicIdSet = new Set(graphics.map((item) => item.options.id));
@@ -1705,13 +1712,16 @@ var Selection = class extends EventDispatcher3 {
1705
1712
  if (e.key === "Control") {
1706
1713
  this.boxSelection.setEnable(true);
1707
1714
  this.prevPanStatus = this.context.control.enablePan;
1715
+ this.prevRotateStatus = this.context.control.enableRotate;
1708
1716
  this.context.control.enablePan = false;
1717
+ this.context.control.enableRotate = false;
1709
1718
  }
1710
1719
  });
1711
1720
  __publicField(this, "onKeyUp", (e) => {
1712
1721
  if (e.key === "Control") {
1713
1722
  this.boxSelection.setEnable(false);
1714
1723
  this.context.control.enablePan = !!this.prevPanStatus;
1724
+ this.context.control.enableRotate = !!this.prevRotateStatus;
1715
1725
  }
1716
1726
  });
1717
1727
  __publicField(this, "onBoxSelected", ({ list }) => {
@@ -2545,6 +2555,10 @@ var BMap = class extends EventDispatcher6 {
2545
2555
  var _a;
2546
2556
  return (_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.removePoiById(id);
2547
2557
  }
2558
+ getPoiById(id) {
2559
+ var _a;
2560
+ return (_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.getPoiById(id);
2561
+ }
2548
2562
  getPois() {
2549
2563
  var _a;
2550
2564
  return ((_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.pois) || [];