@aibee/crc-bmap 0.0.23 → 0.0.25

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
@@ -157,8 +157,6 @@ function initControl(camera, domElement) {
157
157
  control.enableDamping = false;
158
158
  control.maxPolarAngle = 0;
159
159
  control.minPolarAngle = 0;
160
- control.maxAzimuthAngle = 0;
161
- control.minAzimuthAngle = 0;
162
160
  return control;
163
161
  }
164
162
  function initShape(path, holePath = []) {
@@ -892,6 +890,11 @@ var PoiLayer = class extends Layer {
892
890
  });
893
891
  this.registryEvent();
894
892
  }
893
+ clear() {
894
+ super.clear();
895
+ this.pois = [];
896
+ return this;
897
+ }
895
898
  createPoi(options) {
896
899
  const poi = new Poi(this.context, options);
897
900
  this.add(poi);
@@ -1590,6 +1593,7 @@ var BoxSelection = class extends BaseSvg {
1590
1593
  const height = Math.abs(endPoint.y - startPoint.y);
1591
1594
  setRectPosition(this.rect, leftTop.x, leftTop.y, width, height);
1592
1595
  }
1596
+ setRectPosition(this.rect, 0, 0, 0, 0);
1593
1597
  });
1594
1598
  const { config: { selectBox: { fill, stroke } } } = context;
1595
1599
  this.rect = createRect(stroke, fill);
@@ -1679,6 +1683,18 @@ var Selection = class extends EventDispatcher3 {
1679
1683
  __publicField(this, "prevPanStatus");
1680
1684
  __publicField(this, "onPointerDown", (e) => {
1681
1685
  const { graphics } = this.context.getGraphicsByDeviceXy(e.offsetX, e.offsetY);
1686
+ const graphicIdSet = new Set(graphics.map((item) => item.options.id));
1687
+ const pois = this.context.getPoisByDeviceXy(e.clientX, e.clientY);
1688
+ pois.forEach((item) => {
1689
+ var _a;
1690
+ if (!graphicIdSet.has(item.options.id)) {
1691
+ const graphic = ((_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.graphicMap.get(item.options.id)) || null;
1692
+ if (graphic) {
1693
+ graphics.push(graphic);
1694
+ graphicIdSet.add(item.options.id);
1695
+ }
1696
+ }
1697
+ });
1682
1698
  if (!e.ctrlKey) {
1683
1699
  this._list.clear();
1684
1700
  }
@@ -2529,6 +2545,16 @@ var BMap = class extends EventDispatcher6 {
2529
2545
  var _a;
2530
2546
  return (_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.removePoiById(id);
2531
2547
  }
2548
+ getPois() {
2549
+ var _a;
2550
+ return ((_a = this.context.currentFloor) == null ? void 0 : _a.poiLayer.pois) || [];
2551
+ }
2552
+ clearPoi() {
2553
+ if (this.context.currentFloor) {
2554
+ this.getPois().forEach((poi) => poi.dispose());
2555
+ this.context.currentFloor.poiLayer.clear();
2556
+ }
2557
+ }
2532
2558
  dispose() {
2533
2559
  this.context.dispose();
2534
2560
  clearTextTexture();